technical:recipes:quantum-espresso

This is an old revision of the document!


Building Quantum Espresso on Caviness/DARWIN

The build procedure outlined herein uses Open MPI on top of the Intel compiler suite.

To begin, choose a directory in which the Quantum Espresso version(s) will be built and installed. To build in your home directory, for example:

[user@login00.darwin ~]$ QE_BASEDIR=~/sw/quantum-espresso
[user@login00.darwin ~]$ QE_BASEDIR_PRIVS=0700

If you are managing Quantum Espresso software for your entire workgroup, you could instead use

[user@login00.darwin ~]$ QE_BASEDIR="${WORKDIR}/sw/quantum-espresso"
[user@login00.darwin ~]$ QE_BASEDIR_PRIVS=2770

If the directory hierarchy does not yet exist, it can be setup using

[user@login00.darwin ~]$ mkdir -p -m $QE_BASEDIR_PRIVS "${QE_BASEDIR}"

In this example version 7.3 of quantum-espresso will be built. Our standard recipes for quantum-espresso will entail use of the Intel compilers, the MKL for BLAS/LAPACK/FFTW/ScaLAPACK/BLACS, and Open MPI for parallelism.

We will create a directory to hold our base build of quantum-espresso 7.3, naming it with the version identifier: qe-7.3. The source is then unpacked therein:

[user@login00.darwin ~]$ QE_SRC_PREFIX="${QE_BASEDIR}/qe-7.3"
[user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS "$QE_SRC_PREFIX"
[user@login00.darwin ~]$ cd "$QE_SRC_PREFIX"
[user@login00.darwin qe-7.3]$ tar -xf "${QE_BASEDIR}/qe-7.3-ReleasePack.tar.gz"

We use cmake for compilation and installation on "v7.3" directory.

[user@login00.darwin ~]$ QE_INSTALL_PREFIX="${QE_BASEDIR}/v7.3"
[user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS "$QE_INSTALL_PREFIX"
[user@login00.darwin ~]$ QE_BUILDDIR="${QE_SRC_PREFIX}/build"
[user@login00.darwin ~]$ mkdir -m $QE_BASEDIR_PRIVS "$QE_BUILDDIR"
[user@login00.darwin ~]$ cd "$QE_BUILDDIR"

Our current working directory is now the build root. Here, we create build.sh :

build.sh.darwin
#!/bin/bash -l
 
vpkg_require cmake/3.28.3 openmpi/4.1.4:intel-oneapi-2023 git
 
PREFIX="${QE_INSTALL_PREFIX}"
 
cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx \
-DCMAKE_Fortran_COMPILER=mpifort \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_C_FLAGS="-msse3 -axsse3,sse4.2,AVX,core-AVX2,CORE-AVX512" \
-DCMAKE_Fortran_FLAGS="-msse3 -axsse3,sse4.2,AVX,core-AVX2,CORE-AVX512" \
-DQE_ENABLE_OPENMP=ON -DCMAKE_BUILD_TYPE:STRING=RELWITHDEBINFO ../
 
make -j 20
make install

Executing the script compile and install quantum-expresso 7.3.

[user@login00.darwin build]$ ./build.sh

With this version of VASP built, the remaining step is to leverage VALET for setup of the runtime environment when you use the software. VALET automatically recognizes the standard directory layout, so configuring versions/variants of vasp is very straightforward. First, note your installation path:

[user@login00.darwin src]$ vpkg_rollback all
[user@login00.darwin src]$ cd
[user@login00.darwin ~]$ echo $VASP_BASEDIR
/home/user/sw/vasp

Since this build was done in the user's home directory, they were personal copies of the software and should use a VALET package definition file stored in ~/.valet

[user@login00.darwin ~]$ VALET_PKG_DIR=~/.valet ; VALET_PKG_DIR_MODE=0700

versus an installation made for an entire workgroup, which would store the VALET package definition files in $WORKDIR/sw/valet

[user@login00.darwin ~]$ VALET_PKG_DIR="$WORKDIR/sw/valet" ; VALET_PKG_DIR_MODE=2770

Whichever scheme is in-use, ensure the directory exists:

[user@login00.darwin ~]$ mkdir -p --mode=$VALET_PKG_DIR_MODE "$VALET_PKG_DIR"

VALET allows package definitions in a variety of formats (XML, JSON, YAML) but YAML tends to be the simplest format so we will use it here.

  • technical/recipes/quantum-espresso.1715352510.txt.gz
  • Last modified: 2024-05-10 10:48
  • by bkang