Replace the unreliable ldd by ldconfig

to detect all library paths needed by the CP2K binary
- Pin ninja version after removing the package from the base image installation
- Update Rocky Linux version from 9.3 to 10 (latest)
- Remove CMake cleaning step, because it causes that CP2K is always recompiled from scratch which is a feature already covered by the --rebuild_cp2k flag on user request
- Move back from lscpu to nproc, because lscpu provides always a host view also within containers whereas nproc shows the container-visible CPUs (cgroup limits)
This commit is contained in:
Matthias Krack 2026-02-20 15:50:32 +01:00
parent 5dbd8b0fb1
commit fe07ba5a00
22 changed files with 150 additions and 72 deletions

View file

@ -144,8 +144,8 @@ HAS_PODMAN="no"
HELP="no"
INSTALL_MESSAGE="NEVER"
MPI_MODE="mpich"
if command -v lscpu &> /dev/null; then
MAX_PROCS="$(lscpu -p=Core,Socket | grep -v '#' | sort -u | wc -l)"
if command -v nproc &> /dev/null; then
MAX_PROCS=$(nproc)
NUM_PROCS=${NUM_PROCS:-${MAX_PROCS}}
else
MAX_PROCS=-1
@ -242,6 +242,8 @@ while [[ $# -gt 0 ]]; do
SED_PATTERN_LIST+=" -e '/\s*-\s+\"${2,,}@/ ${SUBST}"
;;
deepmd | libtorch)
CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_DEEPMD=${ON_OFF}"
CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_LIBTORCH=${ON_OFF}"
SED_PATTERN_LIST+=" -e '/\s*-\s+\"${2,,}kit@/ ${SUBST}"
SED_PATTERN_LIST+=" -e '/\s*-\s+\"py-torch@/ ${SUBST}"
;;
@ -264,6 +266,8 @@ while [[ $# -gt 0 ]]; do
SED_PATTERN_LIST+=" -e '/\s*-\s+\"mimic-mcl@/ ${SUBST}"
;;
openpmd | adios2)
CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_ADIOS2=${ON_OFF}"
CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_OPENPMD=${ON_OFF}"
SED_PATTERN_LIST+=" -e '/\s*-\s+\"adios2@/ ${SUBST}"
SED_PATTERN_LIST+=" -e '/\s*-\s+\"openpmd-api@/ ${SUBST}"
;;
@ -273,8 +277,8 @@ while [[ $# -gt 0 ]]; do
esac
;;
libvdwxc | spfft | spla | sirius)
echo "WARNING: You've enabled or disabled one of libvdwxc/spfft/spla/sirius, so"
echo " the rest packages of them will also be enabled or disabled!"
echo "WARNING: You have enabled or disabled one of the packages libvdwxc, spfft, spla, sirius"
echo " which means that the other packages will also be enabled or disabled"
CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_LIBVDWXC=${ON_OFF} -DCP2K_USE_SpFFT=${ON_OFF}"
CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_SPLA=${ON_OFF} -DCP2K_USE_SIRIUS=${ON_OFF}"
SED_PATTERN_LIST+=" -e '/\s*-\s+\"libvdwxc@/ ${SUBST}"
@ -775,14 +779,14 @@ if [[ ! -d "${SPACK_BUILD_PATH}" ]]; then
if [[ "${DISABLE_LOCAL_CACHE}" == "no" ]]; then
export SPACK_CACHE=${SPACK_CACHE:-"s3://spack-cache --s3-endpoint-url=http://localhost:9000"}
echo "SPACK_CACHE = \"${SPACK_CACHE}\""
fi
spack mirror list
if ! spack mirror list | grep -q "local-cache"; then
echo "Setting up local spack cache"
if ((VERBOSE > 0)); then
"${CP2K_ROOT}"/tools/docker/scripts/setup_spack_cache.sh
else
"${CP2K_ROOT}"/tools/docker/scripts/setup_spack_cache.sh &> /dev/null
spack mirror list
if ! spack mirror list | grep -q "local-cache"; then
echo "Setting up local spack cache"
if ((VERBOSE > 0)); then
"${CP2K_ROOT}"/tools/docker/scripts/setup_spack_cache.sh
else
"${CP2K_ROOT}"/tools/docker/scripts/setup_spack_cache.sh &> /dev/null
fi
fi
else
echo "INFO: A local Spack cache is NOT used"
@ -824,10 +828,12 @@ if [[ ! -d "${SPACK_BUILD_PATH}" ]]; then
fi
# Find all compilers
echo "Searching for GCC compilers"
if ! spack compiler find &> /dev/null; then
echo "ERROR: The compiler detection of spack failed"
${EXIT_CMD} 1
fi
spack compiler list
# Retrieve the newest compiler version found by spack
GCC_VERSION_NEWEST="$(spack compilers | awk '/gcc/ {print $2}' | sort -V | tail -n 1)"
@ -1133,10 +1139,6 @@ if ((EXIT_CODE != 0)); then
${EXIT_CMD} "${EXIT_CODE}"
fi
# Clean cached files in build directory after installation
echo -e '\n*** Cleaning cached files in build directory after installation ***\n'
cmake --build "${CMAKE_BUILD_PATH}" --target clean > /dev/null 2>&1
# Collect and compress all log files when building within a container
if [[ "${IN_CONTAINER}" == "yes" ]]; then
if ! cat "${CMAKE_BUILD_PATH}"/cmake.log \
@ -1151,43 +1153,51 @@ fi
# Cut extension from the CP2K version (e.g. ssmp-static -> ssmp)
export VERSION=${CP2K_VERSION%%-*}
# Add CP2K lib folder to library search path
LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}"
# Add CP2K lib folder to the LD_LIBRARY_PATH
export LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}"
# Retrieve paths to "hidden" libraries
echo -e "\nLD_LIBRARY_PATH = \"${LD_LIBRARY_PATH}\""
if ldd -- "${INSTALL_PREFIX}/bin/cp2k.${VERSION}" 2>&1 | grep -qE '\s=>\snot found'; then
echo -e "\n*** Some libraries referenced by the CP2K binary are NOT found:"
ldd -- "${INSTALL_PREFIX}/bin/cp2k.${VERSION}" 2>&1 | grep -E '\s=>\snot found' | sort | uniq
echo -e "\n*** Trying to update the LD_LIBRARY_PATH\n"
# Assemble all search paths for libraries
SEARCH_PATHS="${SPACK_ROOT}/opt/spack/view ${INSTALL_PREFIX}/lib"
# Search for missing libraries
for libname in $(ldd -- "${INSTALL_PREFIX}/bin/cp2k.${VERSION}" 2>&1 | grep -E '\s=>\snot found' | awk '{print $1}' | sort | uniq); do
# Assemble search paths for libraries
search_paths="${SPACK_ROOT}/opt/spack/view ${INSTALL_PREFIX}/lib"
# Retrieve paths to all libraries needed by the CP2k binary
for library in $(readelf -d "${INSTALL_PREFIX}/bin/cp2k.${VERSION}" | awk '/NEEDED/{print $5}' | tr -d '[]'); do
# Search for missing library path
if ! ldconfig -p | grep -qE "/${library}$"; then
# shellcheck disable=SC2086
library=$(find -L ${SEARCH_PATHS} -name "${libname}" | tail -n 1)
library_path="$(dirname "${library}")"
if [[ -n "${library_path}" ]]; then
library_with_path=$(find -L ${search_paths} -name "${library}" | tail -n 1)
if [[ -n "${library_with_path}" ]]; then
library_path="$(dirname "${library_with_path}")"
case ":${LD_LIBRARY_PATH}:" in
*":${library_path}:"*)
echo "The library path ${library_path} is already present ... skipping"
((VERBOSE > 1)) && echo "The library path ${library_path} is already present ... skipping"
;;
*)
LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${library_path}"
echo "The library path ${library_path} was appended to LD_LIBRARY_PATH"
((VERBOSE > 0)) && echo "The library path ${library_path} was appended to LD_LIBRARY_PATH"
;;
esac
fi
done
if ! ldd -- "${INSTALL_PREFIX}/bin/cp2k.${VERSION}" 2>&1 | grep -qE '\s=>\snot found'; then
echo -e "\n*** The update of the LD_LIBRARY_PATH was successful"
echo -e "\nLD_LIBRARY_PATH = \"${LD_LIBRARY_PATH}\""
else
echo -e "\n*** WARNING: The update of the LD_LIBRARY_PATH was NOT successful"
echo -e "\n*** The following libraries were NOT found:"
ldd -- "${INSTALL_PREFIX}/bin/cp2k.${VERSION}" 2>&1 | grep -E '\s=>\snot found' | sort | uniq
fi
done
export LD_LIBRARY_PATH
echo -e "\nLD_LIBRARY_PATH = \"${LD_LIBRARY_PATH}\""
# Create an ld configuration file for CP2K because LD_LIBRARY_PATH is fragile
if [[ "${IN_CONTAINER}" == "yes" ]]; then
CP2K_LD_CONF_FILE="/etc/ld.so.conf.d/cp2k.conf"
else
CP2K_LD_CONF_FILE="${INSTALL_PREFIX}/bin/cp2k.conf"
fi
# Either read LD_LIBRARY_PATH from an existing configuration file or write a new one
if [[ -f "${CP2K_LD_CONF_FILE}" ]]; then
# Load LD_LIBRARY_PATH from an existing configuration file
LD_LIBRARY_PATH="$(grep -E '^/' "${CP2K_LD_CONF_FILE}" | paste -sd ':' -)"
else
# Write LD_LIBRARY_PATH to a new configuration file
echo "${LD_LIBRARY_PATH}" | tr ':' '\n' | grep '^/' > "${CP2K_LD_CONF_FILE}"
fi
export LD_LIBRARY_PATH
# Create links to CP2K binaries
@ -1231,7 +1241,7 @@ ulimit -c 0 -s unlimited
export PATH=${INSTALL_PREFIX}/bin:${PATH}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
export OMP_NUM_THREADS=\${OMP_NUM_THREADS:-8}
export OMP_STACKSIZE=64M
export OMP_STACKSIZE=256M
${OMPI_VARS}
exec "\$@"
***
@ -1255,16 +1265,21 @@ if [[ "${RUN_TEST}" == "yes" ]]; then
fi
else
if [[ "${IN_CONTAINER}" == "yes" ]]; then
if ((CUDA_ARCH > 0)); then
DEVICE_FLAG=" --device nvidia.com/gpu=all"
else
DEVICE_FLAG=""
fi
echo ""
echo "*** A regression test run can be launched with"
echo " podman run -it --rm <IMAGE ID> run_tests"
echo " podman run -it${DEVICE_FLAG} --rm <IMAGE ID> run_tests"
echo ""
if [[ "${VERSION}" == "ssmp" ]]; then
echo "*** A CP2K run using 8 OpenMP threads (default) can be launched with"
echo " podman run -it --rm <IMAGE ID> cp2k ${CP2K_ROOT}/benchmarks/CI/H2O-32_md.inp"
echo " podman run -it${DEVICE_FLAG} --rm <IMAGE ID> cp2k ${CP2K_ROOT}/benchmarks/CI/H2O-32_md.inp"
else
echo "*** An MPI-parallel CP2K run using 2 OpenMP threads for each of the 4 MPI ranks can be launched with"
echo " podman run -it --rm <IMAGE ID> mpiexec -n 4 ${ENV_VAR_FLAG} OMP_NUM_THREADS=2 cp2k ${CP2K_ROOT}/benchmarks/CI/H2O-32_md.inp"
echo " podman run -it${DEVICE_FLAG} --rm <IMAGE ID> mpiexec -n 4 ${ENV_VAR_FLAG} OMP_NUM_THREADS=2 cp2k ${CP2K_ROOT}/benchmarks/CI/H2O-32_md.inp"
fi
echo ""
else

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests --mpiranks=4 --ompthreads=2

