Installation of VASP on server

3 mins read

Workflow for VASP.5.4.4 installation

  1. Prepare the source file
  2. Check server environments and set compile options
  3. Build code


Requirements for build VASP.5.4.4 (Official link)




1-1. Unzip *.tar file

Command line

jgahn@server:VASP$ ll 
total 512 
-rw-r----- 1 jgahn jgahn 3.7M Dec 14 17:35 vasp.5.4.4.tar.gz 
jgahn@server:VASP$ tar -xf vasp.5.4.4.tar.gz 
jgahn@server:VASP$ ll 
total 3.7M 
drwxr-x--- 6 jgahn jgahn 4.0K Apr 21  2017 vasp.5.4.4 
-rw-r----- 1 jgahn jgahn 3.7M Dec 14 17:35 vasp.5.4.4.tar.gz
jgahn@server:VASP$ cd vasp.5.4.4/ 
jgahn@server:vasp.5.4.4$ ll 
total 48K 
drwxr-x--- 2 jgahn jgahn 4.0K Apr 20  2017 arch 
drwxr-x--- 2 jgahn jgahn 4.0K Apr 20  2017 bin 
drwxr-x--- 2 jgahn jgahn 4.0K Dec 14 17:43 build 
-rw-r----- 1 jgahn jgahn  371 Apr 20  2017 makefile 
-rw-r----- 1 jgahn jgahn  12K Apr 21  2017 README 
drwxr-x--- 6 jgahn jgahn  20K Apr 21  2017 src 

1-2. Apply patches

Command line

jgahn@server:vasp.5.4.4$ patch -p0 < patch.5.4.4.16052018

2-1. Check server environments

Compatible compilers and third-party libraries can be found on Intel official website. (Intel oneAPI)

Command line

jgahn@server:~$ module avail
------------------- /lustre/opt/modulefiles/server/apps -------------------
adf/2022.103(default)  gaussian/16_C.02(default)  gromacs/2023.3(default)
amber/22(default)      gaussview/6.0.16           namd/2.14(default)
gamess/2023R2          gold/2023.2(default)       vmd/1.9.4

---------------- /lustre/opt/modulefiles/server/compilers -----------------
boost/1.83.0            hdf5/1.14.2               netcdf-fortran/4.6.1
cgal/5.6                intel/23.02.1             openmpi/4.1.1
fftw-double/3.3.10      intelmpi/impi_23.2.0      openmpi/4.1.6(default)
fftw-mpi-double/3.3.10  netcdf-c-mpi/4.9.2        phdf5/1.14.2
fftw-mpi-single/3.3.10  netcdf-c/4.9.2            pnetcdf/1.12.3
fftw-single/3.3.10      netcdf-cxx4/4.3.1         qd/2.3.23
gcc/13.2.0(default)     netcdf-fortran-mpi/4.6.1

---------------------- /usr/share/Modules/modulefiles ----------------------
dot  module-git  module-info  modules  null  use.own

-------------------------- /usr/share/modulefiles --------------------------
mpi/mpich-x86_64

2-2. Load module

Command line

jgahn@server:~$ module load intel
Loading intel/23.02.1
  Loading requirement: intelmpi/impi_23.2.0
jgahn@server:~$ module list
Currently Loaded Modulefiles: 
1) intelmpi/impi_23.2.0 2) intel/23.02.1 

2-3. Check compiler path

Command line

jgahn@server:~$ echo $MKLROOT
/lustre/opt/x86_64/intel/oneapi/2023.02/mkl/latest

2-4. Compile fast-Fourier-transforms module

Command line

jgahn@server:~$ cd /lustre/opt/x86_64/intel/oneapi/2023.02/mkl/2023.2.0/interfaces/fftw3xf/
jgahn@server:fftw3xf$ make libintel64
make -f makefile lib _IA=intel64
make[1]: Entering directory ‘/lustre/opt/x86_64/intel/oneapi/2023.02/mkl/2023.2.0/interfaces/fftw3xf/’

...
(omitted)
...

make[1]: Leaving directory ‘/lustre/opt/x86_64/intel/oneapi/2023.02/mkl/2023.2.0/interfaces/fftw3xf/’
jgahn@server:fftw3xf$ ll
total 40K 
-rw-r--r-- 1 root root 4.4K Jun 13  2023 fftw3xf.lst
-rw-r--r-- 1 root root 4.8K Jun 13  2023 makefile 
drwxr-xr-x 2 root root  24K Oct 18 14:34 wrappers 

