Quantum ESPRESSO is an open-source software package developed by an Italian research group for performing first-principles electronic structure calculations (specifically Density Functional Theory). Quantum ESPRESSO can simulate the electronic and structural properties of materials at the nanoscale and is widely used by researchers around the world in the fields of condensed matter physics, materials science, and computational chemistry. computational chemistry.
This article explains the procedures for running Quantum ESPRESSO in the Matlantis environment.
[Disclaimer] This procedure involves modifying configuration files (~/.bashrc) and adding libraries. Since typing errors or package dependencies may cause unexpected issues, please proceed with care and at your own discretion.
Installing Dependency Libraries
Before installing Quantum ESPRESSO, we need to install the external libraries Quantum ESPRESSO depends on. Specifically, we will install OpenMPI for parallel computing, FFTW for high-speed processing of Fourier transforms, and OpenBLAS, a numerical computation library containing matrix diagonalization algorithms.
(1) Installing OpenMPI
Quantum ESPRESSO supports "parallel computing," which distributes complex calculations across multiple CPU cores for high-speed processing. OpenMPI is the library required for this.
Preparing the source code
First、download openmpi-5.0.8.tar.gz from OpenMPI website, upload it to Matlantis, and extract it.
# Extract the download file
$ tar -zxvf openmpi-5.0.8.tar.gz
# Move to the extracted directory
$ cd openmpi-5.0.8
Compiling and Installing
Next, compile the source code.
# Create the installation directory
$ mkdir -p ~/local/openmpi-5.0.8
# Run the configure script to set up the bulid environment
# --prefix specifies the installation destination
$ ./configure --prefix=/home/jovyan/local/openmpi-5.0.8 CC=gcc CXX=g++ FC=gfortran
# Execute compilation (specify the number of parallel processes with the -j option)
$ make -j 2
# Install
$ make install
Setting the Path (~/.bashrc)
~/.bashrc:MPIROOT=/home/jovyan/local/openmpi-5.0.8
PATH=$MPIROOT/bin:$PATH
LD_LIBRARY_PATH=$MPIROOT/lib:$LD_LIBRARY_PATH
MANPATH=$MPIROOT/share/man:$MANPATH
export MPIROOT PATH LD_LIBRARY_PATH MANPATH
After adding the path settings, apply the environment settings with:
$ source ~/.bashrc
(2) Installing FFTW
FFTW (Fastest Fourier Transform in the West) is a library for efficiently performing the fast Fourier transforms that are frequently performed during Quantum ESPRESSO calculations.
Download the source code
Download fftw-3.3.10.tar.gz from https://github.com/FFTW/fftw3, upload it to Matlantis, and extract the tar file.
# Extract the file
tar -zxvf fftw-3.3.10.tar.gz
# Move to the directory
cd fftw-3.3.10
Compiling and installing
Compile FFTW with the option to enable MPI so it can work in conjunction with the previously installed OpenMPI.
# Specify the installation directory and set up the build environment
# --enable-mpi enables MPI, --enable-threads enables thread parallelism
$ ./configure --prefix=/home/jovyan/local/fftw-3.3.10 CC=gcc MPICC=mpicc F77=gfortran --enable-mpi --enable-threads
# Compile
$ make
# Install
$ make install
Setting the Path
Set the environment variables so the system can recognize the installed library. Add the following to the configuration file ~/.bashrc:
FFTWROOT=/home/jovyan/local/fftw-3.3.10
PATH=$FFTWROOT/bin:$PATH
LD_LIBRARY_PATH=$FFTWROOT/lib:$LD_LIBRARY_PATH
export FFTWROOT PATH LD_LIBRARY_PATH MANPATH
After adding the path settings, apply the environment settings with:
$ source ~/.bashrc
(3) Installing OpenBLAS
OpenBLAS is a library for performing high-speed linear algebra operations such as matrix and vector calculations. This is also a critical element as it directly affects the performance of Quantum ESPRESSO.
Downloading the source code
Download OpenBLAS-0.3.30.tar.gz from https://github.com/OpenMathLib/OpenBLAS/releases/tag/v0.3.30 and extract it on Matlantis.
# Extract the file
$ tar -zxvf OpenBLAS-0.3.30.tar.gz
# Move to the directory
$ cd OpenBLAS-0.3.30
Compiling and installing
OpenBLAS is built using cmake.
# Create a build directory
$ mkdir build && cd build
# Create the installation directory
$ mkdir ~/local/openblas-0.3.30
# Set up the build environment using cmake
$ cmake .. \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_Fortran_COMPILER=gfortran \
-DNOFORTRAN=0 \
-DDYNAMIC_ARCH=OFF \
-DCMAKE_INSTALL_PREFIX="/home/jovyan/local/openblas-0.3.30" \
-DCMAKE_BUILD_TYPE=Release
# Execute compilation and installation simultaneously
$ make install
Setting environment variables
Set the environment variables so the system can recognize the installed library. Add the following to the configuration file ~/.bashrc:
OBLASROOT=/home/jovyan/local/openblas-0.3.30
PATH=$OBLASROOT/bin:$PATH
LD_LIBRARY_PATH=$OBLASWROOT/lib:$LD_LIBRARY_PATH
export OBLASROOT PATH LD_LIBRARY_PATH MANPATH
Installing Quantum ESPRESSO
Finally, we will install the main Quantum ESPRESSO application.
Download the source code
Download qe-7.0-ReleasePack.tgz from https://github.com/QEF/q-e/releases and extract it on Matlantis.
# Extract the file
tar -zxvf qe-7.0-ReleasePack.tgz
# Move to the directory
cd qe-7.0
Compiling and installing
There are two ways to compile the Quantun ESPRESS: using ./configure and cmake. Due to the version issue of cmake provided in the Matlantis environment, we will use ./configure here.
# Execute the configure script
# Specify compilers for MPI using FC and CC
# Use FFLAGS to specify the FFTW include path and compiler error-avoidance options
$ ./configure --prefix=/home/jovyan/local/q-e FC=mpif90 CC=mpicc CPP=cpp FFLAGS="-I/home/jovyan/local/fftw-3.3.10/include -fallow-argument-mismatch"
# Compile the main program suite
$ make pwall- The
FFLAGS="-I/home/jovyan/local/fftw-3.3.10/include"specifies the link to the FFTW library we built earlier. - The
-fallow-argument-mismatchflag inFFLAGSis set to avoid errors that occur when compiling older code with a relatively new gfortran compiler. Without this flag, we encountered compilation errors.
Check the installation
If the compilation is successful, let's run the main program, pw.x.
# Check the directory where the executable file is stored
ls bin/
# Execute pw.x
./bin/pw.x
If the following message is displayed, the installation is successful. It will show Waiting for input... and remain in an input standby state (you can exit using Ctrl+C).
Program PWSCF v.7.0 starts on 22Jun2025 at 0:59: 3
This program is part of the open-source Quantum ESPRESSO suite
for quantum simulation of materials; please cite
"P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009);
"P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017);
"P. Giannozzi et al., J. Chem. Phys. 152 154105 (2020);
URL http://www.quantum-espresso.org",
in publications or presentations arising from this work. More details at
http://www.quantum-espresso.org/quote
Parallel version (MPI), running on 1 processors
MPI processes distributed on 1 nodes
1056 MiB available memory on the printing compute node when the environment starts
Waiting for input...
This completes the entire process of building Quantum ESPRESSO on Matlantis. From now on, you can create input files and execute first-principles calculations for various materials.