硬件: SMP服务器, 4个CPU(XeonE7450), 内存64G,ATI显卡
软件:Red Hat Enterprise 4, gcc3.4.6
前言: 由于服务器比较老,而且我没有root权限,安装起来很不方便,各种软件和库都没有,都是下载后手工编译安装的,用了3天时间,除了GPU和CUDA因为是ATI显卡的原因无法安装外,成功安装了各个包
Installed YES: package ASPHERE
Installed YES: package BODY
Installed YES: package CLASS2
Installed YES: package COLLOID
Installed YES: package DIPOLE
Installed YES: package FLD
Installed NO: package GPU
Installed YES: package GRANULAR
Installed YES: package KIM
Installed YES: package KSPACE
Installed YES: package MANYBODY
Installed YES: package MC
Installed YES: package MEAM
Installed YES: package MISC
Installed YES: package MOLECULE
Installed YES: package OPT
Installed YES: package PERI
Installed YES: package POEMS
Installed YES: package REAX
Installed YES: package REPLICA
Installed YES: package RIGID
Installed YES: package SHOCK
Installed YES: package SRD
Installed YES: package VORONOI
Installed YES: package XTC
Installed YES: package USER-ATC
Installed YES: package USER-AWPMD
Installed YES: package USER-CG-CMM
Installed YES: package USER-COLVARS
Installed NO: package USER-CUDA
Installed YES: package USER-EFF
Installed YES: package USER-MISC
Installed YES: package USER-OMP
Installed YES: package USER-MOLFILE
Installed YES: package USER-PHONON
Installed YES: package USER-REAXC
Installed YES: package USER-SPH
参考网上教程和manul安装还比较顺利,但是有几个包特别麻烦...写出来分享下,希望能帮到需要的人
USER-ATC: 先将MPI的头文件,用-I包含,但由于gcc版本太低,所以总是报错,手动安装gcc4.8.1后libatc.a顺利编译, 但lammps编译时报错dsygvd,dgesvd两个函数找不到,google下发现是BLAS和LAPACK里的函数,由此怀疑是lammps自带的linalg库有问题,自己下载GotoBLAS或者LAPACk都可以,解决
USER-AWPMD: 这个也比较坑爹,主要是makefile只有Makefile.openmpi,但是我编译lammps用的mpich,文档又说库和lammps编译时用的mpi要一致,解决办法是手动修改Makefile.openmpi中CC编译器为mpich的mpicxx,这样有一些警告,但是能顺利编译库,和lammps
USER-REAXC: 要将连接库的名字与ifort库中的完全一致,-lifcore -lsvml -liompstubs5 -limf, 特别是-liompstubs5跟以前的版本不一样了
KIM: 这个很好解决,下载openkim-ati库,google下即可,下载编译后将头文件的目录-I连接上
VORONOI: 也需要自己下载voro++源码,手动编译出来即可
libjpeg: 下载libjpeg源码,手工编译即可
附上我lammps的makefile,仅供参考
# my = RedHat Linux box, g++ (v3), MPICH, FFTW3 SHELL = /bin/sh # --------------------------------------------------------------------- # compiler/linker settings # specify flags and libraries needed for your compiler CC = g++481 //自己link的gcc4.8.1 CCFLAGS = -g -O SHFLAGS = -fPIC DEPFLAGS = -M LINK = g++481 //同上 LINKFLAGS = -g -O LIB = SIZE = size ARCHIVE = ar ARFLAGS = -rc SHLIBFLAGS = -shared
# --------------------------------------------------------------------- # LAMMPS-specific settings # specify settings for LAMMPS features you will use # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings, OPTIONAL # see possible settings in doc/Section_start.html#2_2 (step 4) LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG //jpeg包 # MPI library, REQUIRED # see discussion in doc/Section_start.html#2_2 (step 5) # can point to dummy MPI library in src/STUBS as in Makefile.serial # INC = path for mpi.h, MPI compiler settings # PATH = path for MPI library # LIB = name of MPI library MPI_INC = -I/home/xhshi/mpich/include/ -DMPICH_SKIP_MPICXX //mpich头文件 MPI_PATH =-L/home/xhshi/mpich/lib //mpich库 MPI_LIB = -lmpich -lpthread -lmpl //库名称,要一致 # FFT library, OPTIONAL # see discussion in doc/Section_start.html#2_2 (step 6) # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library FFT_INC = -I/home/xhshi/fftw3/include -DFFT_FFTW3 //fftw3.3.2版本 FFT_PATH = -L/home/xhshi/fftw3/lib FFT_LIB = -lfftw3 # JPEG library, OPTIONAL # see discussion in doc/Section_start.html#2_2 (step 7) # only needed if -DLAMMPS_JPEG listed with LMP_INC # INC = path for jpeglib.h # PATH = path for JPEG library # LIB = name of JPEG library
JPG_INC = -I/home/xhshi/jpeg6b/include JPG_PATH = -L/home/xhshi/jpeg6b/lib JPG_LIB = -ljpeg
1.如果编译出现,XXX库找不到, 那么很有可能-L 没有连接对
2. 如果编译出现,XXX.h找不到, 那么很有可能-I 没有连接好
3. 如果出现结构体没有定义, 那么很有可能编译器版本太低
4. 如果出现函数找不到,那么很有可能静态库.a中没有该.o目标文件,应该ar或nm命令查看.a库
5.如果发现问题,首先思考分析下原因,接着在google