2-5. Prepare makefile.include

Command line

jgahn@server:~$ vim makefile.include

vim

# Precompiler options 
CPP_OPTIONS= -DHOST=\"LinuxIFC\"\ 
             -DMPI -DMPI_BLOCK=8000 \ 
             -Duse_collective \ 
             -DscaLAPACK \ 
             -DCACHE_SIZE=4000 \ 
             -Davoidalloc \ 
             -Duse_bse_te \ 
             -Dtbdyn \ 
             -Duse_shmem 
CPP        = fpp -f_com=no -free -w0 $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS) 
FC         = mpiifort 
FCL        = mpiifort -qmkl=sequential -lstdc++ 
FREE       = -free -names lowercase 
FFLAGS     = -assume byterecl -w 
OFLAG      = -O2 
OFLAG_IN   = $(OFLAG) 
DEBUG      = -O0 
MKL_PATH   = $(MKLROOT)/lib/intel64 
BLACS      = -lmkl_blacs_intelmpi_lp64 
SCALAPACK  = $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS) 
OBJECTS    = fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d.o 
INCS       =-I$(MKLROOT)/include/fftw 
LLIBS      = $(SCALAPACK) $(LAPACK) $(BLAS) 
OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o 
OBJECTS_O2 += fft3dlib.o 

# For what used to be vasp.5.lib 
CPP_LIB    = $(CPP) 
FC_LIB     = $(FC) 
CC_LIB     = icc 
CFLAGS_LIB = -O 
FFLAGS_LIB = -O1 
FREE_LIB   = $(FREE) 
OBJECTS_LIB= linpack_double.o getshmem.o 
# For the parser library 
CXX_PARS   = icpc 
LIBS       += parser 
LLIBS      += -Lparser -lparser -lstdc++ 
# Normally no need to change this 
SRCDIR     = ../../src 
BINDIR     = ../../bin 
#================================================ 
# GPU Stuff 
CPP_GPU    = -DCUDA_GPU -DRPROMU_CPROJ_OVERLAP -DUSE_PINNED_MEMORY -DCUFFT_MIN=28 -UscaLAPACK 
OBJECTS_GPU= fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d_gpu.o fftmpiw_gpu.o 
CC         = icc 
CXX        = icpc 
CFLAGS     = -fPIC -DADD_ -Wall -openmp -DMAGMA_WITH_MKL -DMAGMA_SETAFFINITY -DGPUSHMEM=300 -DHAVE_CUBLAS 
CUDA_ROOT  ?= /usr/local/cuda/ 
NVCC       := $(CUDA_ROOT)/bin/nvcc -ccbin=icc 
CUDA_LIB   := -L$(CUDA_ROOT)/lib64 -lnvToolsExt -lcudart -lcuda -lcufft -lcublas 
GENCODE_ARCH    := -gencode=arch=compute_30,code=\"sm_30,compute_30\" \ 
                   -gencode=arch=compute_35,code=\"sm_35,compute_35\" \ 
                   -gencode=arch=compute_60,code=\"sm_60,compute_60\" 
MPI_INC    = $(I_MPI_ROOT)/include64/ 

3. Build code

Command line

jgahn@server:vasp.5.4.4$ make all
mkdir build/std ; \ 
cp src/makefile src/.objects makefile.include build/std ; \ 
make -C build/std VERSION=std all 
make[1]: Entering directory '/lustre/home/jgahn/packages/VASP/VASP/vasp.5.4.4/build/std' 
rsync -ru ../../src/lib . 

...
(omitted)
... 

lphon.o fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d.o main.o  -Llib -ldmy /lustre/opt/x86_64/intel/oneapi/2023.02/mkl/latest/lib/intel64/libmkl_scalapack_lp64.a -lmkl_blacs_intelmpi_lp64 -Lparser -lparser -lstdc++ 
make[2]: Leaving directory '/lustre/home/jgahn/packages/VASP/VASP/vasp.5.4.4/build/ncl'
make[1]: Leaving directory '/lustre/home/jgahn/packages/VASP/VASP/vasp.5.4.4/build/ncl'

Command line

jgahn@server:vasp.5.4.4$ cd bin
jgahn@server:bin$ ll
total 71M 
-rwxr-x--- 1 jgahn jgahn 24M Dec 14 19:59 vasp_gam 
-rwxr-x--- 1 jgahn jgahn 24M Dec 14 20:06 vasp_ncl 
-rwxr-x--- 1 jgahn jgahn 24M Dec 14 19:53 vasp_std