How to build VASP 4.6.38 using the Intel compiler



In my previous post, I explained how to build VASP using the GNU compilers. Here, I will show you how you can build VASP using the Intel Compilers. In principle, the Intel Compilers should give better performance for VASP on Intel processors.

Step 0: Install the Intel Compilers

Install the Intel Compiler Suite in /opt/intel (this is the default setting). Please refer to the installation instructions given by Intel.

Step 1: Load the Intel Compilers

source /opt/intel/composer_xe_2013_sp1/bin/ intel64

Step 2: Compile the Intel FFTW wrappers

cd /opt/intel/composer_xe_2013_sp1/mkl/interfaces/fftw3xf
make libintel64

Step 3: Compile the VASP libraries

tar -xvzf vasp.4.lib.tar.gz
cd vasp.4.lib
cp makefile.linux_ifc_P4 Makefile

and change the file so that FC is linking to ifort

.SUFFIXES: .inc .f .F
# Makefile for Portland Group F90/HPF compiler
# the makefile was tested only under Linux on Intel platforms
# however it might work on other platforms as well
# this release of vasp.4.lib contains lapack v2.0
# this can be compiled with pgf90 compiler if the option -O1 is used
# Mind: one user reported that he had to copy preclib.F diolib.F
#  dlexlib.F and drdatab.F to the directory vasp.4.4, compile the files
#  there and link them directly  into vasp
#  for no obvious reason these files could not be linked from the library

# C-preprocessor
CPP     = gcc -E -P -C $*.F >$*.f

FREE   =  -FR

DOBJ =  preclib.o timing_.o derrf_.o dclock_.o  diolib.o dlexlib.o drdatab.o

and type


Step 4: Compile VASP

source /opt/intel/impi/
tar -xvzf vasp.4.6.tar.gz
cd vasp.4.6
cp makefile.linux_ifc_P4 Makefile

Alter the Makefile on the following points

and finally run make


when you get this error

mpif77 -fc=ifort -FR -names lowercase -assume byterecl  -O3 -xAVX  -c fftmpiw.f90
fftmpiw.f90(55): error #5102: Cannot open include file 'fftw3.f'
      include 'fftw3.f'
fftmpiw.f90(89): error #5102: Cannot open include file 'fftw3.f'
      include 'fftw3.f'
fftmpiw.f90(110): error #5102: Cannot open include file 'fftw3.f'
      include 'fftw3.f'
fftmpiw.f90(220): error #5102: Cannot open include file 'fftw3.f'
      include 'fftw3.f'
compilation aborted for fftmpiw.f90 (code 1)
make: *** [fftmpiw.o] Error 1

copy the header file

cp /opt/intel/mkl/include/fftw/fftw3.f .

and run make again


Step 5: Testing our compilation and comparing against the GNU compilation

We have used three different models to check the computational efficiency of the Intel Compilations versus that of the GNU compilation:

  • A single CO molecule in a large box (gamma-point calculation)
  • A bulk Cu system
  • A Fe5C2 (Hagg carbide) system

The results are the following:

System gcc-4.8.4 VASP 4.6.38 Intel VASP 4.6.38
CO 240.483 240.683
Cu 54.623 34.994
Fe5C2 907.617 656.705

Interestingly, the Intel compiler does not give significantly different result for the gamma-point calculation (CO molecule). However, the speed improvement for the other calculations is roughly 30%!

If you have questions or comments, feel free to drop a line! Like what you read? Share this page with your friends and colleagues.


What is the answer to Seven + Seven?
Please answer with a whole number, i.e. 2, 3, 5, 8,...