安装环境:(1)ubuntu10.04(32位),奔 D;intel-mkl10.2.5.35,GFortran,G++4.4;
(2)ubuntu10.04(64位),intel Core2*4;intel-mkl10.2.5.35,GFortran,G
++4.4;
(其中,VASP的安装包是 4.6版本的,GFortran、Gcc以及并行版本中使用的 OpenMpi,
均为通过新立德软件包管理器自动安装;数学库为英特尔非商业版本:
http://software.intel.com/en-us/ ... -software-download/)
(虽然说计算类软件依赖于数学库,而数学库依赖于处理器,但是我的安装经验表明,对于 Intel处理器来说数学库的设置 32位、64位串/并行版几乎完全一样,几乎没有太大的区别;对于并行版本来说重要的是在于对 CPP、FFT和 MPI部分的设置)
(本安装过程主要参考英特尔官方论坛:
http://software.intel.com/en-us/ ... -intel-mkl-in-vasp/和
http://qingyan1971.spaces.live.c ... 75FC440F6!432.entry,编译的基本知识来自于 Ubuntu中文论坛 Wiki:
http://wiki.ubuntu.org.cn/InstallingCompilers)
gleerat@gleerat-desktop:~$ tar -xvf /home/gleerat/下载/vasp.4.6.tar.gz -C /tmp
gleerat@gleerat-desktop:~$ tar -vxf /home/gleerat/下载/l_mkl_p_10.2.5.035.tar.gz -C /tmp/
gleerat@gleerat-desktop:~$ tar -xvf /home/gleerat/下载/vasp.4.lib.tar.gz -C /tmp
gleerat@gleerat-desktop:~$ cd /tmp/l_mkl_p_10.2.5.035/
gleerat@gleerat-desktop:/tmp/l_mkl_p_10.2.5.035$ ./install.sh
##对于Ubuntu系统,它隐藏了root账户,在安装MKL过程中可以用sudo passwd root创建root账户,
##在使用之后用sudo passwd root -l取消。
gleerat@gleerat-desktop:~$ cd /opt/intel/mkl/10.2.5.035/interfaces/fftw3xf
gleerat@gleerat-desktop:/opt/intel/mkl/10.2.5.035/interfaces/fftw3xf$ gedit makefile
##修改makefile文件,将i㏄都改成gcc
gleerat@gleerat-desktop:/opt/intel/mkl/10.2.5.035/interfaces/fftw3xf$ make libem64t compiler
=gcc
gleerat@gleerat-desktop:/opt/intel/mkl/10.2.5.035/interfaces/fftw3xf$ sudo cp libfftw3xf_gcc.a /
opt/intel/mkl/10.2.5.035/lib/em64t/
gleerat@gleerat-desktop:/opt/intel/mkl/10.2.5.035/interfaces/fftw3xf$ cd /tmp/vasp.4.lib
gleerat@gleerat-desktop:/tmp/vasp.4.lib$ export LC_ALL=C
gleerat@gleerat-desktop:/tmp/vasp.4.lib$ make -f makefile.linux_gfortran
rm: cannot remove `libdmy.a': No such file or directory
make: [libdmy.a] Error 1 (ignored)
ar vq libdmy.a preclib.o timing_.o derrf_.o dclock_.o diolib.o dlexlib.o drdatab.o
ar: creating libdmy.a
a - preclib.o
a - timing_.o
a - derrf_.o
a - dclock_.o
a - diolib.o
a - dlexlib.o
a - drdatab.o
gleerat@gleerat-desktop:/tmp/vasp.4.lib$ make -f makefile.linux_gfortran
make: `libdmy.a' is up to date.
gleerat@gleerat-desktop:/tmp/vasp.4.lib$ cd /tmp/vasp.4.6
gleerat@gleerat-desktop:/tmp/vasp.4.6$ gedit makefile.linux_gfortran
##修改makefile.linux_gfortran中的数学库设置(32位):
# Atlas based libraries
#ATLASHOME= /usr/lib/blas/threaded-atlas
#BLAS= -L/usr/lib/blas/atlas -lblas
#BLAS= -L$(ATLASHOME) -lf77blas -latlas
# use specific libraries (default library path points to other libraries)
#BLAS= $(ATLASHOME)/libf77blas.a $(ATLASHOME)/libatlas.a
# use the mkl Intel libraries for p4 (www.intel.com)
BLAS= -L/opt/intel/mkl/10.2.3.035/lib/32 -lmkl_intel -lpthread -lmkl_sequential -lmkl_core
# LAPACK, simplest use vasp.4.lib/lapack_double
#LAPACK= ../vasp.4.lib/lapack_double.o
# use atlas optimized part of lapack
#LAPACK= ../vasp.4.lib/lapack_atlas.o -llapack -lblas# use the mkl Intel lapack
LAPACK= -L/opt/intel/mkl/10.2.5.035/lib/32 -lmkl_intel -lmkl_lapack -lmkl_sequential -lmkl_core
-lpthread
#LAPACK= -L/usr/lib/lapack/atlas -llapack
#-----------------------------------------------------------------------
##修改makefile.linux_gfortran中的数学库设置(64位)串行&并行:
# Atlas based libraries
#ATLASHOME= /usr/lib/blas/threaded-atlas
#BLAS= -L/usr/lib/blas/atlas -lblas
#BLAS= -L$(ATLASHOME) -lf77blas -latlas
# use specific libraries (default library path points to other libraries)
#BLAS= $(ATLASHOME)/libf77blas.a $(ATLASHOME)/libatlas.a
# use the mkl Intel libraries for p4 (www.intel.com)
BLAS= -L/opt/intel/mkl/10.2.3.035/lib/em64t -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthre
ad
# LAPACK, simplest use vasp.4.lib/lapack_double
#LAPACK= ../vasp.4.lib/lapack_double.o
# use atlas optimized part of lapack
#LAPACK= ../vasp.4.lib/lapack_atlas.o -llapack -lblas
# use the mkl Intel lapack
LAPACK= -L/opt/intel/mkl/10.2.5.035/lib/em64t -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpt
hread
#LAPACK= -L/usr/lib/lapack/atlas -llapack
# #并行版本需要的额外设置:
##将CPP注释掉:
#CPP = $(CPP_) -DHOST=\"LinuxGfortran\" \
-Dkind8 -DNGXhalf -DCACHE_SIZE=2000 -DGfortran -Davoidalloc \
# -DRPROMU_DGEMV
##修改general fortran flags:
FFLAGS = -I/opt/intel/mkl/10.2.5.035/include/fftw -FR -lowercase -ffree-form -ffree-line-length-n
one
##将fft libraries注释掉:
#FFT3D = fft3dfurth.o fft3dlib.o
#FFT3D = fftw3d+furth.o fft3dlib.o
##MPI部分的修改:
FC=mpif90
FCL=$(FC)
CPP = $(CPP_) -DMPI -DHOST=\"LinuxGfortran\" \
-Dkind8 -DNGZhalf -DCACHE_SIZE=2000 -DPGF90 -Davoidalloc -DRPROMU_DGEMV -DscaLA
PACK
#对CPP添加-DscaLAPACK不是必须的
#BLACS=/usr/local/BLACS_lam
#SCA_= /usr/local/SCALAPACK_lam
#SCA= $(SCA_)/scalapack_LINUX.a $(SCA_)/pblas_LINUX.a $(SCA_)/tools_LINUX.a \
# $(BLACS)/LIB/blacsF77init_MPI-LINUX-0.a $(BLACS)/LIB/blacs_MPI-LINUX-0.a $(BLACS)/LIB/bla
csF77init_MPI-LINUX-0.aSCA= /opt/intel/mkl/10.2.5.035/lib/em64t/libmkl_scalapack_lp64.a /opt/intel/mkl/10.2.5.035/lib/
em64t/libmkl_blacs_openmpi_lp64.a
LIB = -L../vasp.4.lib -ldmy \
../vasp.4.lib/linpack_double.o $(LAPACK) \
$(SCA) $(BLAS)
# FFT: only option fftmpi.o with fft3dlib of Juergen Furthmueller
FFT3D = fftmpi.o fftmpi_map.o fft3dlib.o /opt/intel/mkl/10.2.5.035/lib/em64t/libfftw3xf_gcc.a
#libfftw3xf_gcc.a需要事先生成,然后拷贝到该目录中
#-----------------------------------------------------------------------
gleerat@gleerat-desktop:/tmp/vasp.4.6$ sudo vim /etc/ld.so.conf.d/mkl.conf
##将数学库的路径写入conf文件:
/opt/intel/mkl/10.2.5.035/lib/32
#写入MPI的环境变量:
/usr/lib/openmpi/lib
/usr/bin
#-----------------------------------------------------------------------
gleerat@gleerat-desktop:/tmp/vasp.4.6$ sudo ldconfig
gleerat@gleerat-desktop:/tmp/vasp.4.6$ make -f makefile.linux_gfortran
gleerat@gleerat-desktop:/tmp/vasp.4.6$ sudo cp ./vasp /usr/bin
##如果是并行版本的,最好将可执行文件重命名为vaspmpi以便与串行版本相区别
gleerat@gleerat-desktop:/tmp/vasp.4.6$ cd /home/gleerat/vasp/accurate
gleerat@gleerat-desktop:~/vasp/accurate$ vasp