NAMD: Building namd
From Debian Clusters
This is part three of a four-part tutorial on building and testing NAMD and charm++. The full tutorial includes
There is also a troubleshooting page:
Contents |
Getting C Shell (csh)
You'll need to get CSH, the C shell, if you don't have it already. (Most base installations of Debian won't have it.) You can get this with
apt-get install csh
Tweaking Files before Building
Several files need to be tweaked before installing NAMD in order to point the build in the right places and avoid various various errors.
Pointing to Charm++
The first of these is in the directory NAMD_2.6_Source/Make.charm. There should only be one line:
CHARMBASE = /Projects/namd2/charm-5.9
Change this to
CHARMBASE = .rootdir/charm-5.9
The next file on the list to edit is arch/Linux-<your architecture>-MPI.arch (for instance, Linux-i686-MPI.arch). Open this file and change the line CHARMACH to
CHARMARCH = mpi-linux-gcc
or whatever other folder was created for you in the /charm-5.9 directory when you built charm++.
Tcl Updates
The builder also needs to know where to find tcl. Open arch/Linux-<your architecture>.tcl (for instance, arch/Linux-i686.tcl). Add -I/usr/include/tcl8.4/ to the first line and change -ltc in the second line so it looks like the following.
TCLDIR=/usr TCLINCL=-I$(TCLDIR)/include -I$(HOME)/tcl/include -I/usr/include/tcl8.4/ TCLLIB=-L$(TCLDIR)/lib -L$(HOME)/tcl/lib -ltcl8.4 -ldl
Removing --static from the Compiler
Finally, open arch/Linux-<architecture>-g++.arch. Take all out all instances off --static.
Building NAMD
Now you should be ready to build NAMD. From the base source directory for NAMD, run
./config tcl fftw Linux-<architecture>-MPI
This will create a new directory named Linux-<architecture>-MPI. Move into this directory, then run make. If you receive an error, you can look it up on the NAMD: Troubleshooting Errors page.
When it finishes successfully, you should see new executable binaries called namd2, psfgen, and charmrun, amongst others.
Moving NAMD
Once everything is working, the binaries can be moved to a different place (still on the NFS mount) where they're accessible as part of users' paths. This entire directory with the newly created executables can be copied over. A symlink (like a shortcut) to the .rootdir directory also needs to be changed to point to the old location. (This is why the compilation and such needs to be available as an NFS mount.)
To do this, from the new location for the files, run
rm .rootdir
and then
ln -s <source directory> .rootdir
For instance, mine looked like this:
ln -s /shared/usr/local/src/NAMD_2.6_Source/ .rootdir
I'm keeping my source on my NFS mount (/shared), under /usr/local/src. My binaries for the users are now under /shared/opt/namd. From within that directory, I ran the above command, which creates a symlink for .rootdir back into the original source.
Next
With NAMD set up, VMD is next.

