File: test_gromacs.sh

package info (click to toggle)
cp2k 2025.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 372,060 kB
  • sloc: fortran: 963,262; ansic: 64,495; f90: 21,676; python: 14,419; sh: 11,382; xml: 2,173; makefile: 996; pascal: 845; perl: 492; cpp: 345; lisp: 297; csh: 16
file content (70 lines) | stat: -rwxr-xr-x 1,870 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash -e

# author: Ole Schuett

# shellcheck disable=SC1091
source /opt/cp2k-toolchain/install/setup

# Compile and install CP2K.
./build_cp2k_cmake.sh "toolchain_all" "ssmp" || exit 0
cd build
ninja install &> install.log

echo -e "\n========== Installing Dependencies =========="
apt-get update -qq
apt-get install -qq --no-install-recommends git
rm -rf /var/lib/apt/lists/*

echo -e "\n========== Building Gromacs v2025.2 =========="
echo -n "Cloning Gromacs repository ... "
git clone --quiet --depth=1 --single-branch -b v2025.2 https://gitlab.com/gromacs/gromacs.git /opt/gromacs
echo "done"
cd /opt/gromacs/
GROMACS_REVISION=$(git rev-parse --short HEAD)
mkdir build
cd build

echo -n "Configuring Gromacs ... "
if cmake .. \
  -DGMX_BUILD_OWN_FFTW=ON \
  -DBUILD_SHARED_LIBS=OFF \
  -DGMX_INSTALL_NBLIB_API=OFF \
  -DGMXAPI=OFF \
  -DGMX_CP2K=ON \
  -DCP2K_DIR="/opt/cp2k/lib/" \
  &> gromacs_cmake.out; then
  echo "done"
else
  echo -e "failed.\n\n"
  tail -n 100 gromacs_cmake.out
  mkdir -p /workspace/artifacts/
  cp gromacs_cmake.out /workspace/artifacts/
  echo -e "\nSummary: Configuring Gromacs failed."
  echo -e "Status: FAILED\n"
  exit 0
fi

echo -n "Compiling Gromacs... "
if make -j 32 all qmmm_applied_forces-test &> gromacs_make.out; then
  echo -e "done.\n\n"
  ./bin/gmx --version
else
  echo -e "failed.\n\n"
  tail -n 100 gromacs_make.out
  mkdir -p /workspace/artifacts/
  cp gromacs_make.out /workspace/artifacts/
  echo -e "\nSummary: Compiling Gromacs failed."
  echo -e "Status: FAILED\n"
  exit 0
fi

echo -e "\n========== Running Gromacs QM/MM unit test =========="
if ./bin/qmmm_applied_forces-test; then
  echo -e "\nSummary: Gromacs commit ${GROMACS_REVISION} works fine."
  echo -e "Status: OK\n"
else
  echo -e "\nSummary: Something is wrong with Gromacs commit ${GROMACS_REVISION}."
  echo -e "Status: FAILED\n"
fi

#EOF