Compile NAMD on Windows 64 bit; nocuda, multicore

From: Mortimer Hemmit (
Date: Sun Apr 12 2020 - 17:36:46 CDT


I have put together a little guide to compile nocuda multicore NAMD on
Windows 64-bit for reference.
Any feedback is greatly appreciated.

This is a guide for compiling 64-bit NAMD, multicore, nocuda, on 64-bit Windows.

Version 1: April 12, 2020; Mortimer Hemmit

* STEP 1: Download Neccesary Programs *

First, you must download two programs: Cygwin and Visual Studio.

1. Cygwin
You can download Cygwin from
Run "setup-x86_64.exe" on the home page, or click this link
Read the information and hit Next.
Select "Install from Internet" and hit Next.
Root Directory as "C:\cygwin64" is completely fine. Installing for
"All Users" is recommended. Hit Next.
Your Downloads folder is a perfectly fine place to keep what you've
downloaded! Hit Next.
Use System Proxy Settings should work. Hit Next.
Select a Download Site. It's faster if you download from somewhere
that's physically close to you.
Go to to find out which mirrors
are located where. Select your favorite site and hit next!

Now we get to choose which packages to install. Keep all the defaults.
However, we will select a few additional packages:

1. Make (4.3.1)
2. Binutils (2.34+1git.de9c1b7cfe-1)
3. Perl (5.30-2.1)
4. gcc-fortran (9.3.0-1)
5. autoconf (13-1)

On the top left, change the view from "Pending" to "Category".

Search for "make" in the little search box and hit enter. Now hit the
"+" sign near "All" and the "+" sign near "Devel".
Find the row labeled "make": The GNU version of the 'make' utility.
One of the columns in the "make" entry says "Skip". That means it will
skip installing this package.
Because we need it, click on the arrow near Skip and instead select
the latest version (don't select the test version).

Note: Ignore other packages that sound like make such as "cmake",
"automake", "imake", etc. Just install make.

Repeat this process for the other four packages listed earlier.
1. Make is under Devel
2. Binutils is under Devel
3. Perl is under Perl
4. gcc-fortran is under Devel
5. autoconf is under Devel

Hit Next, look at everything you're installing, and hit Next again,
and then wait for it to install. Make a desktop shortcut since we'll
use it later.

2. Visual Studio Community 2019 with C++ support
Go to
or and download Visual Studio Community.

Note: Professional and Enterprise editions cost money.
However, the Community edition is free and perfect for the academic
research that you'll probably be doing.

Go through all the UAC prompts..

Now in the "Visual Studio Installer", scroll down to "Desktop
development with C++", check that box, and hit install.

Note: this is a ~7 gb installation. It's big.

* STEP 2: Downloading NAMD Source Code *

Go to
and click on "Source Code" for either the nightly version or the
latest version.
It'll prompt you to sign in, and then you will get a .tar file which
is a compressed version of the source code.

IMPORTANT STEP: Save the NAMD tar file inside C:\cygwin64\home\
Do NOT save it inside C:\cygwin64\home\%your username%\
Why? %your username% might have spaces, such as "John Smith". Folder
names with spaces will break the compile process :C

* STEP 3: Compile Charm++ *

IMPORTANT (again): Save the NAMD tar file inside C:\cygwin64\home\
Do NOT save it inside C:\cygwin64\home\%your username%\
Why? %your username% might have spaces, such as "John Smith". Folder
names with spaces will break the compile process :C

Some folder names will likely be different in your case (such as the
date in the NAMD version). Adjust accordingly.

cd ../
tar -xf NAMD_Git-2020-04-12_Source.tar.gz
cd NAMD_Git-2020-04-12_Source
tar -xf charm-6.10.1.tar
cd charm-6.10.1

IMPORTANT STEP: In the Windows search box near the bottom left hand
side of your screen, search for the x64 Native Tools Command Prompt.
Make sure it is the ****x64 Native Tools**** Command Prompt for VS 2019
Don't use the normal command prompt, or the normal developer command prompt.

Why do we need this? The developer command prompt defines some
important environment variables. For example, it adds things like
"cl.exe" and "link.exe" to the PATH.
Drag the desktop icon for "Cygwin" into the x64 developer command
prompt, click in the command prompt to bring it into focus, and hit
A cute little cygwin terminal will pop up that has inherited the
variables defined in the command prompt.

NOTE: The current Charm++ version that comes with NAMD contains a
unix2nt_cc script that doesn't work with Visual Studio 2017 and newer
since those versions put tools in a new place.
Charm++ very recently fixed this issue on their Github, which should
make its way into NAMD soon. For the time being, however, here's the
workaround for you to manually edit the files.


Open charm-6.10.1/src/arch/win/unix2nt_cc and find these lines:

if [ "`which link`" != "/usr/bin/link" ]
elif test -d "`cygpath -u \"$VCC_DIR/bin/HostX64/x64\"`"
elif test -d "`cygpath -u \"$VCC_DIR/BIN/amd64\"`"
LINK_COMMON='-nologo -subsystem:console '

DELETE the above lines and REPLACE them with

cl_path=`command -v cl`
if [[ "`command -v link`" != '/usr/bin/link' ]]
elif [[ -d "`cygpath -u "${cl_path%cl}"`" ]]
elif [[ -d "`cygpath -u "$VCC_DIR/BIN/amd64"`" ]]
LINK_COMMON='-nologo -subsystem:console -DYNAMICBASE:NO'

Now, type:

./build charm++ multicore-win64 gfortran --with-production

* STEP 4: Download TCL and FFTW libraries *

Download TCL and FFTW located at
If you want a multicore version, make sure to download tcl-threaded.
Save these files inside the folder NAMD_Git-2020-04-11_Source

Extract the archives:

cd ../
tar -xf tcl8.5.9-win64-threaded.tar.gz
tar -xf fftw-win64.tar.gz

Rename the folders:

mv tcl8.5.9-win64-threaded tcl-threaded
mv fftw-win64 fftw

* STEP 5: Compile NAMD *


./config Win64-MSVC --charm-arch multicore-win64-gfortran
cd Win64-MSVC

Now we're (hopefully?) done!


This archive was generated by hypermail 2.1.6 : Thu Dec 31 2020 - 23:17:13 CST