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:

# 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


The way you check whether you get the correct modules is in the following:

• which mpiifort can help you check if you have the MPI version of Intel compilers
• echo \$MKLROOT will 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:

1. open .object file in src folder, and add the following between hamil_rot.o and chain.o
1. open makefile, and add pyamff_fortran behind variable LIB, like in the following:
LIB=lib parser pyamff_fortran

1. Open main.F and change two parts:

3.1 Replace

CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
LATT_CUR%A,LATT_CUR%B,IO%IU6)


with

CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
TSIF,LATT_CUR%A,LATT_CUR%B,IO%IU6)


3.2 Replace

IF (LCHAIN) CALL chain_init( T_INFO, IO)


with

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.

Merry Christmas!

Best,

Zhengda