Compiling and Installing NAMD
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following commands to create the NAMD-related directories:
cd /path/to/NAMD mkdir NAMD-2.13 cd NAMD-2.13 mkdir build install export BUILD_DIR=`pwd`/build export INSTALL_DIR=`pwd`/install
- Run the following commands to set the environment variables.
export CC=`which gcc` export CXX=`which g++` export FC=`which gfortran`
- Run the following commands to compile and install CHARM:
cd /path/to/NAMD/NAMD-2.13/build tar -xvf charm-6.9.0.tar.gz cd charm-6.9.0 mkdir ${INSTALL_DIR}/charm690/ cp src/arch/mpi-linux-x86_64 src/arch/mpi-linux-arm8 -rf grep -rl 'm64' src/arch/mpi-linux-arm8 | xargs sed -i 's/\-m64//g' ./build charm++ mpi-linux-arm8 smp --with-production --destination=/path/to/NAMD/NAMD-2.13/install/charm690/mpi-linux-arm8 - Run the following commands to decompress the NAMD installation package:
cd /path/to/NAMD/NAMD-2.13/build tar -zxvf NAMD_2.13_Source.tar.gz cd NAMD_2.13_Source
- Run the following command to create Linux-ARM64.fftw3:
cp arch/Linux-x86_64.fftw3 arch/Linux-ARM64.fftw3
- Run the following commands to upload and decompress the TCL file:
cd /path/to/NAMD/NAMD-2.13 tar -xvf tcl8.5.9-linux-arm64-threaded.tar.gz
- Run the following commands to modify the Make.charm file:
- Open Make.charm.
cd /path/to/NAMD/NAMD-2.13/build/NAMD_2.13_Source vi Make.charm
- Press i to enter the insert mode and modify the file as follows:
CHARMBASE = /path/to/NAMD/NAMD-2.13/install/charm690
Change the value of CHARMBASE to the actual installation path of CHARM.
- Press Esc, enter :wq!, and press Enter to save the file and exit.
- Open Make.charm.
- Run the following commands to modify the Linux-ARM64-g++.arch file:
- Open Linux-ARM64-g++.arch.
cd /path/to/NAMD/NAMD-2.13/build/NAMD_2.13_Source vi arch/Linux-ARM64-g++.arch
- Press i to enter the insert mode and modify the file as follows:
NAMD_ARCH = Linux-ARM64 CHARMARCH = mpi-linux-arm8 #FLOATOPTS = -O2 -ffast-math -funsafe-math-optimizations -fomit-frame-pointer -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 FLOATOPTS = -O3 -ffast-math -funsafe-math-optimizations -fomit-frame-pointer -march=armv8-a CXX = g++ -std=c++11 CXXOPTS = $(FLOATOPTS) CXXNOALIASOPTS = $(FLOATOPTS) -fno-strict-aliasing CC = gcc COPTS = $(FLOATOPTS)
- Press Esc, enter :wq!, and press Enter to save the file and exit.
- Open Linux-ARM64-g++.arch.
- Run the following commands to configure NAMD:
./config Linux-ARM64-g++ --with-fftw3 --fftw-prefix /path/to/FFTW --with-tcl --tcl-prefix /path/to/NAMD/NAMD-2.13/tcl8.5.9-linux-arm64-threaded --charm-arch mpi-linux-arm8 cd Linux-ARM64-g++
- Run the following commands to compile and install NAMD:
make -j
- Run the following command to check whether an executable file is generated:
ll /path/to/NAMD/NAMD-2.13/build/NAMD_2.13_Source/Linux-ARM64-g++/namd2
-rwxr-xr-x 1 root root 16140248 Aug 7 15:50 namd2
Parent topic: NAMD 2.13 Porting Guide (CentOS 7.6)