Vienna Ab initio Simulation Package (VASP) is a computer program for atomic scale materials modelling, e.g. electronic structure calculations and quantum-mechanical molecular dynamics, from first principles.
A. Prerequisites
To Compile VASP-5.2.12, I used
- Intel Compiler 15.0.6
- Intel MPI 5.0.3
- Maths Kernel Library 11.2.4
B. Compiling VASP Libraries
Assuming you have unpacked the VASP files. Here is may make file
.SUFFIXES: .inc .f .F #----------------------------------------------------------------------- # Makefile for LINUX NAG f90 #----------------------------------------------------------------------- # fortran compiler FC=ifort # C-preprocessor #CPP = /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -P -C $*.F >$*.f CPP = gcc -E -P -C -DLONGCHAR $*.F >$*.f CFLAGS = -O FFLAGS = -Os -FI FREE = -FR DOBJ = preclib.o timing_.o derrf_.o dclock_.o diolib.o dlexlib.o drdatab.o #----------------------------------------------------------------------- # general rules #----------------------------------------------------------------------- libdmy.a: $(DOBJ) linpack_double.o -rm libdmy.a ar vq libdmy.a $(DOBJ) linpack_double.o: linpack_double.f $(FC) $(FFLAGS) $(NOFREE) -c linpack_double.f # files which do not require autodouble lapack_double.o: lapack_double.f $(FC) $(FFLAGS) $(NOFREE) -c lapack_double.f lapack_single.o: lapack_single.f $(FC) $(FFLAGS) $(NOFREE) -c lapack_single.f #lapack_cray.o: lapack_cray.f # $(FC) $(FFLAGS) $(NOFREE) -c lapack_cray.f .c.o: $(CC) $(CFLAGS) -c $*.c .F.o: $(CPP) $(FC) $(FFLAGS) $(FREE) $(INCS) -c $*.f .F.f: $(CPP) .f.o: $(FC) $(FFLAGS) $(FREE) $(INCS) -c $*.f
C. Compiling VASP
1. Copy the Makefile from makefile.linux_ifc_P4 in the vasp software.
# cp makefile.linux_ifc_P4 Makefile
2. Edit the Makefile
FC
#----------------------------------------------------------------------- # fortran compiler and linker #----------------------------------------------------------------------- FC=mpiifort # fortran linker FCL=$(FC)
CPP
CPP = $(CPP_) -DMPI -DHOST=\"LinuxIFC\" -DIFC \ -DCACHE_SIZE=32000 -DPGF90 -Davoidalloc -DNGZhalf \ -DMPI_BLOCK=64000 -Duse_collective -DscaLAPACK
FFLAGS
MKLROOT=/usr/local/RH6_apps/intel_2015/mkl MKL_PATH=$(MKLROOT)/lib/intel64 FFLAGS = -FR -names lowercase -assume byterecl -I$(MKLROOT)/include/fftw
OFLAG
#Haswell Architecture OFLAG=-O3 -xCORE-AVX2 #Sandy-Bridge Architecture OFLAG=-O3
The -xCORE-AVX2 is for Haswell Architecture
BLAS
BLAS= -mkl=cluster
-mkl=cluster is an Intel compiler flag that to include Intel MKL libraries, that will link with Intel MKL BLAS, LAPACK, FFT, ScaLAPACK functions that are used in VASP.
FFT3D
fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o INCS = -I$(MKLROOT)/include/fftw
LAPACK and SCALAPACK
LAPACK= SCA=
Since the -mkl=cluster, includes MKL ScaLAPACK libraries also, it is not required to mentioned the ScaLAPACK libs. That include LAPACK
References:
- Building VASP* with Intel® MKL and Intel® Compilers
- (Intel Developer Zone)