Header Ads Widget

Ab initio Calculations Using QELK SUITE Package

Last Posts

10/recent/ticker-posts

How to download and install the QELK SUITE Package

 

This tutorial is inspired from the following posts:

https://elk-algerien1970.blogspot.com/2022/02/how-to-download-and-install-elk-code.html 

https://q-espresso-algerien1970.blogspot.com/2022/01/how-to-install-quantum-espresso.html 

 

QELK is a suite that joins Quantum ESPRESSO's pw.x (pseudopotential, plane-wave) and eLK (all-electron, full-potential LAPW) under one build, one input format, and a shared set of comparison tools -- both codes stay untouched upstream, QELK only unifies the install and the workflow around them.

 

I will build it with gfortran only, no MPI/GPU, which is the simplest way to get it running on a fresh Ubuntu machine.

 

First,  we need to add the path to the  ~/.bashrc  file

 

#---------QELK path----------------------------------
export QELKROOT=/home/abibitio/abinitio/QELK/bin
export PATH=$PATH:$QELKROOT
export PATH="$HOME/.local/bin:$PATH"
export TOOL=/home/abibitio/abinitio/QELK/tools
export PATH=$PATH:$TOOL

#-----------------------------------------------

 

Don't forget to reload it once it's saved

 

abibitio@linux-ml0a:~> source ~/.bashrc

 

Downloading:

You can download this package from the following link:

https://drive.google.com/file/d/108YBwyIMleMTLlIo9fLe4RdkIBntYrX9/view?usp=sharing 

Note:

Because of the updating of the package the link is updated 05/11/2026

 

Installing:

To install the QELK suite follow the following steps:

 

* Install the compiler and the libraries QELK needs (gfortran, BLAS, LAPACK, FFTW)

 

abibitio@linux-ml0a:~> sudo apt update
abibitio@linux-ml0a:~> sudo apt install gfortran gcc libblas-dev liblapack-dev libfftw3-dev

* Extracting the tar package  QELK.tar.gz

 

abibitio@linux-ml0a:~/abinitio> tar -xzf QELK.tar.gz

* Change to root directory

 

abibitio@linux-ml0a:~/abinitio> cd QELK

 

* Execute ./configure  -- this runs QE's own autoconf detection once, and Elk reuses that same compiler/BLAS/LAPACK/FFT choice instead of configuring itself separately  

 

abibitio@linux-ml0a:~/abinitio/QELK> ./configure    

 

checking build system type... x86_64-pc-linux-gnu
checking whether ranlib is needed... no
checking whether ... yes
checking for gfortran... gfortran
checking whether the Fortran compiler works... yes
checking for library containing dgemm... -lblas
checking for library containing zheev... -llapack
checking for fftw3 headers/libs... yes

configure: creating ./make.inc
configure: creating Elk/make.inc (via gen_make_inc.sh, same choice as pw.x)

configuration written, run 'make pw', 'make elk', 'make interfaces' or 'make all'


make.inc is now shared by QE and by Elk -- you only configure once for both codes

 
 

* Build everything with a single make all -- this builds pw.x and the rest of the QE packages, then elk with the same compiler/library choice, then installs the Interfaces layer (the qelk command itself) -- no need to build the pieces one at a time

 

abibitio@linux-ml0a:~/abinitio/QELK> make all

make[1]: Entering directory '/home/abibitio/abinitio/QELK/QE'
cd install && make -f extlibs_makefile all
gfortran -O3 -g -c fft_scalar.DFTI.f90
gfortran -O3 -g -c mp.f90
gfortran -O3 -g -c parallel_include.f90

.

.

.

gfortran -O3 -g -o pw.x pwscf.o libpw.a ../Modules/libqemod.a ../LAXlib/libqela.a ../UtilXlib/libutil.a ../FFTXlib/libqefft.a $(BLAS_LIBS) $(LAPACK_LIBS) $(FFT_LIBS)
cp pw.x ../../bin/
make[1]: Leaving directory '/home/abibitio/abinitio/QELK/QE'

make[1]: Entering directory '/home/abibitio/abinitio/QELK/Elk'
cd src; make; cp elk ../../bin
gfortran -O3 -ffast-math -funroll-loops -fopenmp -c r3frac.f90
gfortran -O3 -ffast-math -funroll-loops -fopenmp -c r3mv.f90

.

.

.

gfortran -O3 -ffast-math -funroll-loops -fopenmp -o elk main.o ... spacegroup/libspg.a
cp elk ../../bin/
make[1]: Leaving directory '/home/abibitio/abinitio/QELK/Elk'

Installing hybriddft (qelk, qelk compare) into bin/ ...
ln -sf ../Interfaces/hybriddft/qelk_cli.py bin/qelk
make[1]: Leaving directory '/home/abibitio/abinitio/QELK/Interfaces'

 

( if you get both bin/pw.x and bin/elk plus a bin/qelk link, the build has succeded )

 

* Install the plotting/comparison tools onto PATH (needs matplotlib)

 

abibitio@linux-ml0a:~/abinitio/QELK> pip install matplotlib
abibitio@linux-ml0a:~/abinitio/QELK> cd tools
abibitio@linux-ml0a:~/abinitio/QELK/tools> ./install_tools

Installing 20 tools into /home/abibitio/.local/bin ...
plot_dos.py, plot_elk_dos.py, plot_qe_pdos.py, overlay_bands.py, ...
Done. Make sure /home/abibitio/.local/bin is on your PATH.


( this is exactly the $HOME/.local/bin we already added to ~/.bashrc at the top of this post )


 

Testing the success of the installation:


We run one of the 28 bundled examples with --dry-run, which only writes the Elk/QE input files without spending any CPU time -- the fastest way to check qelk itself, and both codes' input writers, are wired up correctly

 

abibitio@linux-ml0a:~/abinitio/QELK> cd examples/Si_scf_qe
abibitio@linux-ml0a:~/abinitio/QELK/examples/Si_scf_qe> qelk Si_scf_qe.qelk --dry-run

[qelk] reading Si_scf_qe.qelk (version 1)
[qelk] step 'scf' (qe) -- from initial
[qelk] wrote run/01_scf/pw.in
[qelk] --dry-run: 1/1 step(s) written, nothing executed


The installation is ok


Drop the --dry-run flag and re-run the same command whenever you're ready to actually launch pw.x on this example. The next posts on this blog will walk through the .qelk file format itself, the graphical qelkinput_creator_gui.py builder, and the Elk-vs-QE comparison tools.

 

 

Uninstalling:

 

If you want to remove everything the build produced (all the compiled QE and Elk objects/executables, and bin/) and start over, run make clean from the QELK root -- it cleans QE, Elk and Interfaces in one go

 

abibitio@linux-ml0a:~/abinitio/QELK> make clean

if test -f QE/make.inc ; then ( cd QE ; make clean ) ; fi
if test -f Elk/make.inc ; then ( cd Elk ; make clean ) ; fi
( cd Interfaces ; make clean )
rm -f bin/*

 

This leaves make.inc in place, so make all alone rebuilds everything again without re-running ./configure. If you want a completely fresh slate -- including forgetting the compiler/library choice ./configure detected -- run make distclean instead, then ./configure again before the next make all

 

To remove the suite entirely, just delete the QELK/ folder itself, and remove the QELKROOT/TOOL block we added to ~/.bashrc at the top of this post

 

Post a Comment

0 Comments