Docker: Migrate Intel tests to CMake

This commit is contained in:
Ole Schütt 2025-12-17 13:08:36 +01:00 committed by Ole Schütt
parent 9e35fc8c04
commit b99ca74f88
6 changed files with 79 additions and 65 deletions

View file

@ -118,6 +118,26 @@ elif [[ "${PROFILE}" == "toolchain" ]] && [[ "${VERSION}" == "ssmp" ]]; then
.. |& tee ./cmake.log
CMAKE_EXIT_CODE=$?
elif [[ "${PROFILE}" == "toolchain_intel" ]] && [[ "${VERSION}" == "psmp" ]]; then
cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \
-DCP2K_USE_EVERYTHING=OFF \
-DCP2K_USE_MPI=ON \
-Werror=dev \
.. |& tee ./cmake.log
CMAKE_EXIT_CODE=$?
elif [[ "${PROFILE}" == "toolchain_intel" ]] && [[ "${VERSION}" == "ssmp" ]]; then
cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \
-DCP2K_USE_EVERYTHING=OFF \
-DCP2K_USE_MPI=OFF \
-Werror=dev \
.. |& tee ./cmake.log
CMAKE_EXIT_CODE=$?
elif [[ "${PROFILE}" == "toolchain_arm64" ]] && [[ "${VERSION}" == "psmp" ]]; then
cmake \
-GNinja \

View file

@ -24,9 +24,8 @@ COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--install-all \
--with-dbcsr=no \
--mpi-mode=intelmpi \
--with-ifx=no \
--with-intelmpi \
--with-mkl \
--with-libsmeagol \
--with-libtorch=no \
@ -71,25 +70,25 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K using local.psmp.
# Install CP2K sources.
WORKDIR /opt/cp2k
COPY ./Makefile .
COPY ./src ./src
COPY ./exts ./exts
COPY ./tools/build_utils ./tools/build_utils
RUN /bin/bash -c " \
mkdir -p arch && \
ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/"
COPY ./data ./data
COPY ./tests ./tests
COPY ./tools/regtesting ./tools/regtesting
COPY ./tools/build_utils ./tools/build_utils
COPY ./cmake ./cmake
COPY ./CMakeLists.txt .
# Compile CP2K.
COPY ./tools/docker/scripts/build_cp2k_cmake.sh .
RUN ./build_cp2k_cmake.sh toolchain_intel psmp
# Run regression tests.
ARG TESTOPTS="--mpiexec mpiexec"
COPY ./tools/docker/scripts/test_regtest.sh ./
ARG TESTOPTS=""
COPY ./tools/docker/scripts/test_regtest_cmake.sh ./
RUN /bin/bash -o pipefail -c " \
TESTOPTS='${TESTOPTS}' \
./test_regtest.sh 'local' 'psmp' |& tee report.log && \
./test_regtest_cmake.sh toolchain_intel psmp |& tee report.log && \
rm -rf regtesting"
# Output the report if the image is old and was therefore pulled from the build cache.

View file

@ -24,9 +24,8 @@ COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--install-all \
--with-dbcsr=no \
--mpi-mode=no \
--with-ifx=no \
--with-intelmpi \
--with-mkl \
--with-libsmeagol \
--with-libtorch=no \
@ -71,25 +70,25 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K using local.ssmp.
# Install CP2K sources.
WORKDIR /opt/cp2k
COPY ./Makefile .
COPY ./src ./src
COPY ./exts ./exts
COPY ./tools/build_utils ./tools/build_utils
RUN /bin/bash -c " \
mkdir -p arch && \
ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/"
COPY ./data ./data
COPY ./tests ./tests
COPY ./tools/regtesting ./tools/regtesting
COPY ./tools/build_utils ./tools/build_utils
COPY ./cmake ./cmake
COPY ./CMakeLists.txt .
# Compile CP2K.
COPY ./tools/docker/scripts/build_cp2k_cmake.sh .
RUN ./build_cp2k_cmake.sh toolchain_intel ssmp
# Run regression tests.
ARG TESTOPTS="--mpiexec mpiexec"
COPY ./tools/docker/scripts/test_regtest.sh ./
ARG TESTOPTS=""
COPY ./tools/docker/scripts/test_regtest_cmake.sh ./
RUN /bin/bash -o pipefail -c " \
TESTOPTS='${TESTOPTS}' \
./test_regtest.sh 'local' 'ssmp' |& tee report.log && \
./test_regtest_cmake.sh toolchain_intel ssmp |& tee report.log && \
rm -rf regtesting"
# Output the report if the image is old and was therefore pulled from the build cache.

View file

