In this post I will introduce the steps and key points for compiling the latest VASP (version 6.3.2) with the latest VTST (190) successfully. There are some mistakes along the way, and I hope you won't repeat those mistakes like I did. Let's begin!
Step 1: Download the VASP and VTST
This step should be straightforward:
- VASP: If you have a license, you can download the vasp code at: https://www.vasp.at/
- VTST: It's free and can be downloaded at: https://theory.cm.utexas.edu/vtsttools/download.html. Right now it is in version 190, but it may change depend on when you download it.
Step 2: Import the modules
In this post, I will only focus on the compilation by using CPU, the GPU version will be posted on a separate article.
You can load these modules from your supercomputer like this:
module load intel module load intel-mpi module load intel-mkl
The way you check whether you get the correct modules is in the following:
which mpiifortcan help you check if you have the MPI version of Intel compilers
echo $MKLROOTwill tell you if you have the environmental variable for Intel MKL library
Step 3: Copy VTST code to VASP
Now I assume you have unzip both the vasp and vtst. Now go into the vtst folder, and use the following command:
cp -r *.F pyamff_fortran/ ../vasp.6.3.2/src/.
Now we can go to the vasp.6.3.2/src and modify something in order to compile successfully, details can be viewed on in this website:
srcfolder, and add the following between
makefile, and add
LIB, like in the following:
LIB=lib parser pyamff_fortran
main.Fand change two parts:
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)
IF (LCHAIN) CALL chain_init( T_INFO, IO)
CALL chain_init( T_INFO, IO)
Remind: Step 3.2 is really really important! Because otherwise you will have Segmentation fault (174).
Step 4: Modify the makefile.include
Now let's move to the
makefile.include file, which is the most important file when compiling.
I have used
arch/makefile.include.intel as the template. Here are some modifications that I have done, they may be different for your own supercomputer:
VASP_TARGET_CPU ?= -xCORE-AVX2
FCL += -mkl#-qmkl=sequential
Step 5: Compilation
Now everything is ready, all you need to do is:
make std (or all)
Bring a coffee and enjoy the smooth compilation.