Personal computer installation: Difference between revisions

From VASP Wiki
No edit summary
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Here you will find instructions on how to install {{VASP}} on some widely-used Linux distributions. For the sake of simplicity the suggested build processes rely as much as possible on compilers and libraries provided by the operating system's package manager. The focus is on minimizing the effort to obtain working {{VASP}} binaries with only little changes required to the provided <code>[[makefile.include]]</code> templates in the <code>arch</code> directory.
Here you will find instructions on how to install {{VASP}} on some widely-used Linux distributions. For the sake of simplicity the suggested build processes rely as much as possible on compilers and libraries provided by the operating system's package manager. The focus is on minimizing the effort to obtain working {{VASP}} binaries with only little changes required to the provided <code>[[makefile.include]]</code> templates in the <code>arch</code> directory.
{{NB|warning|These short and convenient installation instructions may come at the cost of performance. They are not optimized with respect to compilers, libraries and hardware. Please consider benchmarking and optimizing your build process prior to large-scale production runs.}}
{{NB|warning|These short and convenient installation instructions may come at the cost of performance. They are not optimized with respect to compilers, libraries and hardware. Please consider benchmarking and optimizing your build process prior to large-scale production runs.}}
In order to verify each build we run the FAST category tests of the [[Validation tests|testsuite]]. {{NB|tip|All build instructions presented here include [[makefile.include#HDF5 support (strongly recommended)|HDF5 support]] to allow post-processing of results with [https://www.vasp.at/py4vasp/latest/ py4vasp].}} The build instructions have been tested on clean installations of the operating systems in the following table:
In order to verify each build we run the FAST category tests of the [[Validation tests|testsuite]]. {{NB|tip|All build instructions presented here include [[makefile.include#HDF5 support (strongly recommended)|HDF5 support]] to allow post-processing of results with {{py4vasp}}.}} The build instructions have been tested on clean installations (virtual machines or docker images) of the operating systems in the following table. Search for your desired combination of OS and {{VASP}} and click on the provided link to get directly to the corresponding section on this page:
{| class="wikitable"  
{| class="wikitable"  
|- style="font-weight:bold; text-align:center;"
|- style="font-weight:bold; text-align:center;"
! colspan="2" | Operating system
! colspan="2" | Operating system
! VASP
! colspan="3" | VASP
|-
|-
| Name
| Name
| Version
| Version
| 6.3.0
| 6.3.0 - 6.3.1
| 6.3.2
| 6.4.X
|-
|-
| [[#Debian|Debian]]
| [[#Debian|Debian]]
| 11.3
| 11
| style="background-color:#f5d9da;" | [[#Building VASP 6.3.0 on Debian 11.3|Link]]
| colspan="3" style="background-color:#f5d9da; text-align:center;" | [[#Building VASP 6.3.X to 6.4.X on Debian 11|Link]]
|-
|
| 12
|
|
| style="background-color:#ACE9E5; text-align:center;" | [[#Building VASP 6.4.X on Debian 12|Link]]
|-
|-
| [[#Ubuntu|Ubuntu]]
| [[#Ubuntu|Ubuntu]]
| 20.04
| 20.04
| style="background-color:#ACE9E5;" | [[#Building VASP 6.3.0 on Ubuntu 20.04|Link]]
| style="background-color:#ACE9E5; text-align:center;" | [[#Building VASP 6.3.0 - 6.3.1 on Ubuntu 20.04|Link]]
|
|-
|-
|  
|
| 22.04
| 22.04
| style="background-color:#ACE9E5;" | [[#Building VASP 6.3.0 on Ubuntu 22.04|Link]]
| colspan="3" style="background-color:#ACE9E5; text-align:center;" | [[#Building VASP 6.3.X to 6.4.X on Ubuntu 22.04|Link]]
|-
|-
| [[#Fedora|Fedora]]
| [[#Fedora|Fedora]]
| 35
| 35
| style="background-color:#ACE9E5;" | [[#Building VASP 6.3.0 on Fedora 35|Link]]
| style="background-color:#f5d9da; text-align:center;" | [[#Building VASP 6.3.0 - 6.3.1 on Fedora 35|Link]]
|
|
|-
|
| 37 - 38
|
|
| style="background-color:#ACE9E5; text-align:center;" | [[#Building VASP 6.4.X on Fedora 37 to 38|Link]]
|-
|-
| [[#Rocky Linux|Rocky Linux]]
| [[#Rocky Linux|Rocky Linux]]
| 8.5
| 8.5
| style="background-color:#ACE9E5;" | [[#Building VASP 6.3.0 on Rocky Linux 8.5|Link]]
| style="background-color:#f5d9da; text-align:center;" | [[#Building VASP 6.3.0 - 6.3.1 on Rocky Linux 8.5|Link]]
|
|
|-
|
| 9.0
|
| style="background-color:#f5d9da; text-align:center;" | [[#Building VASP 6.3.2 on Rocky Linux 9.0|Link]]
|-
|
| 9.2
|
|
| style="background-color:#f5d9da; text-align:center;" | [[#Building VASP 6.4.X on Rocky Linux 9.2|Link]]
|}
|}
The table and corresponding instructions will be updated when either a new version of VASP or a major release of the operating systems is available.  
A <span style="background:#f5d9da"> red</span> box background indicates that there are known issues with the used compiler/library versions (see the individual instructions for details). The table and corresponding instructions will be updated when either a new version of {{VASP}} or a major release of the operating systems is available. However, not all combinations will be tested and hence some fields will stay blank. In these cases it may still be helpful to start from instructions for close-by tested combinations.
 


==Debian==
==Debian==


===Building VASP 6.3.0 on Debian 11.3===
===Building VASP 6.3.X to 6.4.X on Debian 11===
 
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
{| class="wikitable" style="text-align: center;
|-
|-
Line 57: Line 89:
|}
|}


Please install required software packages with the package manager:
These packages can be installed directly from the command line like this:


  sudo apt install make build-essential rsync g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev
  sudo apt install rsync make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev


Change into the {{VASP}} directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:


  cp arch/makefile.include.gnu_omp makefile.include
  cp arch/makefile.include.gnu_omp makefile.include
Line 93: Line 125:
  make DEPS=1 -j
  make DEPS=1 -j


Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Hybrid MPI/OpenMP parallelization|OpenMP threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
 
export OMP_NUM_THREADS=1
 
in your <code>~/.bashrc</code> file.
 
===Building VASP 6.4.X on Debian 12===
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
|-
! Compiler
! MPI
! FFT
! BLAS
! LAPACK
! ScaLAPACK
! HDF5
! Known issues
|-
| gcc-12.2.0
| openmpi-4.1.4
| fftw-3.3.10
| colspan="2" | openblas-0.3.21
| netlib-scalapack-2.2.1
| hdf5-1.10.8
|
|}
 
These packages can be installed directly from the command line like this:
 
sudo apt install rsync make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev
 
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
 
cp arch/makefile.include.gnu_omp makefile.include
 
Search for the paragraph in <code>makefile.include</code> starting with <code>## Customize as of this point!</code> and apply the following changes below:
<ul>
<li>Comment out the <code>OPENBLAS_ROOT</code> variable (not needed) and set <code>BLASPACK</code>:</li>
<pre># BLAS and LAPACK (mandatory)
#OPENBLAS_ROOT ?= /path/to/your/openblas/installation
BLASPACK    = -lopenblas</pre>
<li>Comment out the <code>SCALAPACK_ROOT</code> variable (not needed) and set <code>SCALAPACK</code>:</li>
<pre># scaLAPACK (mandatory)
#SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
SCALAPACK  = -lscalapack-openmpi</pre>
<li>Comment out the <code>FFTW_ROOT</code> variable (not needed). Set <code>LLIBS</code> and <code>INCS</code> in the FFTW section:</li>
<pre># FFTW (mandatory)
#FFTW_ROOT  ?= /path/to/your/fftw/installation
LLIBS      += -lfftw3 -lfftw3_omp
INCS      += -I/usr/include</pre>
<li>Enable HDF5 support by adding <code>-DVASP_HDF5</code> to the <code>CPP_OPTIONS</code> variable. Leave <code>HDF5_ROOT</code> variable commented out (not needed). Set <code>LLIBS</code> and <code>INCS</code> in the HDF5 section:</li>
<pre># HDF5-support (optional but strongly recommended)
CPP_OPTIONS+= -DVASP_HDF5
#HDF5_ROOT  ?= /path/to/your/hdf5/installation
LLIBS      += -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi/ -lhdf5_fortran
INCS      += -I/usr/include/hdf5/openmpi/</pre>
</ul>
 
Save your <code>makefile.include</code> and compile {{VASP}}:
 
make DEPS=1 -j
 
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add


  export OMP_NUM_THREADS=1
  export OMP_NUM_THREADS=1
Line 101: Line 198:
==Ubuntu==
==Ubuntu==


===Building VASP 6.3.0 on Ubuntu 20.04===
===Building VASP 6.3.0 - 6.3.1 on Ubuntu 20.04===
 
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
{| class="wikitable" style="text-align: center;
|-
|-
Line 123: Line 221:
|}
|}


Please install the required software packages with the package manager:
These packages can be installed directly from the command line like this:


  sudo apt install make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev
  sudo apt install make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev


Change into the {{VASP}} directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:


  cp arch/makefile.include.gnu_omp makefile.include
  cp arch/makefile.include.gnu_omp makefile.include
Line 162: Line 260:
  make DEPS=1 -j
  make DEPS=1 -j


Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Hybrid MPI/OpenMP parallelization|OpenMP threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add


  export OMP_NUM_THREADS=1
  export OMP_NUM_THREADS=1
Line 168: Line 266:
in your <code>~/.bashrc</code> file.
in your <code>~/.bashrc</code> file.


===Building VASP 6.3.0 on Ubuntu 22.04===
===Building VASP 6.3.X to 6.4.X on Ubuntu 22.04===
 
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
{| class="wikitable" style="text-align: center;
|-
|-
Line 190: Line 289:
|}
|}


Please install the required software packages with the package manager:
These packages can be installed directly from the command line like this:


  sudo apt install make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev
  sudo apt install rsync make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev


Change into the {{VASP}} directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:


  cp arch/makefile.include.gnu_omp makefile.include
  cp arch/makefile.include.gnu_omp makefile.include
Line 226: Line 325:
  make DEPS=1 -j
  make DEPS=1 -j


Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Hybrid MPI/OpenMP parallelization|OpenMP threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add


  export OMP_NUM_THREADS=1
  export OMP_NUM_THREADS=1
Line 234: Line 333:
==Fedora==
==Fedora==


===Building VASP 6.3.0 on Fedora 35===
===Building VASP 6.3.0 - 6.3.1 on Fedora 35===
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
|-
! Compiler
! MPI
! FFT
! BLAS
! LAPACK
! ScaLAPACK
! HDF5
! Known issues
|-
| gcc-11.2.1
| style="background-color:#f5d9da;" | openmpi-4.1.1
| fftw-3.3.8
| colspan="2" | openblas-0.3.19
|  netlib-scalapack-2.1.0
| hdf5-1.10.7
| <span style=background:#f5d9da>Memory-leak<ref name="ompi-bug-1"/></span>
|}
 
These packages can be installed directly from the command line like this:
 
sudo yum install gcc gcc-c++ gcc-gfortran openblas-devel openmpi-devel scalapack-openmpi-devel fftw-devel hdf5-openmpi-devel
 
Add the following lines to your <code>.bashrc</code> file located in your home directory:
 
export PATH=${PATH}:/usr/lib64/openmpi/bin/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/openmpi/lib
 
and either open a new shell or run this command to activate the lines above:
 
source ~/.bashrc
 
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
 
cp arch/makefile.include.gnu_omp makefile.include
 
Search for the paragraph in <code>makefile.include</code> starting with <code>## Customize as of this point!</code> and apply the following changes below:
<ul>
<li>Comment out the <code>OPENBLAS_ROOT</code> variable (not needed) and set <code>BLASPACK</code>:</li>
<pre># BLAS and LAPACK (mandatory)
#OPENBLAS_ROOT ?= /path/to/your/openblas/installation
BLASPACK    = -lopenblas</pre>
<li>Comment out the <code>SCALAPACK_ROOT</code> variable (not needed) and set <code>SCALAPACK</code>:</li>
<pre># scaLAPACK (mandatory)
#SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
SCALAPACK  = -lscalapack</pre>
<li>Comment out the <code>FFTW_ROOT</code> variable (not needed). Set <code>LLIBS</code> and <code>INCS</code> in the FFTW section:</li>
<pre># FFTW (mandatory)
#FFTW_ROOT  ?= /path/to/your/fftw/installation
LLIBS      += -lfftw3 -lfftw3_omp
INCS      += -I/usr/include</pre>
<li>Enable HDF5 support by adding <code>-DVASP_HDF5</code> to the <code>CPP_OPTIONS</code> variable. Leave <code>HDF5_ROOT</code> variable commented out (not needed). Set <code>LLIBS</code> and <code>INCS</code> in the HDF5 section:</li>
<pre># HDF5-support (optional but strongly recommended)
CPP_OPTIONS+= -DVASP_HDF5
#HDF5_ROOT  ?= /path/to/your/hdf5/installation
LLIBS      += -lhdf5_fortran
INCS      += -I/usr/lib64/gfortran/modules/openmpi/</pre>
</ul>
 
Save your <code>makefile.include</code> and compile {{VASP}}:


Please install the required software packages with the package manager:
make DEPS=1 -j


  sudo yum install automake gcc gcc-c++ gcc-gfortran lapack-devel openblas-devel openmpi-devel scalapack-openmpi-devel fftw-devel hdf5-openmpi-devel
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
 
export OMP_NUM_THREADS=1
 
in your <code>~/.bashrc</code> file.
 
===Building VASP 6.4.X on Fedora 37 to 38===
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
|-
! OS version
! Compiler
! MPI
! FFT
! BLAS
! LAPACK
! ScaLAPACK
! HDF5
! Known issues
|-
| 37
| gcc-12.3.1
| openmpi-4.1.4
| fftw-3.3.10
| colspan="2" | openblas-0.3.21
| netlib-scalapack-2.2.0
| hdf5-1.12.1
|
|-
| 38
| gcc-13.2.1
| openmpi-4.1.4
| fftw-3.3.10
| colspan="2" | openblas-0.3.21
| netlib-scalapack-2.2.0
| hdf5-1.12.1
|
|}
 
These packages can be installed directly from the command line like this:
 
  sudo yum install rsync gcc gcc-c++ gcc-gfortran openblas-devel openmpi-devel scalapack-openmpi-devel fftw-devel hdf5-openmpi-devel


Add the following lines to your <code>.bashrc</code> file located in your home directory:
Add the following lines to your <code>.bashrc</code> file located in your home directory:
Line 249: Line 454:
  source ~/.bashrc
  source ~/.bashrc


Change into the {{VASP}} directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:


  cp arch/makefile.include.gnu_omp makefile.include
  cp arch/makefile.include.gnu_omp makefile.include
Line 281: Line 486:
  make DEPS=1 -j
  make DEPS=1 -j


Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Hybrid MPI/OpenMP parallelization|OpenMP threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add


  export OMP_NUM_THREADS=1
  export OMP_NUM_THREADS=1
Line 289: Line 494:
==Rocky Linux==
==Rocky Linux==


===Building VASP 6.3.0 on Rocky Linux 8.5===
===Building VASP 6.3.0 - 6.3.1 on Rocky Linux 8.5===
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
|-
! Compiler
! MPI
! FFT
! BLAS
! LAPACK
! ScaLAPACK
! HDF5
! Known issues
|-
| gcc-11.2.1
| style="background-color:#f5d9da;" | openmpi-4.1.1
| fftw-3.3.5
| colspan="2" | openblas-0.3.12
|  netlib-scalapack-2.0.2
| hdf5-1.10.5
| <span style=background:#f5d9da>Memory-leak<ref name="ompi-bug-1"/></span>
|}


Please install the required software packages with the package manager. First, some packages are available from the default package sources:
Some of these packages are available from the default package sources:


  sudo dnf install openmpi-devel fftw-devel
  sudo dnf install openmpi-devel fftw-devel
Line 304: Line 530:
  sudo dnf install dnf-plugins-core
  sudo dnf install dnf-plugins-core
  sudo dnf config-manager --set-enabled powertools
  sudo dnf config-manager --set-enabled powertools
  sudo dnf install lapack-devel openblas-devel scalapack-openmpi-devel hdf5-openmpi-devel
  sudo dnf install openblas-devel scalapack-openmpi-devel hdf5-openmpi-devel


Add the following lines to your <code>.bashrc</code> file located in your home directory:
Add the following lines to your <code>.bashrc</code> file located in your home directory:
Line 314: Line 540:
  source ~/.bashrc
  source ~/.bashrc
{{NB|mind|As long as the path <code>/opt/rh/gcc-toolset-11/root/bin/</code> is in the <code>PATH</code> variable the system's default compiler binaries (<code>gcc</code>, <code>g++</code>, <code>gfortran</code>,...) are "hidden" behind the newer ones.}}
{{NB|mind|As long as the path <code>/opt/rh/gcc-toolset-11/root/bin/</code> is in the <code>PATH</code> variable the system's default compiler binaries (<code>gcc</code>, <code>g++</code>, <code>gfortran</code>,...) are "hidden" behind the newer ones.}}
Change into the {{VASP}} directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
 
cp arch/makefile.include.gnu_omp makefile.include
 
Search for the paragraph in <code>makefile.include</code> starting with <code>## Customize as of this point!</code> and apply the following changes below:
<ul>
<li>Comment out the <code>OPENBLAS_ROOT</code> variable (not needed) and set <code>BLASPACK</code>:</li>
<pre># BLAS and LAPACK (mandatory)
#OPENBLAS_ROOT ?= /path/to/your/openblas/installation
BLASPACK    = -lopenblas</pre>
<li>Comment out the <code>SCALAPACK_ROOT</code> variable (not needed) and set <code>SCALAPACK</code>:</li>
<pre># scaLAPACK (mandatory)
#SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
SCALAPACK  = -lscalapack</pre>
<li>Comment out the <code>FFTW_ROOT</code> variable (not needed). Set <code>LLIBS</code> and <code>INCS</code> in the FFTW section:</li>
<pre># FFTW (mandatory)
#FFTW_ROOT  ?= /path/to/your/fftw/installation
LLIBS      += -lfftw3 -lfftw3_omp
INCS      += -I/usr/include</pre>
<li>Enable HDF5 support by adding <code>-DVASP_HDF5</code> to the <code>CPP_OPTIONS</code> variable. Leave <code>HDF5_ROOT</code> variable commented out (not needed). Set <code>LLIBS</code> and <code>INCS</code> in the HDF5 section:</li>
<pre># HDF5-support (optional but strongly recommended)
CPP_OPTIONS+= -DVASP_HDF5
#HDF5_ROOT  ?= /path/to/your/hdf5/installation
LLIBS      += -lhdf5_fortran
INCS      += -I/usr/lib64/gfortran/modules/openmpi/</pre>
</ul>
 
Save your <code>makefile.include</code> and compile {{VASP}}:
 
make DEPS=1 -j
 
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
 
export OMP_NUM_THREADS=1
 
in your <code>~/.bashrc</code> file.
 
===Building VASP 6.3.2 on Rocky Linux 9.0===
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
|-
! Compiler
! MPI
! FFT
! BLAS
! LAPACK
! ScaLAPACK
! HDF5
! Known issues
|-
| gcc-11.2.1
| style="background-color:#f5d9da;" | openmpi-4.1.1
| fftw-3.3.8
| colspan="2" | openblas-0.3.15
|  netlib-scalapack-2.2.0
| hdf5-1.12.1
| <span style=background:#f5d9da>Memory-leak<ref name="ompi-bug-1"/></span>
|}
 
Some of these packages are available from the default package sources:
 
sudo dnf install gcc gcc-c++ gcc-gfortran openmpi-devel fftw-devel
 
Some required libraries are available within the "CRB" ("Code Ready Builder") and [https://docs.fedoraproject.org/en-US/epel/ EPEL repositories] repositories:
 
sudo dnf config-manager --set-enabled crb
sudo dnf install openblas-devel
sudo dnf install epel-release
sudo dnf install scalapack-openmpi-devel hdf5-openmpi-devel
 
Add the following lines to your <code>.bashrc</code> file located in your home directory:
 
export PATH=${PATH}:/usr/lib64/openmpi/bin/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/openmpi/lib
 
and either open a new shell or run this command to activate the lines above:
 
source ~/.bashrc
 
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:
 
cp arch/makefile.include.gnu_omp makefile.include
 
Search for the paragraph in <code>makefile.include</code> starting with <code>## Customize as of this point!</code> and apply the following changes below:
<ul>
<li>Comment out the <code>OPENBLAS_ROOT</code> variable (not needed) and set <code>BLASPACK</code>:</li>
<pre># BLAS and LAPACK (mandatory)
#OPENBLAS_ROOT ?= /path/to/your/openblas/installation
BLASPACK    = -lopenblas</pre>
<li>Comment out the <code>SCALAPACK_ROOT</code> variable (not needed) and set <code>SCALAPACK</code>:</li>
<pre># scaLAPACK (mandatory)
#SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
SCALAPACK  = -lscalapack</pre>
<li>Comment out the <code>FFTW_ROOT</code> variable (not needed). Set <code>LLIBS</code> and <code>INCS</code> in the FFTW section:</li>
<pre># FFTW (mandatory)
#FFTW_ROOT  ?= /path/to/your/fftw/installation
LLIBS      += -lfftw3 -lfftw3_omp
INCS      += -I/usr/include</pre>
<li>Enable HDF5 support by adding <code>-DVASP_HDF5</code> to the <code>CPP_OPTIONS</code> variable. Leave <code>HDF5_ROOT</code> variable commented out (not needed). Set <code>LLIBS</code> and <code>INCS</code> in the HDF5 section:</li>
<pre># HDF5-support (optional but strongly recommended)
CPP_OPTIONS+= -DVASP_HDF5
#HDF5_ROOT  ?= /path/to/your/hdf5/installation
LLIBS      += -lhdf5_fortran
INCS      += -I/usr/lib64/gfortran/modules/openmpi/</pre>
</ul>
 
Save your <code>makefile.include</code> and compile {{VASP}}:
 
make DEPS=1 -j
 
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
 
export OMP_NUM_THREADS=1
 
in your <code>~/.bashrc</code> file.
 
===Building VASP 6.4.X on Rocky Linux 9.2===
-----
First, we need to make sure that the [[Installing_VASP.6.X.X#Requirements|prerequisites]] for building {{VASP}} are met. Here, we install the following compiler and libraries from the system's package manager:
{| class="wikitable" style="text-align: center;
|-
! Compiler
! MPI
! FFT
! BLAS
! LAPACK
! ScaLAPACK
! HDF5
! Known issues
|-
| gcc-11.3.1
| style="background-color:#f5d9da;" | openmpi-4.1.1
| fftw-3.3.8
| colspan="2" | openblas-0.3.21
| netlib-scalapack-2.2.0
| hdf5-1.12.1
| <span style=background:#f5d9da>Memory-leak<ref name="ompi-bug-1"/></span>
|}
 
Some of these packages are available from the default package sources:
 
sudo dnf install rsync gcc gcc-c++ gcc-gfortran openmpi-devel fftw-devel
 
Some required libraries are available within the "CRB" ("Code Ready Builder") and [https://docs.fedoraproject.org/en-US/epel/ EPEL repositories] repositories:
 
sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled crb
sudo dnf install openblas-devel
sudo dnf install epel-release
sudo dnf install scalapack-openmpi-devel hdf5-openmpi-devel
 
Add the following lines to your <code>.bashrc</code> file located in your home directory:
 
export PATH=${PATH}:/usr/lib64/openmpi/bin/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/openmpi/lib
 
and either open a new shell or run this command to activate the lines above:
 
source ~/.bashrc
 
Next, unpack the {{VASP}} source code to a location of your choice. Then change into the {{VASP}} base directory and use the <code>arch/makefile.include.gnu_omp</code> template as basis for the <code>[[makefile.include]]</code>:


  cp arch/makefile.include.gnu_omp makefile.include
  cp arch/makefile.include.gnu_omp makefile.include
Line 346: Line 735:
  make DEPS=1 -j
  make DEPS=1 -j


Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Hybrid MPI/OpenMP parallelization|OpenMP threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add
Once the build process is complete the binaries are located in the {{VASP}} <code>bin</code> subfolder. They were compiled with [[Combining MPI and OpenMP|OpenMP-threading support]]. Before running {{VASP}} please always check if the <code>OMP_NUM_THREADS</code> environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add


  export OMP_NUM_THREADS=1
  export OMP_NUM_THREADS=1
Line 355: Line 744:
<references>
<references>
<ref name="ompi-bug-1">A bug in OpenMPI versions 4.0.4-4.1.1 causes a memory leak in some ScaLAPACK calls. This mainly affects long [[:Category:Molecular dynamics|molecular-dynamics]] runs. This issue is fixed as of openmpi-4.1.2.</ref>
<ref name="ompi-bug-1">A bug in OpenMPI versions 4.0.4-4.1.1 causes a memory leak in some ScaLAPACK calls. This mainly affects long [[:Category:Molecular dynamics|molecular-dynamics]] runs. This issue is fixed as of openmpi-4.1.2.</ref>
</references>
[[Category:VASP]][[Category:Installation]]

Latest revision as of 10:10, 10 June 2024

Here you will find instructions on how to install VASP on some widely-used Linux distributions. For the sake of simplicity the suggested build processes rely as much as possible on compilers and libraries provided by the operating system's package manager. The focus is on minimizing the effort to obtain working VASP binaries with only little changes required to the provided makefile.include templates in the arch directory.

Warning: These short and convenient installation instructions may come at the cost of performance. They are not optimized with respect to compilers, libraries and hardware. Please consider benchmarking and optimizing your build process prior to large-scale production runs.

In order to verify each build we run the FAST category tests of the testsuite.

Tip: All build instructions presented here include HDF5 support to allow post-processing of results with py4vasp.

The build instructions have been tested on clean installations (virtual machines or docker images) of the operating systems in the following table. Search for your desired combination of OS and VASP and click on the provided link to get directly to the corresponding section on this page:

Operating system VASP
Name Version 6.3.0 - 6.3.1 6.3.2 6.4.X
Debian 11 Link
12 Link
Ubuntu 20.04 Link
22.04 Link
Fedora 35 Link
37 - 38 Link
Rocky Linux 8.5 Link
9.0 Link
9.2 Link

A red box background indicates that there are known issues with the used compiler/library versions (see the individual instructions for details). The table and corresponding instructions will be updated when either a new version of VASP or a major release of the operating systems is available. However, not all combinations will be tested and hence some fields will stay blank. In these cases it may still be helpful to start from instructions for close-by tested combinations.


Debian

Building VASP 6.3.X to 6.4.X on Debian 11


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
gcc-10.2.1 openmpi-4.1.0 fftw-3.3.8 openblas-0.3.13 netlib-scalapack-2.1.0 hdf5-1.10.6 Memory-leak[1]

These packages can be installed directly from the command line like this:

sudo apt install rsync make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack-openmpi
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi/ -lhdf5_fortran
    INCS       += -I/usr/include/hdf5/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Building VASP 6.4.X on Debian 12


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
gcc-12.2.0 openmpi-4.1.4 fftw-3.3.10 openblas-0.3.21 netlib-scalapack-2.2.1 hdf5-1.10.8

These packages can be installed directly from the command line like this:

sudo apt install rsync make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack-openmpi
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi/ -lhdf5_fortran
    INCS       += -I/usr/include/hdf5/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Ubuntu

Building VASP 6.3.0 - 6.3.1 on Ubuntu 20.04


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
gcc-9.4.0 openmpi-4.0.3 fftw-3.3.8 openblas-0.3.8 netlib-scalapack-2.1.0 hdf5-1.10.4 -

These packages can be installed directly from the command line like this:

sudo apt install make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the line adding -fallow-argument-mismatch to the variable FFLAGS:
  • # For gcc-10 and higher (comment out for older versions)
    #FFLAGS     += -fallow-argument-mismatch
  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack-openmpi
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi/ -lhdf5_fortran
    INCS       += -I/usr/include/hdf5/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Building VASP 6.3.X to 6.4.X on Ubuntu 22.04


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
gcc-11.2.0 openmpi-4.1.2 fftw-3.3.8 openblas-0.3.20 netlib-scalapack-2.1.0 hdf5-1.10.7 -

These packages can be installed directly from the command line like this:

sudo apt install rsync make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack-openmpi
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi/ -lhdf5_fortran
    INCS       += -I/usr/include/hdf5/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Fedora

Building VASP 6.3.0 - 6.3.1 on Fedora 35


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
gcc-11.2.1 openmpi-4.1.1 fftw-3.3.8 openblas-0.3.19 netlib-scalapack-2.1.0 hdf5-1.10.7 Memory-leak[1]

These packages can be installed directly from the command line like this:

sudo yum install gcc gcc-c++ gcc-gfortran openblas-devel openmpi-devel scalapack-openmpi-devel fftw-devel hdf5-openmpi-devel

Add the following lines to your .bashrc file located in your home directory:

export PATH=${PATH}:/usr/lib64/openmpi/bin/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/openmpi/lib

and either open a new shell or run this command to activate the lines above:

source ~/.bashrc

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -lhdf5_fortran
    INCS       += -I/usr/lib64/gfortran/modules/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Building VASP 6.4.X on Fedora 37 to 38


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

OS version Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
37 gcc-12.3.1 openmpi-4.1.4 fftw-3.3.10 openblas-0.3.21 netlib-scalapack-2.2.0 hdf5-1.12.1
38 gcc-13.2.1 openmpi-4.1.4 fftw-3.3.10 openblas-0.3.21 netlib-scalapack-2.2.0 hdf5-1.12.1

These packages can be installed directly from the command line like this:

sudo yum install rsync gcc gcc-c++ gcc-gfortran openblas-devel openmpi-devel scalapack-openmpi-devel fftw-devel hdf5-openmpi-devel

Add the following lines to your .bashrc file located in your home directory:

export PATH=${PATH}:/usr/lib64/openmpi/bin/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/openmpi/lib

and either open a new shell or run this command to activate the lines above:

source ~/.bashrc

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -lhdf5_fortran
    INCS       += -I/usr/lib64/gfortran/modules/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Rocky Linux

Building VASP 6.3.0 - 6.3.1 on Rocky Linux 8.5


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
gcc-11.2.1 openmpi-4.1.1 fftw-3.3.5 openblas-0.3.12 netlib-scalapack-2.0.2 hdf5-1.10.5 Memory-leak[1]

Some of these packages are available from the default package sources:

sudo dnf install openmpi-devel fftw-devel

Unfortunately the GCC version 8.5 provided by default is not suitable for compiling VASP. As an alternative we can use a newer version from the EPEL repositories:

sudo dnf install epel-release
sudo dnf install gcc-toolset-11-gcc gcc-toolset-11-gcc-c++ gcc-toolset-11-gcc-gfortran

Furthermore, some required libraries are available within the "PowerTools" repositories:

sudo dnf install dnf-plugins-core
sudo dnf config-manager --set-enabled powertools
sudo dnf install openblas-devel scalapack-openmpi-devel hdf5-openmpi-devel

Add the following lines to your .bashrc file located in your home directory:

export PATH=/opt/rh/gcc-toolset-11/root/bin/:/usr/lib64/openmpi/bin/:${PATH}

and either open a new shell or run this command to activate the lines above:

source ~/.bashrc
Mind: As long as the path /opt/rh/gcc-toolset-11/root/bin/ is in the PATH variable the system's default compiler binaries (gcc, g++, gfortran,...) are "hidden" behind the newer ones.

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -lhdf5_fortran
    INCS       += -I/usr/lib64/gfortran/modules/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Building VASP 6.3.2 on Rocky Linux 9.0


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
gcc-11.2.1 openmpi-4.1.1 fftw-3.3.8 openblas-0.3.15 netlib-scalapack-2.2.0 hdf5-1.12.1 Memory-leak[1]

Some of these packages are available from the default package sources:

sudo dnf install gcc gcc-c++ gcc-gfortran openmpi-devel fftw-devel

Some required libraries are available within the "CRB" ("Code Ready Builder") and EPEL repositories repositories:

sudo dnf config-manager --set-enabled crb
sudo dnf install openblas-devel
sudo dnf install epel-release
sudo dnf install scalapack-openmpi-devel hdf5-openmpi-devel

Add the following lines to your .bashrc file located in your home directory:

export PATH=${PATH}:/usr/lib64/openmpi/bin/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/openmpi/lib

and either open a new shell or run this command to activate the lines above:

source ~/.bashrc

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -lhdf5_fortran
    INCS       += -I/usr/lib64/gfortran/modules/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Building VASP 6.4.X on Rocky Linux 9.2


First, we need to make sure that the prerequisites for building VASP are met. Here, we install the following compiler and libraries from the system's package manager:

Compiler MPI FFT BLAS LAPACK ScaLAPACK HDF5 Known issues
gcc-11.3.1 openmpi-4.1.1 fftw-3.3.8 openblas-0.3.21 netlib-scalapack-2.2.0 hdf5-1.12.1 Memory-leak[1]

Some of these packages are available from the default package sources:

sudo dnf install rsync gcc gcc-c++ gcc-gfortran openmpi-devel fftw-devel

Some required libraries are available within the "CRB" ("Code Ready Builder") and EPEL repositories repositories:

sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled crb
sudo dnf install openblas-devel
sudo dnf install epel-release
sudo dnf install scalapack-openmpi-devel hdf5-openmpi-devel

Add the following lines to your .bashrc file located in your home directory:

export PATH=${PATH}:/usr/lib64/openmpi/bin/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64/openmpi/lib

and either open a new shell or run this command to activate the lines above:

source ~/.bashrc

Next, unpack the VASP source code to a location of your choice. Then change into the VASP base directory and use the arch/makefile.include.gnu_omp template as basis for the makefile.include:

cp arch/makefile.include.gnu_omp makefile.include

Search for the paragraph in makefile.include starting with ## Customize as of this point! and apply the following changes below:

  • Comment out the OPENBLAS_ROOT variable (not needed) and set BLASPACK:
  • # BLAS and LAPACK (mandatory)
    #OPENBLAS_ROOT ?= /path/to/your/openblas/installation
    BLASPACK    = -lopenblas
  • Comment out the SCALAPACK_ROOT variable (not needed) and set SCALAPACK:
  • # scaLAPACK (mandatory)
    #SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
    SCALAPACK   = -lscalapack
  • Comment out the FFTW_ROOT variable (not needed). Set LLIBS and INCS in the FFTW section:
  • # FFTW (mandatory)
    #FFTW_ROOT  ?= /path/to/your/fftw/installation
    LLIBS      += -lfftw3 -lfftw3_omp
    INCS       += -I/usr/include
  • Enable HDF5 support by adding -DVASP_HDF5 to the CPP_OPTIONS variable. Leave HDF5_ROOT variable commented out (not needed). Set LLIBS and INCS in the HDF5 section:
  • # HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    #HDF5_ROOT  ?= /path/to/your/hdf5/installation
    LLIBS      += -lhdf5_fortran
    INCS       += -I/usr/lib64/gfortran/modules/openmpi/

Save your makefile.include and compile VASP:

make DEPS=1 -j

Once the build process is complete the binaries are located in the VASP bin subfolder. They were compiled with OpenMP-threading support. Before running VASP please always check if the OMP_NUM_THREADS environment variable is set according to your needs. For example, if you require only pure MPI parallelization without OpenMP threading add

export OMP_NUM_THREADS=1

in your ~/.bashrc file.

Footnotes and references

  1. a b c d e A bug in OpenMPI versions 4.0.4-4.1.1 causes a memory leak in some ScaLAPACK calls. This mainly affects long molecular-dynamics runs. This issue is fixed as of openmpi-4.1.2.