View file

@ -86,6 +86,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests --keepalive

View file

@ -63,6 +63,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -75,6 +75,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -63,6 +63,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -f ./Dockerfile.test_spack_psmp-rockylinux ../../
#
ARG BASE_IMAGE="rockylinux:9.3"
ARG BASE_IMAGE="docker.io/rockylinux/rockylinux:10"
###### Stage 1: Build CP2K ######
@ -18,9 +18,9 @@ RUN dnf -y install dnf-plugins-core && \
libtool \
openssl-devel \
patch \
python3.11 \
python3.11-devel \
python3.11-pip \
python3 \
python3-devel \
python3-pip \
unzip \
wget \
xz \
@ -28,8 +28,6 @@ RUN dnf -y install dnf-plugins-core && \
zlib-static \
&& dnf clean -q all
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
ARG SPACK_CACHE="s3://spack-cache --s3-endpoint-url=http://localhost:9000"
# Copy CP2K repository into container
@ -38,10 +36,10 @@ COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 11 -mpi mpich -ue -df libxsmm -ef openpmd
RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 14 -mpi mpich -ue -df libxsmm -ef openpmd
# Build and install CP2K
RUN ./make_cp2k.sh -cv psmp -gv 11 -gpu none -mpi mpich -df libxsmm -ef openpmd
RUN ./make_cp2k.sh -cv psmp -gv 14 -gpu none -mpi mpich -df libxsmm -ef openpmd
###### Stage 2: Install CP2K ######
@ -50,12 +48,10 @@ FROM "${BASE_IMAGE}" AS install_cp2k
RUN dnf -y install dnf-plugins-core && \
dnf --enablerepo=crb -qy install \
gcc gcc-c++ gcc-fortran \
python3.11 \
python3.11-pip \
python3 \
python3-pip \
&& dnf clean -q all
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
WORKDIR /opt/cp2k
# Install CP2K dependencies built with spack
@ -71,6 +67,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -86,6 +86,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests --keepalive

