Compiling gromacs-vanilla

To compile gromacs-vanilla and PLUMED the following bash script was used. gromacs-vanilla was statically linked with the vā€ + stable_version + ā€œ of PLUMED. In a separate build, the master version of PLUMED was linked to gromacs-vanilla as a runtime library.

Build with stable version download: zipped raw stdout and stderr

Build with master version download: zipped raw stdout and stderr

# Cloning the gromacs repository
# shellcheck disable=SC2154,2148
git clone --depth 1 https://gitlab.com/gromacs/gromacs.git --branch release-2026 --single-branch "gromacs$suffix"
# Checkout the correct version of gromacs
cd "gromacs$suffix" || {
   echo "Something failed with cloning gromacs into gromacs$suffix" >&2
   # we want to build the site regardless
   exit 0
}

# look mum, no patch!

prefix=$HOME/opt/gromacs-vanilla$suffix

# Run cmake
mkdir build
cd build || {
   echo "cannot cd to build" >&2
   # we want to build the site regardless
   exit 0
}

# with MPI, as the patched gromacs: the regression tests run on several ranks and simulations
# (with thread-MPI, the PLUMED module only works with one rank)
cmake .. -DGMX_USE_PLUMED=ON -DGMX_MPI=ON -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX="$prefix" -DGMX_ENABLE_CCACHE=ON  -Wno-dev
#I want plumed on
cmake . -DGMX_USE_PLUMED=ON

# Now make
cmake --build . -j11
cmake --install .

# plumedKernel is defined in the header that will be prepended to this by the CI
if [ -x "${prefix}/bin/gmx_mpi" ]; then
   # Write a script to execute gromacs calculations
   executible=$HOME/opt/bin/gromacs$exeSuffix
   cat <<EOF >"$executible"
#!/bin/bash
export PLUMED_KERNEL=$plumedKernel
mygmx=$prefix/bin/gmx_mpi
# with arguments, run gmx_mpi with them (the regression tests do this)
if [ \$# -gt 0 ]; then exec "\$mygmx" "\$@"; fi
"\$mygmx" grompp -p topol.top -c conf.gro -f md.mdp
"\$mygmx" mdrun -plumed plumed.dat
echo 5 | "\$mygmx" energy
EOF
   chmod u+x "$executible"
else
   echo "${prefix}/bin/gmx_mpi" have not been compiled or is not executable
fi