Here we cover the simple steps of how to install compilers and required libraries that are required for Quantum Espresso (QE), Wannier90 (W90), YAMBO, and PERTURBO. If you have more specific questions related to those libraries, please refer to the corresponding official websites.
We will use our in-house supercomputer cluster, TEMPO, to show how to compile the software. Note that if you install or compile the source codes on another machine, please modify the following commands/paths accordingly. Below, we will use GNU compilors to demonstrate how to compile the codes. If you would like to compile efficient codes, please use the Intel compilers on TEMPO.
Table of contents
For Lazy People (Intel Compiler)
I know you are lazy :smirk:. Ok, in your home directory on TEMPO, please create a directory called Licenses
and copy our intel licence on our machine from the following directory /home/timescale/IntelLicences
to the directory you just created. Note that the licence would expire someday in Mar, 2022; therefore, someone in our group should renew it.
After you have the licence for the intel compilers, put the following commands in your ~/.bash_profile
file:
......
module purge
module load compilers/intel/19.4
source /usr/local/Intel/19.4/impi/2019.4.243/intel64/bin/mpivars.sh
......
You can type which ifort
to check if it is from the correct source /usr/local/Intel/19.4/compilers_and_libraries_2019/linux/bin/intel64/ifort
.
Once you are done with the above steps, now you can directly use Intel compilers to compile your codes or run your calculations. Here we also have compiled a few codes using the Intel compilers on TEMPO, for example, Quantum Espresso, Wannier90, yambo, and perturbo. Please see the directory /home/timescale/comsoftware/qe-6.5-intel
. You can use the executable programs provided there.
However, if you would like to modify your own copies or codes, we would recommend going through the following related sections to know how to compile, especially, Quantum Espresso.
GCC-6.5.0
The GCC compilers have been installed in our common directory on TEMPO, /home/timescale/comsoftware/gcc-6.5.0
. To use the compilers, please include the following contents into your ~/.bash_profile
file and source
the file again:
# modify the bash_profile
>> vi ~/.bash_profile
-----------------------------------------------------------------------------------------
......
export PATH=/home/timescale/comsoftware/gcc-6.5.0/bin:$PATH
export LD_LIBRARY_PATH=/home/timescale/comsoftware/gcc-6.5.0/lib64:$LD_LIBRARY_PATH
......
-----------------------------------------------------------------------------------------
# reload the paths
>> source ~/.bash_profile
# to check if the paths work, use `which` to see if it refers to the paths.
>> which gfortran
If you consider to install the compilers by youself, please dowlonad the GCC release from the mirror site: https://gcc.gnu.org/mirrors.html. Next, follow the commands below:
>> wget <the-source-code>
# The uncompress the tar or tar.gz file to get the source codes
# download the required libraries that are not installed on TEMPO)
>> ./contrib/download_prerequisites
>> ./configure --prefix=<your-defined-installed-path>
>> make -j 4 all
>> make install
OpenMPI-2.1.6
The MPI wrappers have been installed on TEMPO. If you would like to use them, please include the following paths into your ~/.bash_profile
and source
the file again:
# modify the bash_profile
>> vi ~/.bash_profile
-----------------------------------------------------------------------------------------
......
export PATH=/home/timescale/comsoftware/openmpi-2.1.6-gcc6/bin:\$PATH
export LD_LIBRARY_PATH=/home/timescale/comsoftware/openmpi-2.1.6-gcc6/lib:\$LD_LIBRARY_PATH
......
-----------------------------------------------------------------------------------------
# reload the paths
>> source ~/.bash_profile
# to check if the paths work, use `which` to see if it refers to the paths.
>> which mpif90
If you consider to install the wrappers by youself, please dowlonad the source from this site: https://www.open-mpi.org/software/ompi/v2.1/. However, please make sure that you also have your GCC compilers ready. Please follow the commands below to install OpenMP:
>> wget <the-source-code>
# The uncompress the tar or tar.gz file to get the source codes
# here we use the path on TEMPO as an example, please modify the path accordingly.
>> export OPAL_PREFIX=/home/timescale/comsoftware/openmpi-2.1.6-gcc6
# generate a Makefile
>> ./configure --prefix=/home/timescale/comsoftware/openmpi-2.1.6-gcc6 --with-devel-headers --enable-binaries
>> make -j 4 all
>> make install
HDF5-1.12.0
The HDF5 library has been installed on TEMPO. To use the library, please put the following paths into your ~/.bash_profile
and source
the file again:
# modify the bash_profile
>> vi ~/.bash_profile
-----------------------------------------------------------------------------------------
......
export PATH=/home/timescale/comsoftware/hdf5-1.12.0-gcc6/bin:$PATH
export LD_LIBRARY_PATH=/home/timescale/comsoftware/hdf5-1.12.0-gcc6/lib:\$LD_LIBRARY_PATH
......
-----------------------------------------------------------------------------------------
# reload the paths
>> source ~/.bash_profile
# to check if the paths work, use `which` to see if it refers to the paths.
>> which h5ls
If you consider to install your HDF5 library, you could go to the official website to download the source codes. Once you get the source codes, we would recommend you to generate the Makefile using the following configure options:
# Here we use the path on TEMPO as an example, please modify the path according to your demand. Note that these two options are required to install Quantum Espresso.
# If you would like to have a parallel HDF5 library, you can also turn on the related option.
>> ./configure --prefix=/home/timescale/comsoftware/hdf5-1.12.0-gcc10 --enable-fortran --enable-fortran2003
>> make -j 4
>> make install
BLAS and LAPACK-3.9.0
The BLAS and LAPACK libraries have been installed on TEMPO in the common directory /home/timescale/comsoftware/lapack-3.9.0-gcc6
using the GCC-6.5.0 compilers. To use the libraries, you can use the following methods to modify the makefiles that you are interested (see Quantum Espresso for an example).
If you consider to compile the libraries by yourself, please follow the commands below:
# obtain the source and uncompress it
>> wget <the-source-code>
>> cp make.inc.example make.inc
# modify the make.inc file
>> vi make.inc
-----------------------------------------------------------------------------------------
......
# change the optimization flag to -O3
......
-----------------------------------------------------------------------------------------
>> make
# then you will obtain the libraries
# for BLAS, it is called `librefblas.a`
# for LAPACK, it is called `liblapack.a`
SCALAPACK-2.1.0
The SCALAPACK library has been installed on TEMPO in the common directory /home/timescale/comsoftware/scalapack-2.1.0-gcc6
using the GCC-6.5.0 compilers. To use the library, you can use the following methods to modify the makefiles that you are interested (see Quantum Espresso for an example).
If you consider to compile the libraries by yourself, please follow the commands below:
>> wget <the-source-code>
>> cp SLmake.inc.example SLmake.inc
>> vi SLmake.inc
-----------------------------------------------------------------------------------------
......
# modify the optimization flags from -O0 to -O3
# modify the BLAS and LAPACK paths (here we use the path on TEMPO as an example)
BLASLIB = /home/timescale/comsoftware/lapack-3.9.0-gcc6/librefblas.a
LAPACKLIB = /home/timescale/comsoftware/lapack-3.9.0-gcc6/liblapack.a
......
-----------------------------------------------------------------------------------------
# do not use more than 1 process to compile the library; it will fail
>> make
FFTW3-3.3.9
The FFTW3 has been installed on TEMPO using the GCC compiler 6.5.0. To use the library, please include the installed directory /home/timescale/comsoftware/fftw-3.3.9-gcc6
into your makefiles (see an example in the Quantum Espresso installation section below).
If you consider installing the FFTW3 library by yourself, please follow the commands below:
# download the source codes
>> wget <the-source-code>
# if you don't want to use the parallel version, please get rid of the option `--enable-mpi`; here we use the path on TEMPO as an example
>> ./configure --prefix=/home/timescale/comsoftware/fftw-3.3.9-gcc6 --enable-mpi
>> make -j 4
>> make install
Quantum Espresso-6.5.0
The version of 6.5 of Quantum Espresso (QE) has been installed in the common directory /home/timescale/comsoftware/qe-6.5-gcc6
on TEMPO. The compiled software is for TEMPO users who don’t plan to modify any QE codes. In your research, if you are going to modify the source codes, we would recommend to compile QE by youself. The following commands are for compiling QE on TEMPO using the previous compiled libraries and compilers. Note that here we are going to manually input the paths for the BLAS/LAPACK, SCALAPACK, and FFTW3 libraries.
# get the source codes
>> wget <the-source-code>
or
>> git clone <the-QE-repository>
# change into the QE directory
>> cd <QE-directory>
# generate a makefile; here we provide the path of the HDF5 installed directory
>> ./configure --with-hdf5=/home/timescale/comsoftware/hdf5-1.12.0-gcc6
# modify the following variables in the file make.inc
>> vi make.inc
-----------------------------------------------------------------------------------------
......
# note that if your HDF5 library is compiled in parallel, there should be no -D__HDF5_SERIAL.
DFLAGS = -D__FFTW3 -D__MPI -D__HDF5_SERIAL -D__HDF5 -D__SCALAPACK
......
IFLAGS = -I$(TOPDIR)/include -I$(TOPDIR)/FoX/finclude -I$(TOPDIR)/S3DE/iotk/include/ -I/home/timescale/comsoftware/hdf5-1.12.0-gcc6/include -I/home/timescale/comsoftware/fftw-3.3.9-gcc6/include
......
BLAS_LIBS = /home/timescale/comsoftware/lapack-3.9.0-gcc6/librefblas.a
......
LAPACK_LIBS = /home/timescale/comsoftware/lapack-3.9.0-gcc6/liblapack.a
......
SCALAPACK_LIBS = /home/timescale/comsoftware/scalapack-2.1.0-gcc6/libscalapack.a
......
FFT_LIBS = /home/timescale/comsoftware/fftw-3.3.9-gcc6/lib/libfftw3.a
......
-----------------------------------------------------------------------------------------
# compile PWSCF, postprocessing, Phonon
>> make -j 4 pw pp ph
Wannier90-3.1.0
The W90 package has been installed in the common direcotry /home/timescale/comsoftware/qe-6.5-gcc6/wannier90
on TEMPO. If you would like to compile the W90 by yourself, please follow the commands below:
# make sure that your QE is already compiled.
>> cd <QE-direcotry>
# obtain the W90 source codes
>> wget <the-W90-source-code>
or
>> git clone <W90-repository>
# change into W90 directory
>> cd <W90-direcotry>
# get the make.inc file
>> cp ./config/make.inc.gfort ./make.inc
# modify the file make.inc
>> vi make.inc
-----------------------------------------------------------------------------------------
......
F90 = mpif90
......
COMMS = mpif90
MPIF90 = mpif90
......
# Here we use the path on TEMPO as an example
LIBDIR = /home/timescale/comsoftware/lapack-3.9.0-gcc6
LIBS = -L$(LIBDIR) -llapack -lrefblas
......
-----------------------------------------------------------------------------------------
>> make -j 4
To run W90, please refer to the tutorial of W90 (W90 tutorial).
YAMBO-4.5.3
YAMBO has been installed in the common directory /home/timescale/comsoftware/qe-6.5-gcc6/yambo
on TEMPO using the GCC compilers (6.5.0). If you consider installing YAMBO or modifying the source codes in YAMBO, please follow the commands below to install your YAMBO:
# change into the QE directory; make sure that your QE is compiled
>> cd <QE-directory>
# get the source code of YAMBO
>> wget <YAMBO-source-code>
or
>> git clone <YAMBO-repository>
# generate the makefile for YAMBO; here we use the library paths on TEMPO as an example.
>> ./configure --with-iotk-path=/home/timescale/comsoftware/qe-6.5-gcc6/iotk \
--with-hdf5-path=/home/timescale/comsoftware/hdf5-1.12.0-gcc6 \
--with-scalapack-libs=/home/timescale/comsoftware/scalapack-2.1.0-gcc6/libscalapack.a \
--with-blas-libs=/home/timescale/comsoftware/lapack-3.9.0-gcc6/librefblas.a \
--with-lapack-libs=/home/timescale/comsoftware/lapack-3.9.0-gcc6/liblapack.a \
--with-mpi-path=/home/timescale/comsoftware/openmpi-2.1.6-gcc6 \
--with-fft-path=/home/timescale/comsoftware/fftw-3.3.9-gcc6 \
--enable-hdf5-p2y-support=yes --enable-netcdf-hdf5=yes \
--enable-par-linalg=yes --enable-slepc-linalg --enable-dp \
--enable-keep-src --enable-msgs-comps --enable-time-profile \
--enable-memory-profile
>> make -j 4 yambo ypp p2y
To run YAMBO, please refer to the offical YAMBO website or wiki page.
PERTURBO
PERTURBO has been installed in the common directory /home/timescale/comsoftware/qe-6.5-gcc6/perturbo
on TEMPO. To compile PERTURBO by yourself, please follow the following commands:
# change into the QE diretory and make sure that your QE is compiled
>> cd <QE-directory>
# get the PETRUBO source codes
>> git clone <PERTURBO-repo>
# change into PERTURBO
>> cd perturbo
# modify the file make.sys
>> vi make.sys
------------------------------------------------------------------------------------------
......
# modify the paths for fortran compilers and HDF5 library
# here we use the GCC compiler and the paths on TEMPO as an example
FFLAGS += -fopenmp -x f95-cpp-input
LDFLAGS += -fopenmp
......
IFLAGS += -I/home/timescale/comsoftware/hdf5-1.12.0-gcc6/include
HDF5_LIB = -L/home/timescale/comsoftware/hdf5-1.12.0-gcc6/lib -lhdf5 -lhdf5_fortran
......
------------------------------------------------------------------------------------------
To run PERTURBO, please refer to the perturbo website.