CPU版本lammps编译安装过程

  sre


CPU版本lammps
需要准备的软件包有这些
lammps-14Feb14.tar.gz
openkim-api-v1.3.0.tgz
voro++-0.4.6.tar.gz
jpegsrc.v9a.tar.gz

tar -xvf lammps-14Feb14.tar.gz /opt/software/
tar -xvf openkim-api-v1.3.0.tgz -C /opt/software/lammps-14Feb14/lib
tar -xvf voro++-0.4.6.tar.gz -C /opt/software/lammps-14Feb14/lib
tar -xvf jpegsrc.v9a.tar.gz -C /opt/software/lammps-14Feb14/lib
cd /opt/software/lammps-14Feb14/lib/openkim-api-v1.3.0
mv Makefile.KIM_Config.example Makefile.KIM_Config
vim Makefile.KIM_Config
36行 KIM_DIR = /opt/software/lammps-14Feb14/lib/openkim-api-v1.3.0
make && make install
cd /opt/software/lammps-14Feb14/lib/voro++-0.4.6
vim config.mk
21行 PREFIX=/opt/software/lammps-14Feb14/lib/voro++-0.4.6
make && make install
cd /opt/software/lammps-14Feb14/lib/jpeg-9a
./configure –prefix=/opt/software/lammps-14Feb14/lib/jpeg-9a/
make && make install

cd /opt/software/lammps-14Feb14/lib
cd atc
vim Makefile.icc
22行后面加入 -I/opt/software/mpich2-intel/include/
22行实例:CCFLAGS = -O -g -fPIC -I../../src -DMPICH_IGNORE_CXX_SEEK -I/opt/software/mpich2-intel/include/
make -f Makefile.icc
cd /opt/software/lammps-14Feb14/lib/awpmd make -f Makefile.openmpi
cd ../colvars/ make -f Makefile.g++
cd ../linalg make -f Makefile.gfortran
cd ../meam make -f Makefile.ifort
vim Makefile.lammps
这行修改成这个样子
meam_SYSLIB = -lifcore -lsvml -liompstubs5 -limf
注释掉meam_SYSPATH这行
cd ../poems make -f Makefile.icc
cd ../reax make -f Makefile.ifort
vim Makefile.lammps
这行修改成这个样子
meam_SYSLIB = -lifcore -lsvml -liompstubs5 -limf
注释掉meam_SYSPATH这行

cd /opt/software/lammps-14Feb14/src/STUBS
make

cd /opt/software/lammps-14Feb14/src
make yes-all
make no-GPU
make no-USER-CUDA

vim /opt/software/lammps-14Feb14/src/MAKE/Makefile.mkl
第9行 CC = mpicc
第11行 CCFLAGS = -O3 -unroll0
第15行 LINK = mpicc
第16行 LINKFLAGS = -O -L/opt/intel/icc/composer_xe_2013/mkl/lib -lstdc++ -lpthread -L/opt/mathlib/lapack/ -lblas -L/opt/software/lammps-14Feb14/lib/voro++-0.4.6/src -lvoro++
第17行 LIB = -lstdc++ -lpthread
第41行 MPI_INC = -I/opt/software/mpich2-intel/include
第42行 MPI_PATH = -L/opt/software/mpich2-intel/lib
第43行 MPI_LIB = -lmpich -lpthread
第52行 FFT_INC = -I/opt/mathlib/fftw-2.1.5/include
第53行 FFT_PATH = -L/opt/mathlib/fftw-2.1.5/lib
第68行 JPG_INC = -I/opt/software/lammps-14Feb14/lib/jpeg-9a/include
第69行 JPG_PATH = -L/opt/software/lammps-14Feb14/lib/jpeg-9a/lib
第70行 JPG_LIB = -ljpeg

第89行 kim_SYSINC = -I/opt/software/lammps-14Feb14/lib/openkim-api-v1.3.0/KIM_API
第90行 kim_SYSLIB = -lkim
第91行 kim_SYSPATH = -L/opt/software/lammps-14Feb14/lib/openkim-api-v1.3.0/KIM_API

第93行 voronoi_SYSINC = -I/opt/software/lammps-14Feb14/lib/voro++-0.4.6/include/voro++
第94行 voronoi_SYSLIB = -lvoro++
第95行 voronoi_SYSPATH = -L/opt/software/lammps-14Feb14/lib/voro++-0.4.6/lib

make -j2 mkl

会显示 “pair_adp_omp.o错误2”以及 “ThrData” has no member timer”
vim /opt/software/lammps-14Feb14/src/compute_voronoi_atom.h
24行#include “/opt/software/lammps-14Feb14/lib/voro++-0.4.6/include/voro++/voro++.hh”
vim /opt/software/lammps-14Feb14/src/VORONOI/compute_voronoi_atom.h 修改同样位置

