本文均在CentOS7(release 7.6.1810)版本下进行过的测试
使用gcc4.8.5编译环境。
1 解压安装包
tar jxvf AmberTools18.tar.bz2
tar jxvf Amber18.tar.bz2
2 安装环境依赖
需要使用默认的CentOS7编译器,以及gcc4.8.5编译的CUDA组件。
sudo yum install gcc gcc-gfortran gcc-c++ flex tcsh zlib-devel
bzip2-devel libXt-devel libXext-devel libXdmcp-devel
tkinter openmpi openmpi-devel perl perl-ExtUtils-MakeMaker
patch bison boost-devel
#~/.bashrc中添加环境
#AMBER
test -f /mnt/sdd/software/amber/amber18/amber.sh && source /mnt/sdd/software/amber/amber18/amber.sh
export AMBERHOME=/mnt/sdd/software/amber/amber18
export CUDA_HOME=/usr/local/cuda
export PATH=$PATH:$CUDA_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64
3 修复anaconda_libuuid.so.1的错误:
错误:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libSM.so: undefined reference to `uuid_unparse_lower@UUID_1.0'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libSM.so: undefined reference to `uuid_generate@UUID_1.0'
解决办法:
mv /root/anaconda2/lib/libuuid.so.1 /root/anaconda2/lib/libuuid.so.1_backup
rm -rf /mnt/sdd/software/anaconda2/lib/libuuid.so.1
ln -s /usr/lib64/libuuid.so.1.3.0 /root/anaconda2/lib/libuuid.so.1
4 安装conda环境
conda install --file $AMBERHOME/AmberTools/src/python_requirement.txt
5 编译AMBER:
先安装串行,再安装并行,最后加入gpu。
第一次进行configure的时候会检查补丁,推荐安装补丁。
「知友」反馈,configure完需要进行source amber.sh
5.1 编译串行版本
cd $AMBERHOME
./configure --with-python /root/anaconda2/bin/python gnu
source /mnt/sdd/software/amber/amber18/amber.sh
make install
# Testing
make test
5.2 编译并行版本
cd $AMBERHOME
./configure --with-python /root/anaconda2/bin/python -mpi gnu
source /mnt/sdd/software/amber/amber18/amber.sh
make install
export DO_PARALLEL="mpirun --allow-run-as-root -np 4 "
./configure --with-python /usr/bin/python -openmp gnu
source /mnt/sdd/software/amber/amber18/amber.sh
make openmp
5.3 编译GPU版本
cd $AMBERHOME
./configure --with-python /root/anaconda2/bin/python -cuda gnu
make install
./configure --with-python /root/anaconda2/bin/python -cuda -mpi gnu
make install
# Testing
make test.cuda
make test.cuda_parallel
6 解决动态库的问题
sudo ldconfig /usr/local/cuda/lib64
sudo ldconfig /mnt/sdd/software/amber/amber18/lib64