@ -24,9 +24,8 @@ COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--install-all \
--with-dbcsr=no \
--mpi-mode=intelmpi \
--with-ifx=yes \
--with-intelmpi \
--with-mkl \
--with-libsmeagol \
--with-libtorch=no \
@ -71,25 +70,25 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K using local.psmp.
# Install CP2K sources.
WORKDIR /opt/cp2k
COPY ./Makefile .
COPY ./src ./src
COPY ./exts ./exts
COPY ./tools/build_utils ./tools/build_utils
RUN /bin/bash -c " \
mkdir -p arch && \
ln -vs /opt/cp2k-toolchain/install/arch/local.psmp ./arch/"
COPY ./data ./data
COPY ./tests ./tests
COPY ./tools/regtesting ./tools/regtesting
COPY ./tools/build_utils ./tools/build_utils
COPY ./cmake ./cmake
COPY ./CMakeLists.txt .
# Compile CP2K.
COPY ./tools/docker/scripts/build_cp2k_cmake.sh .
RUN ./build_cp2k_cmake.sh toolchain_intel psmp
# Run regression tests.
ARG TESTOPTS="--mpiexec mpiexec"
COPY ./tools/docker/scripts/test_regtest.sh ./
ARG TESTOPTS=""
COPY ./tools/docker/scripts/test_regtest_cmake.sh ./
RUN /bin/bash -o pipefail -c " \
TESTOPTS='${TESTOPTS}' \
./test_regtest.sh 'local' 'psmp' |& tee report.log && \
./test_regtest_cmake.sh toolchain_intel psmp |& tee report.log && \
rm -rf regtesting"
# Output the report if the image is old and was therefore pulled from the build cache.

View file

@ -24,9 +24,8 @@ COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--install-all \
--with-dbcsr=no \
--mpi-mode=no \
--with-ifx=yes \
--with-intelmpi \
--with-mkl \
--with-libsmeagol \
--with-libtorch=no \
@ -71,25 +70,25 @@ COPY ./tools/toolchain/scripts/arch_base.tmpl \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K using local.ssmp.
# Install CP2K sources.
WORKDIR /opt/cp2k
COPY ./Makefile .
COPY ./src ./src
COPY ./exts ./exts
COPY ./tools/build_utils ./tools/build_utils
RUN /bin/bash -c " \
mkdir -p arch && \
ln -vs /opt/cp2k-toolchain/install/arch/local.ssmp ./arch/"
COPY ./data ./data
COPY ./tests ./tests
COPY ./tools/regtesting ./tools/regtesting
COPY ./tools/build_utils ./tools/build_utils
COPY ./cmake ./cmake
COPY ./CMakeLists.txt .
# Compile CP2K.
COPY ./tools/docker/scripts/build_cp2k_cmake.sh .
RUN ./build_cp2k_cmake.sh toolchain_intel ssmp
# Run regression tests.
ARG TESTOPTS="--mpiexec mpiexec"
COPY ./tools/docker/scripts/test_regtest.sh ./
ARG TESTOPTS=""
COPY ./tools/docker/scripts/test_regtest_cmake.sh ./
RUN /bin/bash -o pipefail -c " \
TESTOPTS='${TESTOPTS}' \
./test_regtest.sh 'local' 'ssmp' |& tee report.log && \
./test_regtest_cmake.sh toolchain_intel ssmp |& tee report.log && \
rm -rf regtesting"
# Output the report if the image is old and was therefore pulled from the build cache.

View file

@ -37,15 +37,17 @@ def main() -> None:
f.write(install_deps_toolchain(base_image="fedora:41"))
f.write(regtest_cmake("toolchain", "psmp"))
for ver in "ssmp", "psmp":
with OutputFile(f"Dockerfile.test_intel-ifort-{ver}", args.check) as f:
for version in "ssmp", "psmp":
mpi_mode = "intelmpi" if version.startswith("p") else "no"
f.write(install_deps_toolchain(mpi_mode=mpi_mode))
with OutputFile(f"Dockerfile.test_intel-ifort-{version}", args.check) as f:
base_image = "intel/hpckit:2024.2.1-0-devel-ubuntu22.04"
f.write(install_deps_toolchain_intel(base_image=base_image, with_ifx="no"))
f.write(regtest(ver, intel=True, testopts="--mpiexec mpiexec"))
with OutputFile(f"Dockerfile.test_intel-ifx-{ver}", args.check) as f:
f.write(install_deps_toolchain_intel(base_image, mpi_mode, with_ifx="no"))
f.write(regtest_cmake("toolchain_intel", version))
with OutputFile(f"Dockerfile.test_intel-ifx-{version}", args.check) as f:
base_image = "intel/oneapi-hpckit:2025.2.2-0-devel-ubuntu24.04"
f.write(install_deps_toolchain_intel(base_image=base_image, with_ifx="yes"))
f.write(regtest(ver, intel=True, testopts="--mpiexec mpiexec"))
f.write(install_deps_toolchain_intel(base_image, mpi_mode, with_ifx="yes"))
f.write(regtest_cmake("toolchain_intel", version))
with OutputFile(f"Dockerfile.test_minimal", args.check) as f:
f.write(install_deps_ubuntu())
@ -481,19 +483,15 @@ RUN ln -sf /usr/bin/gcc-{gcc_version} /usr/local/bin/gcc && \
# ======================================================================================
def install_deps_toolchain_intel(
base_image: str = "intel/hpckit:2024.2.1-0-devel-ubuntu22.04",
with_ifx: str = "no",
) -> str:
def install_deps_toolchain_intel(base_image: str, mpi_mode: str, with_ifx: str) -> str:
return rf"""
FROM {base_image}
""" + install_toolchain(
base_image="ubuntu",
install_all="",
with_dbcsr="no",
mpi_mode=mpi_mode,
with_ifx=with_ifx,
with_intelmpi="",
with_mkl="",
with_libsmeagol="",
with_libtorch="no",