本帖最后由 fhh2626 于 2022-11-18 18:21 编辑
2022-11-18,按照最新版NAMD修改了教程
在这里下载NAMD Nightly version,建议下载devel branch
https://gitlab.com/tcbgUIUC/namd
懒得申请权限的可以在这里下载,不过版本较老:
https://www.ks.uiuc.edu/Research/namd/
在这里下载最新版colvars模块
http://colvars.github.io/
在这里下载OpenMM(2022-11-18:目前建议下载7.7.0)
https://github.com/openmm/openmm
下载本文提供的NAMDlib.zip附件
然后解压NAMD、Colvars和OpenMM
tar xvf NAMD_Git-2018-08-23_Source.tar.gz tar xvf colvars-master.tar.gz tar xvf openmm-7.7.0.tar.gz
更新NAMD中的Colvars,注意编译Colvars还需要OpenMM中的Lepton
export OPENMM_SOURCE=xxxxxxxxxxxxxxxxxxx
sh ./colvars-master/update-colvars-code.sh ./NAMD_Git-2018-08-23_Source
解压NAMD需要的libraries
mv NAMDlib.zip NAMD_Git-2018-08-23_Source cd NAMD_Git-2018-08-23_Source/ unzip NAMDlib.zip
解压编译charm并行模块
tar xvf charm-6.8.2.tar cd charm-6.8.2 ./build 编译时会问几个问题,按照实际情况回答,我是塔式服务器,仅供参考
Are you building to run just on the localmachine, and not across multiple nodes? [y/N] (Y)
Do you want to specify a compiler? [y/N] (N)
Do you want to specify any Charm++ buildoptions, such as fortran compilers? [y/N] (N)
Choose a set of compiler flags [1-5] (3)
1) none 2) debug mode -g -O0 3) production build [default] --with-production 4) production build w/ projections --with-production --enable-tracing 5) custom What do you want to build? (1)
1) Charm++ [default] (choose this if you are building NAMD) 2) Charm++ and AMPI 3) Charm++, AMPI, ParFUM, FEM and other libraries Do you want to compile in parallel? (5)
1) No 2) Build with -j2 3) Build with -j4 4) Build with -j8 5) Build with -j16 [default] 6) Build with -j32 7) Build with –j Do you want to start the build now? [Y/n] (Y)
然后配置NAMD
cd .. 没有GPU的话就去掉--with-cuda和后面的部分
./config Linux-x86_64-g++ --with-cuda --with-single-node-cuda --cuda-prefix /usr/local/cuda cd Linux-x86_64-g++/
修改配置文件,加入CHARM的绝对路径
nano Make.config 在里面找到:
CHARM = $(CHARMBASE)/$(CHARMARCH) 把=后面的部分改成绝对路径,如
/home/xxxxxxxxxxxxxxxx/NAMD_Git-2018-08-23_Source/charm-6.8.2
对于Ubuntu用户,可能需要在编译选项中加入-no-pie
nano ../arch/Linux-x86_64-g++.arch
找到CXXOPTS = -O3 -fexpensive-optimizations -ffast-math,在后面加上-no-pie
最后编译
make depends
make –j16
|