-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamber gpu 安装
217 lines (190 loc) · 5.25 KB
/
amber gpu 安装
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
gpu驱动、cuda以经安装完毕
1.4 安装依赖的软件及软件库
AMBER官网上有各系统所需要的依赖包:http://ambermd.org/InstUbuntu.php
针对UBUNTU18.04
apt -y update
apt -y install tcsh make \
gcc gfortran \
flex bison patch \
bc xorg-dev libbz2-dev wget
1.5 安装anaconda
这一步可以装也可以不装,因为amber安装过程中会自动帮你下载python,但是习惯了anaconda的使用了,就用了anaconda
下载地址:https://www.anaconda.com/products/individual
编译与安装:
bash Anaconda3-5.2.0-Linux-x86_64.sh #安装
python #检查安装是否成功
quit()
1
2
3
但是再后续安装过程中,发生了一个神奇的错误,开始以为是gcc的错误,后面发现是python3.7的问题,查了很多解决方式也没解决这个问题
所以另开了python3.6的版本
conda create -n py36 python=3.6 anaconda #py36为自己取的名字,python=3.6是我需要的版本号
conda activate py36 #启用python3.6
python #查看是否切换成功
quit()
which python #查看python所在路径
2.AMBER18的下载和安装
2.1下载AMBER18
于官网上下载:http://ambermd.org
2.2 编译AMBER18串行版本
2.2.1 解压安装包
tar jxvf AmberTools18.tar.bz2 -C /opt
tar jxvf Amber18.tar.bz2 -C /opt
1
2
2.2.2 配置环境变量
vi ~/.bashrc #打开 bashrc文件
#CUDA
export CUDA_HOME=/usr/local/cuda-9.1
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib:$LD_LIBRARY_PATH
#Amber18
test -f /opt/amber18/amber.sh && source /opt/amber18/amber.sh
export AMBERHOME=/opt/amber18
export CUDA_HOME=/usr/local/cuda
export PATH=$PATH:$CUDA_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64
source ~/.bashrc #source 后立即生效
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2.2.2 编译
cd $AMBERHOME
which python #查看python位置用于替换下一个命令
./configure --no-updates --with-python /usr/anaconda3/evns/py36/bin/python gnu
1
2
3
编译之后当前文件夹下会产生amber.sh文件 可用于环境变量的设置:
cat amber.sh
export AMBER_PREFIX="/mnt/nfs/data/software/amber/amber18"
export AMBERHOME=/mnt/nfs/data/software/amber/amber18
export PATH="${AMBER_PREFIX}/bin:${PATH}"
# Add location of Amber Python modules to default Python search path
if [ -z "$PYTHONPATH" ]; then
export PYTHONPATH="${AMBER_PREFIX}/lib/python3.6/site-packages"
else
export PYTHONPATH="${AMBER_PREFIX}/lib/python3.6/site-packages:${PYTHONPATH}"
fi
if [ -z "${LD_LIBRARY_PATH}" ]; then
export LD_LIBRARY_PATH="${AMBER_PREFIX}/lib"
else
export LD_LIBRARY_PATH="${AMBER_PREFIX}/lib:${LD_LIBRARY_PATH}"
fi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
自己手动添加到环境变量中
2.2.3 安装与测试
make install # 编译安装
make test # 编译测试
1
2
2.3 编译AMBER18并行版本
2.3.1 安装和编译openmpi
2.3.1.1 下载与解压
如果还想装并行版本的AMBER18的话则需要下载 openmpi
版本要求在 $AMBERHOME/AmberTools/src/configure_openmpi中有说明,
mpidirs=/bin/ls -d openmpi-1.[5-9]*/ 2>/dev/null | tail -n 1
1
下载的openmpi版本如果>2.0的话 后续的安装过程中不会报错,但是test过程中会因为root下无法启动openmpi而报错,
mpirun has detected an attempt to run as root.
Running at root is *strongly* discouraged as any mistake (e.g., in defining TMPDIR) or bug can result in catastrophic damage to the OS file system, leaving your system in an unusable state
1
2
有很多种办法解决这种问题,但是我还是采用了最暴力的干脆别下>2.0的版本
V1.8下载地址:http://www.open-mpi.org/software/ompi/v1.8/
然后进行安装,解压到$AMBERHOME/AmberTools/src 目录之下
wget -c https://download.open-mpi.org/release/open-mpi/v1.8/openmpi-1.8.8.tar.gz
tar zxvf openmpi-1.8.8.tar.gz -C $AMBERHOME/AmberTools/src
1
2
2.3.1.2 src目录下编译
cd $AMBERHOME/AmberTools/src
./configure_openmpi gnu
1
2
2.3.1.3 环境变量的设置
vi ~/.bashrc
export MPI_HOME=$AMBERHOME/AmberTools
export PATH=$PATH:$MPI_HOME/bin
export LD_LIBRARY_PATH=$MPI_HOME/lib:$LD_LIBRARY_PATH
export DO_PARALLEL="mpirun -np 8"
# Note the value below may depend on your MPI implementation,因为某些测试中需要用到的线程较多,所以最好设置4个或8个
source ~/.bashrc #执行环境变量文件
1
2
3
4
5
6
7
8
9
2.3.2 编译AMBER18并行版本
cd $AMBERHOME
make clean
which python #查看python位置用于替换下一个命令
./configure --no-updates --with-python /usr/anaconda3/evns/py36/bin/python -mpi gnu
1
2
3
4
2.3.3 安装与测试
make install # 编译安装
make test # 编译测试
1
2
在这里插入图片描述
2.4 编译AMBER18GPU加速版本
2.4.1 编译
cd $AMBERHOME
make clean
which python #查看python位置用于替换下一个命令
./configure --no-updates --with-python /usr/anaconda3/evns/py36/bin/python -cuda gnu #不可省略
./configure --no-updates --with-python /usr/anaconda3/evns/py36/bin/python -mpi gnu #紧接着上一步
1
2
3
4
5
2.4.2 安装与测试
make install # 编译安装
make test.cuda_serial # 编译测试gpu串行版
export DO_PARALLEL='mpirun -np 2
make test.cuda_parallel #编译测试gpu并行版(只有一块gpu 就掠过这个环节了0.0)
1
2
3
4
5
在这里插入图片描述