Fix for VASP installation error with spack

VASP is a popular software along with Spack that HPC administrators use. Lately due to changes at VASP, Spack is failing to compile this tool. This article tries to explain the issue and then provide a workaround to be able to install VASP with Spack.

VASP (Vienna Ab initio Simulation Package) is a commercial software suite used for performing quantum mechanical molecular dynamics (MD) simulations based on density functional theory (DFT). It is widely used in materials science, physics, and chemistry to model and predict the behavior of materials at the atomic level.

Prerequisites

Before starting, ensure that the following requirements are met:

  • You have Spack installed on your system.
  • You have downloaded the VASP source code in .tgz format.
  • You have the required dependencies, such as gcc, FFTW + OpenBLAS + ScaLAPACK, intel-oneapi-mpi and possibly CUDA if needed. Make sure you provide the requirements mentioned at https://www.vasp.at/wiki/index.php/Installing_VASP.6.X.X

Step-by-Step Tutorial

Untar the VASP Source File: First, unpack the VASP source code that you downloaded.

tar -xvf vasp.<version>.tgz
cd vasp.<version>

Choose a Template makefile.include File: Navigate to the src/ directory, where VASP provides template makefile.include files based on different platforms. Choose the appropriate template based on your system configuration (e.g., Linux, Cray, etc.).

cd src/
ls makefile.include*

Pick the appropriate one, for example:

cp arch/makefile.include.your_choice  ./makefile.include

Modify the makefile.include for Your Platform: Now you need to modify the makefile.include to suit your specific platform. This involves setting the correct scalapack ve mkl, and any other flags that are needed for your system.

vi ../makefile.include

If you are using Spack you can use the following commands to find these folders.

spack location -i netlib-scalapack
spack location -i /ja5tgmz
spack location -i intel-oneapi-mkl

Repackage the Modified VASP Directory: Once the makefile.include has been configured correctly, you need to repackage the entire VASP directory into a new .tgz file so that Spack can use it.

cd ..
tar -czvf vasp.modified.<version>.tgz vasp.<version>

Install VASP via Spack Now that you have prepared the VASP source code with the correct makefile.include, you can proceed with installing it through Spack.

spack install vasp@6.3.2  +fftlib +openmp +scalapack
vasp_std --version
vasp.6.3.2 27Jun22 (build Aug 16 2024 10:55:37) complex

Author: Serdar Acir