第二部分准备安装lammps
1.安装git
sudo apt-get install git
Mkdir ~/lammps
git clone git://git.lammps.org/lammps-ro.git ~/lammps
2.编译依赖包
2.1 gpu
cd ~/lammps /lib/gpu
vi Makefile.linux
修改如下两行
CUDA_HOME =/usr/local/cuda(根据你cuda安装的实际位置写)
CUDA_ARCH = -arch=sm_35
Make –f Makefile.linux
2.2 USER-CUDA package 的安装
cd ~/lammps /lib/cuda
vi Makefile.common
修改其中cuda 的安装路径,如果是默认的/usr/local/cuda则不用修改
Make –j4 cufft=0 arch=35
4是你自己电脑的cpu核数
precision=N to set the precision level
N = 1 for single precision (default)
N = 2 for double precision
N = 3 for positions in double precision
N = 4 for positions and velocities in double precision
arch=M to set GPU compute capability
M = 35 for Kepler GPUs
M = 20 for CC2.0 (GF100/110, e.g. C2050,GTX580,GTX470) (default)
M = 21 for CC2.1 (GF104/114, e.g. GTX560, GTX460, GTX450)
M = 13 for CC1.3 (GF200, e.g. C1060, GTX285)
prec_timer=0/1 to use hi-precision timers
0 = do not use them (default)
1 = use them
this is usually only useful for Mac machines
dbg=0/1 to activate debug mode
0 = no debug mode (default)
1 = yes debug mode
this is only useful for developers
cufft=1 for use of the CUDA FFT library
0 = no CUFFT support (default)
in the future other CUDA-enabled FFT libraries might be supported
编译完以后修改Makefile.lammps文件,删掉里面的-DCUFFT –lcufft
2.3 Atc(atom-to-continuum coupling)
cd ~/lammps /lib/atc
make –f Makefile.g++ -j 4
2.4 meam(modified EAM potential)
cd ~/lammps /lib/meam
make –f Makefile.gfortran
2.5 AWPMD(wave-packet MD)
cd ~/lammps /lib/awpmd
make –f Makefile.mpicc
2.6 colvars(collective variables)
cd ~/lammps /lib/colvars
make –f Makefile.g++
2.7 kokkos(Kokkos-enabled styles)
cd ~/lammps/lib/kokkos
vi Makefile.lammps
修改其中cuda的安装路径,如果你不是安装在默认的/usr/local/cuda的话。
2.8 linalg
cd ~/lammps/lib/linalg
make –f Makefile.gfortran
2.9 poems(coupled rigid body motion)
cd ~/lammps/lib/poems
make –f Makefile.g++ -j 20
2.10 reax
cd ~/lammps/lib/reax
make –f Makefile.gfortran -j 4
2.11 qmmm
cd ~/lammps/lib/qmmm
make –f Makefile.gfortran
第三部分:正式安装
cd ~/lammps/src
make yes-all (安装所有包)
make no-kokkos (取消安装kokkos包,这个包单独装可以成功,和其他包一起似乎有冲突。待高人解决)
然后用make ps查看所有的包
修改makefile 文件:
vi ./MAKE/MACHINES/Makefile.ubuntu
在其中的CCFLAGS变量中添加 -DLAMMPS_MEMALIGN=64
然后输入make -j 8 ubuntu即可(这里的8是你cpu核数)
最后会在src目录下产生一个lmp_ubuntu的文件,就是lammps的命令了。