NAMD Wiki: NamdOnWin64

  You are encouraged to improve NamdWiki by adding content, correcting errors, or removing spam.

Installing Namd on the 64 bit Windows machine to use on the Windows CCS cluster is quite straight forward.

The first thing that needs to be done is to compile Charm++. The steps are provided below. All of the following assume that the compilation is done in cygwin. This is a native port but the scripts are in bash and thus require a bash interpreter which is present under cygwin.

Charm++:

1.) Download the most recent CVS version of charm.

2.) Make sure that the windows 64 bit compiler/linker (cl.exe/link.exe) are in your path.

3.) Edit the build file in the charm directory as follows. (This should already be done in the CVS version of charm++).

#Win64 version needs special compilers and copied (not linked)

#source files.

echo "Copying compilers for win64 into cygwin /bin directory"

cp $src/win64/unix2nt* /bin

cp $src/win64/system_ln $VERSION/tmp

cp $src/win64/unistd.h $VERSION/tmp

cp $src/win64/unistd.h $VERSION/include

cp $src/win64/createlink.exe /bin

tr '\015' ' ' < $VERSION/tmp/system_ln > $VERSION/tmp/temp

mv $VERSION/tmp/temp $VERSION/tmp/system_ln

chmod +x $VERSION/tmp/system_ln

4.) Edit the src/arch/unix2nt_cc to include the correct library and header paths as shown below. (This should already be done in the CVS version of charm++).

#Configurable option: Location of MSDEV

VCC_DIR="C:/Program Files (x86)/Microsoft Visual Studio 8/VC"

#SDK_DIR="C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2"

SDK_DIR="C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK"

INT_DIR="C:\Program Files (x86)\Intel\Compiler\C++\10.0.025\EM64T"

#CL command-line options for -O and -g mode

#only for the environment that has set corresponding environmental variables

CL_CMD="cl.exe"

#CL_CMD="$VCC_DIR/BIN/CL.EXE"

CL_COMMON=' /nologo /W3 /EHsc /D_WINDOWS /FD /O2'

#CL_COMMON="$CL_COMMON /I`cygpath -d \"$SDK_DIR/Include/crt\"`"

CL_COMMON="$CL_COMMON I`cygpath -d \"$VCC_DIR/Include\"`"

CL_COMMON="$CL_COMMON I`cygpath -d \"$SDK_DIR/Include\"`"

CL_O=$CL_COMMON" /DNDEBUG /MT /Ox"

CL_DEF=$CL_COMMON" /MT"

CL_G=$CL_COMMON" /Z7 /MTd /Od"

CL_DLL="/LD"

#LINK command-line options for -O and -g mode

#only for the environment that has set corresponding environmental variables

LINK_CMD="link.exe"

LINK_COMMON='/nologo /subsystem:console /NODEFAULTLIB:MSVCRT.lib '

LINK_COMMON="$LINK_COMMON /LIBPATH:`cygpath -d \"$SDK_DIR/Lib/AMD64\"`"

LINK_COMMON="$LINK_COMMON /LIBPATH:`cygpath -d \"$VCC_DIR/Lib/AMD64\"`"

LINK_O=$LINK_COMMON

LINK_DEF=$LINK_COMMON

LINK_G="$LINK_COMMON /DEBUG"

LINK_POST='ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowu.lib /MACHINE:X64 /ERRORREPORT:PROMPT '

5.) Edit the src/arch/unix2nt_ar to include the correct library and header paths as shown below. (This should already be done in the CVS version of charm++).

VCC_DIR="C:/Program Files/Microsoft Visual Studio 8/VC"

#only valid for the platform that has exported corresponding variables

LIB_CMD="lib.exe"

LIB_OPTS='/nologo'

NOTE: for steps 4 and 5 unix2nt_cc/unix2nt_ar may need to be converted from a unix text file to a windows text file. (i.e. tr '\015' ' ' < $VERSION/tmp/unix2nt_ > ).*

6.) Add #include <io.h> to src/xlat-i/xi-scan.C

7.) Type build charm++ net-win64

NOTE: Charmrun was not able to access the charmd daemon/service if using the intel compiler (icl.exe).

So now we got through charm and we move onto NAMD

NAMD will require fftw and tcl in order to get full functionality.

First we will start with Tcl

NOTE: I found that Tcl 8.4 did not work with Namd. I compile Tcl 8.5 and it worked.

Tcl 8.5 comes with a nmake file to compile Tcl:

1.)Download the windows platform SDK R2 for x64.

2.)Open up the 64 bit command window under the platform SDK.

3.)Got to the C:\tcl8.5a6\win directory and type nmake.

the compiled tcl should be found in a directory such as C:\tcl8.5a6\win\Release_AMD64_VC8

Next compile FFTW

FFTW is really easy to compile using the Visual Studio 2005 IDE.

1.) Open up the visual studio IDE

2.) Under file, select new and project from existing code.

