2018-11-08 13:56:15 +01:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
|
|
# author: Ole Schuett
|
|
|
|
|
|
2020-07-06 23:04:55 +02:00
|
|
|
cat > /usr/bin/cp2k_shell << EndOfMessage
|
|
|
|
|
#!/bin/bash -e
|
|
|
|
|
export OMP_NUM_THREADS=1
|
2025-02-02 10:26:37 +01:00
|
|
|
source /opt/cp2k-toolchain/install/setup
|
2025-02-17 14:08:34 +01:00
|
|
|
/opt/cp2k/build/bin/cp2k.ssmp --shell "\$@"
|
2020-07-06 23:04:55 +02:00
|
|
|
EndOfMessage
|
|
|
|
|
chmod +x /usr/bin/cp2k_shell
|
|
|
|
|
|
2019-05-24 22:15:38 +02:00
|
|
|
# The cp2k main binary is used by ase/test/cp2k/cp2k_dcd.py.
|
|
|
|
|
# https://gitlab.com/ase/ase/merge_requests/1109
|
|
|
|
|
cat > /usr/bin/cp2k << EndOfMessage
|
|
|
|
|
#!/bin/bash -e
|
2020-07-06 23:04:55 +02:00
|
|
|
export OMP_NUM_THREADS=1
|
2025-02-02 10:26:37 +01:00
|
|
|
source /opt/cp2k-toolchain/install/setup
|
2025-02-17 14:08:34 +01:00
|
|
|
/opt/cp2k/build/bin/cp2k.ssmp "\$@"
|
2019-05-24 22:15:38 +02:00
|
|
|
EndOfMessage
|
|
|
|
|
chmod +x /usr/bin/cp2k
|
2018-11-08 13:56:15 +01:00
|
|
|
|
2020-08-11 23:18:59 +02:00
|
|
|
mkdir -p ~/.config/ase
|
2024-02-19 17:00:04 +01:00
|
|
|
cat > ~/.config/ase/config.ini << EndOfMessage
|
|
|
|
|
[cp2k]
|
2024-02-19 17:21:00 +01:00
|
|
|
cp2k_shell = /usr/bin/cp2k_shell
|
2022-04-11 13:11:11 +02:00
|
|
|
cp2k_main = /usr/bin/cp2k
|
|
|
|
|
EndOfMessage
|
2020-07-06 23:04:55 +02:00
|
|
|
|
2022-02-19 14:35:21 +01:00
|
|
|
echo -e "\n========== Installing Dependencies =========="
|
|
|
|
|
apt-get update -qq
|
|
|
|
|
apt-get install -qq --no-install-recommends \
|
2024-05-06 23:25:26 +02:00
|
|
|
git \
|
2022-02-19 14:35:21 +01:00
|
|
|
python3 \
|
|
|
|
|
python3-dev \
|
2024-01-08 22:41:51 +01:00
|
|
|
python3-venv \
|
2022-02-19 14:35:21 +01:00
|
|
|
python3-pip \
|
|
|
|
|
python3-wheel \
|
|
|
|
|
python3-setuptools \
|
|
|
|
|
build-essential
|
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2024-01-08 22:41:51 +01:00
|
|
|
# Create and activate a virtual environment for Python packages.
|
|
|
|
|
python3 -m venv /opt/venv
|
|
|
|
|
export PATH="/opt/venv/bin:$PATH"
|
|
|
|
|
|
2018-11-08 13:56:15 +01:00
|
|
|
echo -e "\n========== Installing ASE =========="
|
2022-02-19 14:35:21 +01:00
|
|
|
git clone --quiet --depth=1 --single-branch -b master https://gitlab.com/ase/ase.git /opt/ase
|
2018-11-08 13:56:15 +01:00
|
|
|
cd /opt/ase/
|
2020-07-06 23:04:55 +02:00
|
|
|
pip3 install ".[test]"
|
2018-11-08 13:56:15 +01:00
|
|
|
|
|
|
|
|
echo -e "\n========== Running ASE Tests =========="
|
|
|
|
|
ASE_REVISION=$(git rev-parse --short HEAD)
|
2022-02-19 14:35:21 +01:00
|
|
|
echo -
|
2020-07-06 23:04:55 +02:00
|
|
|
|
2023-09-17 18:32:02 +02:00
|
|
|
# Make test temp files available as artifacts.
|
|
|
|
|
export PYTEST_DEBUG_TEMPROOT=/workspace/artifacts
|
|
|
|
|
mkdir -p ${PYTEST_DEBUG_TEMPROOT}
|
|
|
|
|
|
2021-02-17 17:02:43 +01:00
|
|
|
if ase test -j 0 -c cp2k calculator/cp2k; then
|
2022-02-19 14:35:21 +01:00
|
|
|
echo -e "\nSummary: ASE commit ${ASE_REVISION} works fine."
|
|
|
|
|
echo -e "Status: OK\n"
|
2020-07-06 23:04:55 +02:00
|
|
|
else
|
2022-02-19 14:35:21 +01:00
|
|
|
echo -e "\nSummary: Something is wrong with ASE commit ${ASE_REVISION}."
|
|
|
|
|
echo -e "Status: FAILED\n"
|
2018-11-08 13:56:15 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#EOF
|