makefile.include file from scratch is not easy, so we suggest taking one of archetypical files that closely resembles your system as a starting point. It is necessary to customize it anyways to set appropriate paths etc. Optionally, you can enable additional features by setting precompiler flags or linking VASP to other libraries. For instance, we strongly recommend enabling HDF5 support.
The templates contain information such as precompiler options, compiler options, and how to link libraries. Choose the template based on the compiler, parallelization etc. from the list below and mind the description:
Intel Composer suite and oneAPI Base + HPC toolkits for CPUs
- makefile.include.intel: Parallelized using MPI, combined with MKL.
- makefile.include.intel_omp: Parallelized using MPI + OpenMP, combined with MKL.
- makefile.include.intel_ompi_mkl_omp: Parallelized using OpenMPI + OpenMP, combined with MKL.
- makefile.include.intel_serial: Not parallelized, strongly reduced feature-set, i.e., not suitable for production.
GNU compilers for CPUs
- makefile.include.gnu: Parallelized using MPI, Free and Open-Source Software (FOSS) stack.
- makefile.include.gnu_omp: Parallelized using MPI + OpenMP, FOSS stack.
- makefile.include.gnu_ompi_mkl_omp: Parallelized using OpenMPI + OpenMP, combined with MKL.
- makefile.include.gnu_ompi_aocl: Parallelized using OpenMPI, combined with AMD Optimizing CPU Libraries (AOCL).
- makefile.include.gnu_ompi_aocl_omp: Parallelized using OpenMPI + OpenMP, combined with AOCL.
NVIDIA HPC-SDK for CPU and GPU
- makefile.include.nvhpc: CPU version parallelized using MPI.
- makefile.include.nvhpc_omp: CPU version parallelized using MPI + OpenMP.
- makefile.include.nvhpc_ompi_mkl_omp: CPU version parallelized using OpenMPI + OpenMP, combined with MKL.
- makefile.include.nvhpc_acc: Ported to GPUs using OpenACC, parallelized using MPI .
- makefile.include.nvhpc_omp_acc: Ported to GPUs using OpenACC, parallelized using MPI + OpenMP.
- makefile.include.nvhpc_ompi_mkl_omp_acc: Ported to GPUs using OpenACC, parallelized using OpenMPI + OpenMP, combined with MKL.
Open the selected template of the archetypical files and add the required information as explained in the comments towards the end of the file. Then, add any optional feature as listed below. For more details see the list of precompiler options.
HDF5 support (strongly recommended)
The HDF5 library is is needed for reading and writing HDF5 files such as vaspin.h5, vaspout.h5 and vaspwave.h5.
The library is available for download on the HDF5 official website.
To activate HDF5 support add the following in the VASP
CPP_OPTIONS+= -DVASP_HDF5 HDF5_ROOT ?= /path/to/your/hdf5/installation LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran INCS += -I$(HDF5_ROOT)/include
Available for VASP >= 6.2.0.
fftlib (recommended when using OpenMP)
When you plan to run VASP on multiple OpenMP threads and you are not using the FFTs from the Intel-MKL library, you should link against fftlib (included in the VASP distribution). To do so, uncomment the corresponding sections in the makefile.include.*_omp files. In makefile.include.gnu_omp, for instance, that would be:
# For the fftlib library (recommended) CPP_OPTIONS+= -Dsysv FCL += fftlib.o CXX_FFTLIB = g++ -fopenmp -std=c++11 -DFFTLIB_THREADSAFE INCS_FFTLIB = -I./include -I$(FFTW_ROOT)/include LIBS += fftlib LLIBS += -ldl
To include the Wannier90 program, download the library from the source and compile
|Important: In case of Wannier90 3.x, you should compile a serial version by removing |
make lib to build the Wannier90 library. To activate this feature set the following:
CPP_OPTIONS += -DVASP2WANNIER90 WANNIER90_ROOT ?= /path/to/your/wannier90/installation LLIBS += -L$(WANNIER90_ROOT)/lib -lwannier
|Mind: VASP version <= 6.1.x are compatible with Wannier90 <= 1.2. To interface VASP 6.1.x with Wannier90 2.x, set -DVASP2WANNIER90v2 instead. As of VASP 6.2.x only Wannier90 2.x and 3.x are supported.|
To include the Libxc library of exchange-correlation functionals, install the library from the source and install it. Note that to get correct results with meta-GGA functionals (see discussion at LTBOUNDLIBXC), it is necessary to use Libxc from version 5.2.0 onwards (or the master version from gitlab for the latest implemented functionals) and to compile it with the option
--disable-fhc. For instance, with GNU Autotools the steps to compile Libxc are
autoreconf -i (necessary only if Libxc was downloaded from GitLab) ./configure --prefix=PATH/TO/LIBXC --disable-fhc make make install
Then, add the following in the VASP
CPP_OPTIONS += -DUSELIBXC LIBXC_ROOT ?= /path/to/your/libxc/installation LLIBS += -L$(LIBXC_ROOT)/lib -lxcf03 -lxc INCS += -I$(LIBXC_ROOT)/include
To include the BEEF van der Waals functionals, install the library from the source on GitHub and add the following in the VASP
CPP_OPTIONS += -Dlibbeef LIBBEEF_ROOT ?= /path/to/your/libbeef/installation LLIBS += -L$(LIBBEEF_ROOT)/lib -lbeef
To include the DFT-D4 van der Waals method, install the library from the source on GitHub and add the following in the VASP
CPP_OPTIONS += -DDFTD4 DFTD4_ROOT ?= /path/to/your/dft4/installation LLIBS += -L$(DFTD4_ROOT)/build -ldftd4 INCS += -I$(DFTD4_ROOT)/libdftd4.a.p
|Mind: The compilation of the DFTD4 source code requires a Fortran compiler supporting Fortran 2018 features.|
To include the ELPA eigenvalue solvers, install the library from the source on GitLab and add the following in the VASP
CPP_OPTIONS += -DELPA ELPA_ROOT ?= /path/to/your/elpa/installation LLIBS += -L$(ELPA_ROOT)/lib -lelpa INCS += -I$(ELPA_ROOT)/include/elpa-<version>/elpa INCS += -I$(ELPA_ROOT)/include/elpa-<version>/modules
|Mind: In the above you need to replace |