vim /opt/software/lammps-14Feb14/src/pair_adp_omp.cpp
220
221
203行用//注释
vim /opt/software/lammps-14Feb14/src/USER-OMP/pair_adp_omp.cpp 修改同样位置

make -j2 mkl

注意生成lmp_mkl文件要看下这个文件的大小,应该是86M

执行./lmp_mkl可能会有少lib,如果需要的话可以加入下面的命令
export LD_LIBRARY_PATH=/opt/intel/icc/composer_xe_2013.3.163/compiler/lib/intel64/:LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/opt/software/lammps-14Feb14/lib/jpeg-9a/lib/:LD_LIBRARY_PATH

export PATH=/opt/software/lammps-14Feb14/src:$PATH

3 thoughts on - CPU版本lammps编译安装过程

  • 报错
    [root@node01 src]# make -j2 mkl
    make[1]: Entering directory `/opt/software/lammps-1Feb14/src/Obj_mkl’
    mpicc -O3 -unroll0 -DLAMMPS_GZIP -DLMP_USER_OMP -I../../lib/colvars -I../../lib/awpmd/ivutils/include -I../../lib/awpmd/systems/interact -I../../lib/atc -I../../src -I../../lib/reax -I../../lib/poems -DLMP_MPIIO -I../../lib/meam -I/opt/software/mpich2-intel/include -I/opt/mathlib/fftw-2.1.5/include -I/opt/software/lammps-22May14/lib/voro++-0.4.6/include/voro++ -I/opt/software/lammps-22May14/lib/openkim-api-v1.3.0/KIM_API -M ../pair_adp.cpp > pair_adp.d
    ../pair_adp.cpp(220): error #11: unrecognized preprocessing directive
    # lambda[2] += w2*delz*delz;
    ^

    mpicc -O3 -unroll0 -DLAMMPS_GZIP -DLMP_USER_OMP -I../../lib/colvars -I../../lib/awpmd/ivutils/include -I../../lib/awpmd/systems/interact -I../../lib/atc -I../../src -I../../lib/reax -I../../lib/poems -DLMP_MPIIO -I../../lib/meam -I/opt/software/mpich2-intel/include -I/opt/mathlib/fftw-2.1.5/include -I/opt/software/lammps-22May14/lib/voro++-0.4.6/include/voro++ -I/opt/software/lammps-22May14/lib/openkim-api-v1.3.0/KIM_API -c ../compute_voronoi_atom.cpp
    mpicc -O3 -unroll0 -DLAMMPS_GZIP -DLMP_USER_OMP -I../../lib/colvars -I../../lib/awpmd/ivutils/include -I../../lib/awpmd/systems/interact -I../../lib/atc -I../../src -I../../lib/reax -I../../lib/poems -DLMP_MPIIO -I../../lib/meam -I/opt/software/mpich2-intel/include -I/opt/mathlib/fftw-2.1.5/include -I/opt/software/lammps-22May14/lib/voro++-0.4.6/include/voro++ -I/opt/software/lammps-22May14/lib/openkim-api-v1.3.0/KIM_API -c ../fix_nph_eff.cpp
    ../compute_voronoi_atom.h(25): catastrophic error: cannot open source file “/opt/software/lammps-22May14/lib/voro++-0.4.6/include/voro++/voro++.hh”
    #include “/opt/software/lammps-22May14/lib/voro++-0.4.6/include/voro++/voro++.hh”
    ^

    compilation aborted for ../compute_voronoi_atom.cpp (code 4)
    make[1]: *** [compute_voronoi_atom.o] 错误 4
    make[1]: *** 正在等待未完成的任务….
    make[1]: Leaving directory `/opt/software/lammps-1Feb14/src/Obj_mkl’
    make: *** [mkl] 错误 2

  • 这个是voro++-0.4.6库没有指定位置的问题,看我的之前发的安装文档

    vim /opt/software/lammps-14Feb14/src/compute_voronoi_atom.h
    24行#include “/opt/software/lammps-14Feb14/lib/voro++-0.4.6/include/voro++/voro++.hh”
    vim /opt/software/lammps-14Feb14/src/VORONOI/compute_voronoi_atom.h 修改同样位置

    vim /opt/software/lammps-14Feb14/src/pair_adp_omp.cpp
    220
    221
    203行用//注释 行数是大致的,主要是注释掉有thr->timer的东西,在后续版本,比如6月份版本同样名字的文件就没有这行了,也就不需要注释了,这个是2月份之前的版本会出现的问题
    vim /opt/software/lammps-14Feb14/src/USER-OMP/pair_adp_omp.cpp 修改同样位置

  • 这个是voro++-0.4.6库没有指定位置的问题,修改下src/compute_voronoi_atom.h和src/VORONOI/compute_voronoi_atom.h共2个文件,另外,我刚打上那么多让注释thr->timer和这个是两码事,只有2月份之前的版本有thr->timer的问题

LEAVE A COMMENT

Captcha Code