参考的各种文档似乎非常详细,但是安装过程中各种坑自然不必多说,不再赘述。
安装gnu完全开源的版本的vasp,仅供测试,若有疑问欢迎交流。
一、安装环境:
OS版本:CentOS 7.9
软件包存放目录:/home/share/
软件安装位置:/home/software/
二、安装文件共享,再windows上直接复制文件到安装目录
yum -y install samba
mkdir /home/share
chmod 777 /home/share/
echo "[global]
log file = /var/log/samba/log.%m
max log size = 50
security = user
map to guest = Bad User
[share]
path=/home/share
readonly=yes
browseable=yes
writable = yes
guest ok=yes" > /etc/samba/smb.conf
systemctl start smb
systemctl enable smb
firewall-cmd --add-port=137/udp --permanent
firewall-cmd --add-port=138/udp --permanent
firewall-cmd --add-port=139/tcp --permanent
firewall-cmd --add-port=445/tcp --permanent
firewall-cmd --add-port=389/tcp --permanent
firewall-cmd --reload
二、安装环境变量切换模块
yum -y install environment-modules
mkdir -p /home/software/modules
echo 'export MODULEPATH=/home/software/modules/' >> /etc/profile.d/modules.sh
source /etc/profile
三、安装make4.3
yum -y install gcc gcc-c++ make autoconf m4 automake libtool
cd /home/share/
tar -zxf make-4.3.tar.gz
rm -f make-4.3.tar.gz
cd make-4.3
./configure --prefix=/home/software/make
make && make install
echo '#%Module1.0
set MAKE /home/software/make
prepend-path PATH ${MAKE}/bin
prepend-path LD_LIBRARY_PATH ${MAKE}/lib
prepend-path INCLUDE ${MAKE}/include' > /home/software/modules/make
cd /home/share/
rm -rf make-4.3
四、安装gcc9.3.0
因为gcc编译时间太长,此处使用编译好的gcc直接安装。
cd /home/share
tar -xf gcc-9.3.0.tar
rm -f gcc-9.3.0.tar
cd gcc-9.3.0
yum -y groupinstall "development tools"
yum -y install dejagnu texinfo
cd build
make install
完整编译gcc过程:
cd /home/share
tar -zxf gcc-9.3.0.tar.gz
rm -f gcc-9.3.0.tar.gz
cd gcc-9.3.0
./contrib/download_prerequisites
mkdir build
cd build
yum -y groupinstall "development tools"
yum -y install dejagnu texinfo
../configure --prefix=/home/software/gcc-9.3.0 --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j2 && make install
cd /lib64/
rm -f libstdc++.so.6
ln -s /home/software/gcc-9.3.0/lib64/libstdc++.so.6.0.28 libstdc++.so.6
echo '#%Module1.0
set GCC /home/software/gcc-9.3.0
prepend-path PATH ${GCC}/bin
prepend-path LD_LIBRARY_PATH ${GCC}/lib64
prepend-path INCLUDE ${GCC}/include' > /home/software/modules/gcc9
cd /home/share/
rm -rf gcc-9.3.0
五、编译opemmpi-3.1.6
cd /home/share/
tar -jxf openmpi-3.1.6.tar.bz2
rm -f openmpi-3.1.6.tar.bz2
cd openmpi-3.1.6
yum -y install libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libstdc++-static.i686 libstdc++-static.x86_64 glibc.i686 glibc.x86_64 glibc-devel.i686 glibc-devel.x86_64 glibc-static.i686 glibc-static.x86_64 libgcc.i686 libgcc.x86_64 gcc-c++ libXScrnSaver.i686 libXScrnSaver.x86_64 gtk3 gtk2 pango kernel-devel-*
./configure --prefix=/home/software/openmpi
module purge
module load make
make && make install
echo '#%Module1.0
set OPENMPI /home/software/openmpi
prepend-path PATH ${OPENMPI}/bin
prepend-path LD_LIBRARY_PATH ${OPENMPI}/lib
prepend-path INCLUDE ${OPENMPI}/include' > /home/software/modules/openmpi
cd /home/share/
rm -rf openmpi-3.1.6
六、编译lapack-3.9.0
cd /home/share/
tar -zxf v3.9.0.tar.gz
rm -f v3.9.0.tar.gz
cd lapack-3.9.0/
cp INSTALL/make.inc.gfortran ./make.inc
sed -i '/^FFLAGS =/s/$/ -fPIC -m64/' make.inc
sed -i '/^FFLAGS_NOOPT =/s/$/ -fPIC -m64/' make.inc
sed -i '/^BLASLIB/s/librefblas/libblas/' make.inc
module purge
module load make
module load openmpi
module load gcc9
yum -y install gcc-gfortran
make lapack_install lib blaslib
cp lib* /usr/lib64/
cd /home/share/
rm -rf lapack-3.9.0
七、编译scalapack-2.1.0
cd /home/share/
tar -zxf scalapack-2.1.0.tgz
rm -f scalapack-2.1.0.tgz
cd scalapack-2.1.0
cp SLmake.inc.example SLmake.inc
sed -i '/^FC *=/s/=.*/= mpifort/' SLmake.inc
sed -i '/^CC *=/s/=.*/= mpifort/' SLmake.inc
sed -i '/^NOOPT *=/s/=.*/= -O0 -fPIC/' SLmake.inc
sed -i '/^FCFLAGS *=/s/=.*/= -O3 -fPIC/' SLmake.inc
sed -i '/^CCFLAGS *=/s/=.*/= -O3 -fPIC/' SLmake.inc
sed -i '/^BLASLIB *=/s/=.*/= -L\/dirname\/lib -lblas/' SLmake.inc
sed -i '/^LAPACKLIB *=/s/=.*/= -L\/dirname\/lib -llapack/' SLmake.inc
module purge
module load make
module load openmpi
module load gcc9
sed -i '0,/int n/! s/int n/int long n/' REDIST/SRC/pgemraux.c
sed -i 's|MPI_Comm_create(tcomm, tgrp|MPI_Comm_create_group(tcomm, tgrp, 0|g' BLACS/SRC/blacs_map_.c
sed -i 's|MPI_Comm_create(ucomm, bgrp|MPI_Comm_create_group(ucomm, bgrp, 0|g' BLACS/SRC/BI_TransUserComm.c
make -j2
cp libscalapack.a /usr/lib64/
cd /home/share/
rm -rf scalapack-2.1.0
八、编译fftw3
cd /home/share/
tar -zxf fftw-3.3.9.tar.gz
rm -f fftw-3.3.9.tar.gz
cd fftw-3.3.9
module purge
module load make
module load openmpi
module load gcc9
./configure --prefix=/home/software/fftw3 --enable-shared --enable-static --enable-sse2 --enable-avx --enable-avx2 --enable-fma --enable-threads --enable-openmp --enable-mpi
make -j2 && make install
echo '#%Module1.0
set FFTW3 /home/software/fftw3
prepend-path PATH ${FFTW3}/bin
prepend-path LD_LIBRARY_PATH ${FFTW3}/lib
prepend-path INCLUDE ${FFTW3}/include' > /home/software/modules/fftw3
cd /home/share/
rm -rf fftw-3.3.9
九、编译vasp5.4.4+vtstcode1.8
cd /home/share/
tar -zxf vasp.5.4.4.tar.gz
tar -zxf vtstcode-180.tgz
rm -f vasp.5.4.4.tar.gz vtstcode-180.tgz
cp vtstcode-180/* vasp.5.4.4/src/
mv patch.5.4.4.16052018 vasp.5.4.4/
cd vasp.5.4.4/
yum -y install patch
patch -p0 < patch.5.4.4.16052018
vi src/main.F
将(约3147行):
CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
LATT_CUR%A,LATT_CUR%B,IO%IU6)
改成:
CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
TSIF,LATT_CUR%A,LATT_CUR%B,IO%IU6)
! LATT_CUR%A,LATT_CUR%B,IO%IU6)
vi src/.objects
在chain.o前(约70行),添加如下内容(注意,不要在结尾有空格):
bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o \
fire.o lanczos.o neb.o qm.o opt.o \
module purge
module load make
module load openmpi
module load fftw3
cp arch/makefile.include.linux_gnu ./makefile.include
vi makefile.include
在makefile.include文件的CPP_OPTIONS项后添加一行
CPP_OPTIONS += -DLAPACK36
LIBDIR项后填写blas、tmglib、lapack和scalapack库文件位置,这里用的是(末尾带斜杠):
/usr/lib64/
FFTW项后填写fftw安装路径,这里用的是(末尾不带斜杠):
/home/software/fftw3
make all
或者分别编译:
make std、make ncl、make gam
生成vasp_gam vasp_ncl vasp_std 三个文件即完成,复制到你需要的地方即可。
阅读(2935) | 评论(0) | 转发(0) |