Here is a step-by-step guide on how to install and do a test-run of quantum ESPRESSO on a Linux machine.
Any operating system (Windows, Mac OS, Linux) will do as long as a UNIX environment with a command shell is available. If you want to use Windows you are going to need Cygwin which mimics a UNIX environment on Windows. However, I recommend using Ubuntu 18 on a virtual machine as I have seen relatively fewer issues on this OS regarding compilers and the libraries compatibility.
You will need to install C and Fortran compilers. The recommended version for both is GNU 7.5.0.
You can install these on Ubuntu via the following commands:
sudo apt updatesudo apt install build-essential
sudo apt install manpages-devThese packages install the required compilers such as gcc, g++, make, gfortran, and etc with the corresponding version GNU 7.5.0.
To make sure all is installed correctly, check the versions:
gcc --version
gfortran --versionNext you need to install Open MPI which provides parallel libraries and compilers such as mpif90 which will be used by Quantum ESPRESSO. Here is how to install it in Linux.
sudo apt update
sudo apt install openmpi-binChecking the mpif90 version, you should get the same version as that of gfortran that is GNU 7.5.0.
mpif90 --version First you need to download the latest stable release of quantum ESPRESSO (as of now 6.5 version is the latest one.)
Then you will unzip the files and go into the the directory that was just created.
wget https://github.com/QEF/q-e/releases/download/qe-6.5/qe-6.5-ReleasePack.tgz
tar -zxvf qe-6.5-ReleasePack.tgz
cd qe-6.5If all the required compilers are installed correctly and the versions are compatible, then the following two commands should run without any errors.
make sure your current directory is qe-6.5.
./configureIn the log that follows, the following line should show up:
parallel environment detected successfully.
This will take a bit of time. This command will compile all the files in the project and create executables.
make all Environment variables usually describe the directories that the software works with. They are also used to configure the conditions under which the executables run. For example, you can toggle between serial and parallel processing modes. Although the environment variables are predefined, you may want to change them depending on your specific needs.
You can find the environment_variables file in the root directory of quantum ESPRESSO, that is qe-6.5/environment_variables.
In this file, you can toggle between serial and parallel processing by commenting and uncommenting two lines of code.
For serial processing, you leave the PARA_PREFIX variable empty
PARA_PREFIX=" "
# PARA_PREFIX="mpirun -np 4"and for parallel processing, you set PARA_PREFIX to include a parallel prefix as follows
# PARA_PREFIX=" "
PARA_PREFIX="mpirun -np 4"where mpirun -np 4 means that the mpirun runs your executables in parallel and the number 4 denotes the number of processors which -np stands for.
Change directory to the example01 folder.
cd PW/examples/example01Run the example.
bash run_exampleIf everything goes smoothly and without error, at the end you should get
done.