Follow-up fixes for PR #4259

This commit is contained in:
Matthias Krack 2025-06-26 12:44:53 +02:00
parent 24ec50878a
commit 941a0607dd
4 changed files with 27 additions and 14 deletions

View file

@ -44,15 +44,27 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
ARG NUM_PROCS
ENV NUM_PROCS=${NUM_PROCS:-32}
# Install a recent Spack version
# Install Spack and Spack packages
WORKDIR /root/spack
ARG SPACK_VERSION
ENV SPACK_VERSION=${SPACK_VERSION:-develop-2025-05-18}
RUN git init --quiet && \
git remote add origin https://github.com/spack/spack.git && \
git fetch --quiet --depth 1 origin ${SPACK_VERSION} --no-tags && \
git checkout --quiet FETCH_HEAD
ENV PATH="/root/spack/bin:${PATH}"
ENV SPACK_VERSION=${SPACK_VERSION:-2e7168b4cfe9222a94becf0c2c5b401f513181ec}
ARG SPACK_PACKAGES_VERSION
ENV SPACK_PACKAGES_VERSION=${SPACK_PACKAGES_VERSION:-c63151a5baffcd96978966cd5ed83a6b8328e026}
ARG SPACK_REPO=https://github.com/spack/spack
ENV SPACK_ROOT=/opt/spack-${SPACK_VERSION}
ARG SPACK_PACKAGES_REPO=https://github.com/spack/spack-packages
ENV SPACK_PACKAGES_ROOT=/opt/spack-packages-${SPACK_PACKAGES_VERSION}
RUN mkdir -p ${SPACK_ROOT} \
&& wget -q ${SPACK_REPO}/archive/${SPACK_VERSION}.tar.gz \
&& tar -xzf ${SPACK_VERSION}.tar.gz -C /opt && rm -f ${SPACK_VERSION}.tar.gz \
&& mkdir -p ${SPACK_PACKAGES_ROOT} \
&& wget -q ${SPACK_PACKAGES_REPO}/archive/${SPACK_PACKAGES_VERSION}.tar.gz \
&& tar -xzf ${SPACK_PACKAGES_VERSION}.tar.gz -C /opt && rm -f ${SPACK_PACKAGES_VERSION}.tar.gz
ENV PATH="${SPACK_ROOT}/bin:${PATH}"
# Add Spack packages builtin repository
RUN spack repo add --scope site ${SPACK_PACKAGES_ROOT}/repos/spack_repo/builtin
# Find all compilers
RUN spack compiler find
@ -65,8 +77,9 @@ ARG CP2K_VERSION
ENV CP2K_VERSION=${CP2K_VERSION:-ssmp}
ARG CP2K_BUILD_TYPE
ENV CP2K_BUILD_TYPE=${CP2K_BUILD_TYPE:-minimal}
COPY ./tools/spack/repo.yaml ./tools/spack/cp2k_deps_${CP2K_BUILD_TYPE}_${CP2K_VERSION}.yaml ./
COPY ./tools/spack/packages ./packages
COPY ./tools/spack/cp2k_deps_${CP2K_BUILD_TYPE}_${CP2K_VERSION}.yaml ./
COPY ./tools/spack/cp2k_dev_repo ${SPACK_PACKAGES_ROOT}/repos/spack_repo/cp2k_dev_repo/
RUN spack repo add --scope site ${SPACK_PACKAGES_ROOT}/repos/spack_repo/cp2k_dev_repo/
# Sarus containers must be dynamically linked to an MPI implementation that is ABI-compatible
# with the MPI on the compute nodes at CSCS like MPICH@3
@ -78,7 +91,7 @@ RUN spack env create myenv cp2k_deps_${CP2K_BUILD_TYPE}_${CP2K_VERSION}.yaml &&
# Install CP2K dependencies via Spack
RUN spack -e myenv concretize -f
ENV SPACK_ENV_VIEW="/root/spack/var/spack/environments/myenv/spack-env/view"
ENV SPACK_ENV_VIEW="${SPACK_ROOT}/var/spack/environments/myenv/spack-env/view"
RUN spack -e myenv env depfile -o spack_makefile && \
make -j${NUM_PROCS} --file=spack_makefile SPACK_COLOR=never --output-sync=recurse && \
cp -ar ${SPACK_ENV_VIEW}/bin ${SPACK_ENV_VIEW}/include ${SPACK_ENV_VIEW}/lib /opt/spack

View file

@ -39,7 +39,7 @@ ENV NUM_PROCS=${NUM_PROCS:-32}
# Retrieve the maximum number log file lines printed on error
ARG LOG_LINES
ENV LOG_LINES=${LOG_LINES:-100}
ENV LOG_LINES=${LOG_LINES:-200}
ARG CP2K_VERSION
ENV CP2K_VERSION=${CP2K_VERSION:-psmp}

View file

@ -112,10 +112,10 @@ spack:
- "libvori@220621"
- "libxc@7.0.0"
# - "libxsmm@main-2024-09" Use 1.17 with Spack as long as grid unit tests fail
- "libxsmm@1.17"
# - "libxsmm@1.17"
- "pexsi@2.0.0"
- "plumed@2.9.2"
- "py-torch@2.6"
- "py-torch@2.7"
- "sirius@7.7.0"
- "spglib@2.5.0"
- "spla@1.6.1"

View file

@ -74,7 +74,7 @@ spack:
- "libvori@220621"
- "libxc@7.0.0"
# - "libxsmm@main-2024-09" Use 1.17 with Spack as long as grid unit tests fail
- "libxsmm@1.17"
# - "libxsmm@1.17"
- "py-torch@2.6"
- "spglib@2.5.0"
- "trexio@2.5.0"