QUIP with LAMMPS

Added in version 2.5.

Changed in version 2.12: QUIP works through LAMMPS’s pair_style quip, and LAMMPS is loaded at runtime via dlopen. No eOn rebuild is needed: install a LAMMPS library built with the QUIP package.

In order, we require:

  • QUIP as a library (quippy is not required)

  • LAMMPS as a shared library, documented here

    • Without MPI

    • Linked to the same QUIP

The rest of the document walks through an example of this use-case.

Sample run

This needs to be in conjunction with the LAMMPS pair style quip.

Example build

Base environment

micromamba create -n quip_eon_lammps
micromamba activate quip_eon_lammps
micromamba install -c conda-forge eigen numpy ase PyYAML pytest sh pytest-datadir sphinx meson gh cmake subversion pkgconfig openblas
export PYTHONROOT=$CONDA_PREFIX

QUIP

git clone https://github.com/HaoZeke/quip-nix.git
cd quip-nix
git clone --recursive https://github.com/libAtoms/QUIP.git QUIP
cd QUIP/src
git clone --recursive https://github.com/mcaroba/turbogap.git
source ./../setEnvVars.sh
mkdir -p build/$QUIP_ARCH
mkdir -p "$QUIP_STRUCTS_DIR"
cp ../files/$QUIP_ARCH-Makefile.inc build/$QUIP_ARCH/Makefile.inc
export EXTRA_LINKOPTS="$(pkg-config --libs openblas)"
make -j1
make libquip
make install

We need to also keep track of the build system outputs as well (though it is also installed into the environment in theory by now).

cd build/linux_x86_64_gfortran/
export QUIP_LIB_DIR_BLD=$(pwd)

LAMMPS

We require serial LAMMPS, linked to our recently installed QUIP.

git clone https://github.com/lammps/lammps
cd lammps
mkdir build; cd build
# The QUIP_LIB_DIR_BLD is special, needs to be populated from the QUIP folder
cmake ../cmake -D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DDOWNLOAD_QUIP=no -DQUIP_LIBRARY=$QUIP_LIB_DIR_BLD/libquip.a -DBUILD_SHARED_LIBS=yes -D PKG_ML-QUIP=yes -D BUILD_MPI=no -D PKG_MANYBODY=yes
make -j$(nproc)
make install

If a different environment is in use, track the output paths as well.

cd build
export LMP_BLD_DIR=$(pwd)

eOn

From a clean tree:

gh repo clone theochemui/eon
cd eOn
meson setup bbdir --prefix=$CONDA_PREFIX --libdir=lib --buildtype=release
meson install -C bbdir
# LAMMPS is loaded at runtime -- liblammps.so must be on LD_LIBRARY_PATH

At this point both eonclient examples and eon (e.g. AKMC) examples will run.