3.) Select Visual C++

4.) Under specify location select the fftw file (i.e. C:\fftw-2.1.5\fftw) and give it a name (i.e FFTWSINGLE)

NOTE: Thia will need to be repeated/integrated for rfftw.

5.) Under project setting select static library project

6.) Make sure you select x64 under solutions platform and build.

NOTE for rfftw you will need to provide a path to the header files in the fftw directory.

Now onto NAMD

Also in cygwin

1.) Edit Make.charm to contain the correct path to the charm installation CHARMBASE = /cygdrive/c/share/NAMD_2.6_Source/charm

2.) Edit arch/Win64-MSVC.arch

NAMD_ARCH = Win64 CHARMARCH = net-win64

CXX = cl /nologo /MT /TP /DWIN32 /DWIN64 /DNAMD_SOCKLEN_T=int /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /EHsc

CC = cl /nologo /MT /DWIN32 /DWIN64 /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /EHsc

LINK = link /nologo /subsystem:console /incremental:no \

kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \

advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib \

odbccp32.lib ws2_32.lib

CXXOPTS = /O2

CXXTHREADOPTS =

COPTS = /O2

LINKOPTS = /OPT:REF /LIBPATH:`cygpath -d 'C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\Lib\AMD64'` \

/LIBPATH:`cygpath -d 'C:\Program Files (x86)\Microsoft Visual Studio 8\VC\LIB\AMD64'` \

/LIBPATH:`cygpath -d 'C:\tcl8.5a6\win\Release_AMD64_VC8'`

winall: windowsbinaries

3.) Edit arch/Win64.tcl

TCLDIR = C:/tcl8.5a6

TCLINCL = /I `cygpath -d '$(TCLDIR)/generic'`

TCLLIB = -L/cygdrive/c/tcl8.5a6/win/Release_AMD64_VC8 -ltcl85

TCLWINLIB = $(TCLDIR)/win/RELEASE_AMD64_VC8/tcl85.lib

TCLDLL = tcl85.dll

TCLFLAGS = /DNAMD_TCL /DUSE_NON_CONST

TCL = $(TCLINCL) $(TCLFLAGS)

$(TCLSENTINEL)$(TCLDLL):

$(COPY) $(TCLDIR)/win /Release_AMD64_VC8/$(TCLDLL) $(TCLDLL)

TCLSENTINEL = not_$(TCLSENTIEL)

4.) Edit arch/Win64.fftw

FFTDIR = fftw (This should be the correct path to the fftw libraries and headers, I put the fftw directory in my source directory thus no path)

FFTINCL = /I$(FFTDIR)/include

FFTLIB = -L$(FFTDIR)/lib -lFFTW2DLL -lRFFTW2DLL (the names of the libraries are arbitrary and based on how they are compiled as decribed above, I chose FFTW2DLL and RFFTW2DLL. You can always chose sfftw and srfftw. )

FFTFLAGS = /DNAMD_FFTW

FFT = $(FFTINCL) $(FFTFLAGS)

5.) Edit the Makefile (located in the top directory of the NAMD source code)

add/edit the following variable accordingly:

SDKINC =`cygpath -d 'C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include'`

VCINC = `cygpath -d 'C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include'`

CHARMINC = `cygpath -d 'C:\share\NAMD_2.6_Source\charm\net-win64\tmp'` $(COPTD)CMK_OPTIMIZE=1

CXXBASEFLAGS = $(COPTI)$(CHARMINC) $(COPTI)$(VCINC) $(COPTI)$(SDKINC) $(COPTI)$(SRCDIR) $(COPTI)$(INCDIR) $(DPMTA) $(DPME)$(COPTI)$(PLUGININCDIR) $(TCL) $(FFT) $(CCS) $(RELEASE)

CFLAGS = $(COPTI)$(SRCDIR) $(COPTI)$(VCINC) $(COPTI)$(SDKINC) $(TCL) $(COPTS) $(RELEASE)

PLUGINGCCFLAGS = $(COPTI)$(PLUGINSRCDIR) $(COPTI)$(PLUGININCDIR) $(COPTI)$(VCINC) $(COPTI)$(SDKINC)

SBCFLAGS = $(COPTI)$(SBSRCDIR) $(COPTI)$(VCINC) $(COPTI)$(SDKINC) $(TCL) $(COPTS) $(RELEASE)

SBGCCFLAGS = $(COPTI)$(SBSRCDIR) $(COPTI)$(VCINC) $(COPTI)$(SDKINC) $(TCL) $(RELEASE)

6.) type config tcl fftw Win64-MSVC

7.) cd Win64-MSVC

8.) Make

NOTE: An additional thing to watch out for is that cygwin also has a link.exe. Make sure the link.exe you are executing is not the cygwin version.

:) All Done

Cheers,

Ilya Chorny

Stroud Lab

UC San Francisco

ichorny@gmail.com