View file

@ -63,6 +63,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -72,6 +72,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests

View file

@ -121,8 +121,8 @@ def main() -> None:
install_cp2k_spack(
"psmp",
mpi_mode="mpich",
base_image="rockylinux:9.3",
gcc_version=11,
base_image="docker.io/rockylinux/rockylinux:10",
gcc_version=14,
feature_flags="-df libxsmm -ef openpmd",
)
)
@ -673,7 +673,6 @@ def install_cp2k_spack(
elif "opensuse/leap" in base_image:
gcc_compilers = f"gcc gcc{gcc_version} gcc-c++ gcc{gcc_version}-c++ gcc-fortran gcc{gcc_version}-fortran"
elif "rockylinux" in base_image:
# Rockylinux provides only GCC 11
gcc_compilers = f"gcc gcc-c++ gcc-fortran"
else:
gcc_compilers = f"g++ g++-{gcc_version} gcc gcc-{gcc_version} gfortran gfortran-{gcc_version}"
@ -727,6 +726,10 @@ COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
# Install CP2K/Quickstep CI benchmarks
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
# Do not rely only on LD_LIBRARY_PATH because it is fragile
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
RUN ldconfig
# Run CP2K regression test
RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests {testopts}
@ -810,17 +813,15 @@ RUN dnf -y install dnf-plugins-core && \
libtool \
openssl-devel \
patch \
python3.11 \
python3.11-devel \
python3.11-pip \
python3 \
python3-devel \
python3-pip \
unzip \
wget \
xz \
zlib-devel \
zlib-static \
&& dnf clean -q all
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
"""
elif "ubuntu" in base_image:
output += rf"""
@ -890,11 +891,9 @@ RUN ln -sf /usr/bin/python3.11 /usr/local/bin/python3 && \
RUN dnf -y install dnf-plugins-core && \
dnf --enablerepo=crb -qy install \
{gcc_compilers} \
python3.11 \
python3.11-pip \
python3 \
python3-pip \
&& dnf clean -q all
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
"""
elif "ubuntu" in base_image:
output += rf"""

View file

@ -168,7 +168,7 @@ spack:
- "gcc@10:"
- "gmake@4.2:"
- "mpich@4.3.2"
- "ninja@1.10:"
- "ninja@1.13"
# - "openmpi@5.0.9"
- "python@3.11:"
# CP2K

View file

@ -95,7 +95,7 @@ spack:
- "cmake@3.27:"
- "gcc@10:"
- "gmake@4.2:"
- "ninja@1.10:"
- "ninja@1.13"
- "python@3.11:"
# CP2K
- "dbcsr@2.9.1"

View file

@ -108,7 +108,7 @@ spack:
- "cmake@3.27:"
- "gcc@10:"
- "gmake@4.2:"
- "ninja@1.10:"
- "ninja@1.13"
- "python@3.11:"
# CP2K
- "dbcsr@2.9.1"