Docker: Remove duplicate install_dbcsr.sh script

This commit is contained in:
Ole Schütt 2025-12-02 16:14:49 +01:00 committed by Ole Schütt
parent ccabb9a0f8
commit 421338ca7d
11 changed files with 555 additions and 155 deletions

View file

@ -27,6 +27,10 @@ if [[ "${PROFILE}" =~ ^spack ]]; then
elif [[ "${PROFILE}" =~ ^toolchain ]]; then
# shellcheck disable=SC1091
source "${TOOLCHAIN_DIR}/install/setup"
elif [[ "${PROFILE}" =~ ^ubuntu ]] || [[ "${PROFILE}" =~ ^minimal ]]; then
# Toolchain is only used to install DBCSR (and sometimes CMake).
# shellcheck disable=SC1091
source "${TOOLCHAIN_DIR}/install/setup"
fi
# Run CMake
@ -214,6 +218,7 @@ elif [[ "${PROFILE}" == "toolchain_asan" ]] && [[ "${VERSION}" == "psmp" ]]; the
CMAKE_EXIT_CODE=$?
elif [[ "${PROFILE}" == "ubuntu" ]] && [[ "${VERSION}" == "ssmp" ]]; then
# TODO Enable libxsmm and libspglib once we dropped GCC 8.
# TODO fix spglib https://github.com/cp2k/cp2k/issues/3414
# NOTE: libxc 5.2.3 is provided, CP2K requires libxc 7
cmake \
@ -233,6 +238,7 @@ elif [[ "${PROFILE}" == "ubuntu" ]] && [[ "${VERSION}" == "ssmp" ]]; then
-DCP2K_USE_SPGLIB=OFF \
-DCP2K_USE_VORI=OFF \
-DCP2K_USE_TREXIO=OFF \
-DCP2K_USE_LIBXSMM=OFF \
-Werror=dev \
.. |& tee ./cmake.log
CMAKE_EXIT_CODE=$?

View file

@ -33,9 +33,77 @@ RUN ln -sf /usr/bin/gcc-10 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-10 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-10 /usr/local/bin/gfortran
# Install DBCSR
COPY ./tools/docker/scripts/install_dbcsr.sh ./
RUN ./install_dbcsr.sh ssmp
# Use toolchain to install DBCSR.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu:24.04
# Install the toolchain.
RUN mkdir scripts
COPY ./tools/toolchain/scripts/VERSION \
./tools/toolchain/scripts/parse_if.py \
./tools/toolchain/scripts/tool_kit.sh \
./tools/toolchain/scripts/common_vars.sh \
./tools/toolchain/scripts/signal_trap.sh \
./tools/toolchain/scripts/get_openblas_arch.sh \
./scripts/
COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# TODO: Re-enable tblite once the dftd4 installation is fixed.
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-ninja=system \
--with-openblas=system \
--with-libxc=no \
--with-libint=no \
--with-libgrpp=no \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--with-tblite=no \
--dry-run
# Dry-run leaves behind config files for the followup install scripts.
# This breaks up the lengthy installation into smaller build steps.
COPY ./tools/toolchain/scripts/stage0/ ./scripts/stage0/
RUN ./scripts/stage0/install_stage0.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage1/ ./scripts/stage1/
RUN ./scripts/stage1/install_stage1.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage2/ ./scripts/stage2/
RUN ./scripts/stage2/install_stage2.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage3/ ./scripts/stage3/
RUN ./scripts/stage3/install_stage3.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage4/ ./scripts/stage4/
RUN ./scripts/stage4/install_stage4.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage5/ ./scripts/stage5/
RUN ./scripts/stage5/install_stage5.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage6/ ./scripts/stage6/
RUN ./scripts/stage6/install_stage6.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage7/ ./scripts/stage7/
RUN ./scripts/stage7/install_stage7.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage8/ ./scripts/stage8/
RUN ./scripts/stage8/install_stage8.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage9/ ./scripts/stage9/
RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/arch_base.tmpl \
./tools/toolchain/scripts/generate_arch_files.sh \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K sources.
WORKDIR /opt/cp2k

View file

@ -33,9 +33,77 @@ RUN ln -sf /usr/bin/gcc-11 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-11 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-11 /usr/local/bin/gfortran
# Install DBCSR
COPY ./tools/docker/scripts/install_dbcsr.sh ./
RUN ./install_dbcsr.sh ssmp
# Use toolchain to install DBCSR.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu:24.04
# Install the toolchain.
RUN mkdir scripts
COPY ./tools/toolchain/scripts/VERSION \
./tools/toolchain/scripts/parse_if.py \
./tools/toolchain/scripts/tool_kit.sh \
./tools/toolchain/scripts/common_vars.sh \
./tools/toolchain/scripts/signal_trap.sh \
./tools/toolchain/scripts/get_openblas_arch.sh \
./scripts/
COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# TODO: Re-enable tblite once the dftd4 installation is fixed.
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-ninja=system \
--with-openblas=system \
--with-libxc=no \
--with-libint=no \
--with-libgrpp=no \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--with-tblite=no \
--dry-run
# Dry-run leaves behind config files for the followup install scripts.
# This breaks up the lengthy installation into smaller build steps.
COPY ./tools/toolchain/scripts/stage0/ ./scripts/stage0/
RUN ./scripts/stage0/install_stage0.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage1/ ./scripts/stage1/
RUN ./scripts/stage1/install_stage1.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage2/ ./scripts/stage2/
RUN ./scripts/stage2/install_stage2.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage3/ ./scripts/stage3/
RUN ./scripts/stage3/install_stage3.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage4/ ./scripts/stage4/
RUN ./scripts/stage4/install_stage4.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage5/ ./scripts/stage5/
RUN ./scripts/stage5/install_stage5.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage6/ ./scripts/stage6/
RUN ./scripts/stage6/install_stage6.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage7/ ./scripts/stage7/
RUN ./scripts/stage7/install_stage7.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage8/ ./scripts/stage8/
RUN ./scripts/stage8/install_stage8.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage9/ ./scripts/stage9/
RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/arch_base.tmpl \
./tools/toolchain/scripts/generate_arch_files.sh \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K sources.
WORKDIR /opt/cp2k

View file

@ -33,9 +33,77 @@ RUN ln -sf /usr/bin/gcc-12 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-12 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-12 /usr/local/bin/gfortran
# Install DBCSR
COPY ./tools/docker/scripts/install_dbcsr.sh ./
RUN ./install_dbcsr.sh ssmp
# Use toolchain to install DBCSR.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu:24.04
# Install the toolchain.
RUN mkdir scripts
COPY ./tools/toolchain/scripts/VERSION \
./tools/toolchain/scripts/parse_if.py \
./tools/toolchain/scripts/tool_kit.sh \
./tools/toolchain/scripts/common_vars.sh \
./tools/toolchain/scripts/signal_trap.sh \
./tools/toolchain/scripts/get_openblas_arch.sh \
./scripts/
COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# TODO: Re-enable tblite once the dftd4 installation is fixed.
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-ninja=system \
--with-openblas=system \
--with-libxc=no \
--with-libint=no \
--with-libgrpp=no \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--with-tblite=no \
--dry-run
# Dry-run leaves behind config files for the followup install scripts.
# This breaks up the lengthy installation into smaller build steps.
COPY ./tools/toolchain/scripts/stage0/ ./scripts/stage0/
RUN ./scripts/stage0/install_stage0.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage1/ ./scripts/stage1/
RUN ./scripts/stage1/install_stage1.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage2/ ./scripts/stage2/
RUN ./scripts/stage2/install_stage2.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage3/ ./scripts/stage3/
RUN ./scripts/stage3/install_stage3.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage4/ ./scripts/stage4/
RUN ./scripts/stage4/install_stage4.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage5/ ./scripts/stage5/
RUN ./scripts/stage5/install_stage5.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage6/ ./scripts/stage6/
RUN ./scripts/stage6/install_stage6.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage7/ ./scripts/stage7/
RUN ./scripts/stage7/install_stage7.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage8/ ./scripts/stage8/
RUN ./scripts/stage8/install_stage8.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage9/ ./scripts/stage9/
RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/arch_base.tmpl \
./tools/toolchain/scripts/generate_arch_files.sh \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K sources.
WORKDIR /opt/cp2k

View file

@ -33,9 +33,77 @@ RUN ln -sf /usr/bin/gcc-13 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-13 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-13 /usr/local/bin/gfortran
# Install DBCSR
COPY ./tools/docker/scripts/install_dbcsr.sh ./
RUN ./install_dbcsr.sh ssmp
# Use toolchain to install DBCSR.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu:24.04
# Install the toolchain.
RUN mkdir scripts
COPY ./tools/toolchain/scripts/VERSION \
./tools/toolchain/scripts/parse_if.py \
./tools/toolchain/scripts/tool_kit.sh \
./tools/toolchain/scripts/common_vars.sh \
./tools/toolchain/scripts/signal_trap.sh \
./tools/toolchain/scripts/get_openblas_arch.sh \
./scripts/
COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# TODO: Re-enable tblite once the dftd4 installation is fixed.
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-ninja=system \
--with-openblas=system \
--with-libxc=no \
--with-libint=no \
--with-libgrpp=no \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--with-tblite=no \
--dry-run
# Dry-run leaves behind config files for the followup install scripts.
# This breaks up the lengthy installation into smaller build steps.
COPY ./tools/toolchain/scripts/stage0/ ./scripts/stage0/
RUN ./scripts/stage0/install_stage0.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage1/ ./scripts/stage1/
RUN ./scripts/stage1/install_stage1.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage2/ ./scripts/stage2/
RUN ./scripts/stage2/install_stage2.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage3/ ./scripts/stage3/
RUN ./scripts/stage3/install_stage3.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage4/ ./scripts/stage4/
RUN ./scripts/stage4/install_stage4.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage5/ ./scripts/stage5/
RUN ./scripts/stage5/install_stage5.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage6/ ./scripts/stage6/
RUN ./scripts/stage6/install_stage6.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage7/ ./scripts/stage7/
RUN ./scripts/stage7/install_stage7.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage8/ ./scripts/stage8/
RUN ./scripts/stage8/install_stage8.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage9/ ./scripts/stage9/
RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/arch_base.tmpl \
./tools/toolchain/scripts/generate_arch_files.sh \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K sources.
WORKDIR /opt/cp2k

View file

@ -37,9 +37,77 @@ RUN ln -sf /usr/bin/gcc-14 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-14 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-14 /usr/local/bin/gfortran
# Install DBCSR
COPY ./tools/docker/scripts/install_dbcsr.sh ./
RUN ./install_dbcsr.sh ssmp
# Use toolchain to install DBCSR.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu:24.04
# Install the toolchain.
RUN mkdir scripts
COPY ./tools/toolchain/scripts/VERSION \
./tools/toolchain/scripts/parse_if.py \
./tools/toolchain/scripts/tool_kit.sh \
./tools/toolchain/scripts/common_vars.sh \
./tools/toolchain/scripts/signal_trap.sh \
./tools/toolchain/scripts/get_openblas_arch.sh \
./scripts/
COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# TODO: Re-enable tblite once the dftd4 installation is fixed.
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-ninja=system \
--with-openblas=system \
--with-libxc=no \
--with-libint=no \
--with-libgrpp=no \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--with-tblite=no \
--dry-run
# Dry-run leaves behind config files for the followup install scripts.
# This breaks up the lengthy installation into smaller build steps.
COPY ./tools/toolchain/scripts/stage0/ ./scripts/stage0/
RUN ./scripts/stage0/install_stage0.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage1/ ./scripts/stage1/
RUN ./scripts/stage1/install_stage1.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage2/ ./scripts/stage2/
RUN ./scripts/stage2/install_stage2.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage3/ ./scripts/stage3/
RUN ./scripts/stage3/install_stage3.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage4/ ./scripts/stage4/
RUN ./scripts/stage4/install_stage4.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage5/ ./scripts/stage5/
RUN ./scripts/stage5/install_stage5.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage6/ ./scripts/stage6/
RUN ./scripts/stage6/install_stage6.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage7/ ./scripts/stage7/
RUN ./scripts/stage7/install_stage7.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage8/ ./scripts/stage8/
RUN ./scripts/stage8/install_stage8.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage9/ ./scripts/stage9/
RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/arch_base.tmpl \
./tools/toolchain/scripts/generate_arch_files.sh \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K sources.
WORKDIR /opt/cp2k

View file

@ -9,13 +9,23 @@ FROM ubuntu:20.04
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
apt-get update -qq && apt-get install -qq --no-install-recommends \
cmake \
less \
nano \
make \
ninja-build \
wget \
python3 \
ca-certificates \
gcc-8 \
g++-8 \
gfortran-8 \
libfftw3-dev \
libopenblas-dev \
libgsl-dev \
libint2-dev \
libxc-dev \
libhdf5-dev \
\
\
&& rm -rf /var/lib/apt/lists/*
# Create links in /usr/local/bin to overrule links in /usr/bin.
@ -23,10 +33,11 @@ RUN ln -sf /usr/bin/gcc-8 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-8 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-8 /usr/local/bin/gfortran
# Use toolchain to install DBCSR and CMake.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu
RUN ./install_requirements.sh ubuntu:20.04
# Install the toolchain.
RUN mkdir scripts
@ -42,19 +53,18 @@ COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-dbcsr=no \
--with-fftw=system \
--with-cmake \
--with-ninja=system \
--with-openblas=system \
--with-gsl=system \
--with-hdf5=system \
--with-libxc=no \
--with-libint=no \
--with-libgrpp=no \
--with-libint=install \
--with-libxc=install \
--with-libxsmm=install \
--with-libvori=install \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--with-tblite=no \
--dry-run
@ -95,25 +105,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 ubuntu ssmp
# Run regression tests.
ARG TESTOPTS="--skipdir=QS/regtest-rs-dhft"
COPY ./tools/docker/scripts/test_regtest.sh ./
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 ubuntu 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

@ -33,9 +33,77 @@ RUN ln -sf /usr/bin/gcc-9 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-9 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-9 /usr/local/bin/gfortran
# Install DBCSR
COPY ./tools/docker/scripts/install_dbcsr.sh ./
RUN ./install_dbcsr.sh ssmp
# Use toolchain to install DBCSR.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu:24.04
# Install the toolchain.
RUN mkdir scripts
COPY ./tools/toolchain/scripts/VERSION \
./tools/toolchain/scripts/parse_if.py \
./tools/toolchain/scripts/tool_kit.sh \
./tools/toolchain/scripts/common_vars.sh \
./tools/toolchain/scripts/signal_trap.sh \
./tools/toolchain/scripts/get_openblas_arch.sh \
./scripts/
COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# TODO: Re-enable tblite once the dftd4 installation is fixed.
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-ninja=system \
--with-openblas=system \
--with-libxc=no \
--with-libint=no \
--with-libgrpp=no \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--with-tblite=no \
--dry-run
# Dry-run leaves behind config files for the followup install scripts.
# This breaks up the lengthy installation into smaller build steps.
COPY ./tools/toolchain/scripts/stage0/ ./scripts/stage0/
RUN ./scripts/stage0/install_stage0.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage1/ ./scripts/stage1/
RUN ./scripts/stage1/install_stage1.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage2/ ./scripts/stage2/
RUN ./scripts/stage2/install_stage2.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage3/ ./scripts/stage3/
RUN ./scripts/stage3/install_stage3.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage4/ ./scripts/stage4/
RUN ./scripts/stage4/install_stage4.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage5/ ./scripts/stage5/
RUN ./scripts/stage5/install_stage5.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage6/ ./scripts/stage6/
RUN ./scripts/stage6/install_stage6.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage7/ ./scripts/stage7/
RUN ./scripts/stage7/install_stage7.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage8/ ./scripts/stage8/
RUN ./scripts/stage8/install_stage8.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage9/ ./scripts/stage9/
RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/arch_base.tmpl \
./tools/toolchain/scripts/generate_arch_files.sh \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K sources.
WORKDIR /opt/cp2k

View file

@ -33,9 +33,77 @@ RUN ln -sf /usr/bin/gcc-13 /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-13 /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-13 /usr/local/bin/gfortran
# Install DBCSR
COPY ./tools/docker/scripts/install_dbcsr.sh ./
RUN ./install_dbcsr.sh ssmp
# Use toolchain to install DBCSR.
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
RUN ./install_requirements.sh ubuntu:24.04
# Install the toolchain.
RUN mkdir scripts
COPY ./tools/toolchain/scripts/VERSION \
./tools/toolchain/scripts/parse_if.py \
./tools/toolchain/scripts/tool_kit.sh \
./tools/toolchain/scripts/common_vars.sh \
./tools/toolchain/scripts/signal_trap.sh \
./tools/toolchain/scripts/get_openblas_arch.sh \
./scripts/
COPY ./tools/toolchain/install_cp2k_toolchain.sh .
# TODO: Re-enable tblite once the dftd4 installation is fixed.
# https://github.com/cp2k/cp2k/issues/4362
RUN ./install_cp2k_toolchain.sh \
--mpi-mode=no \
--with-dbcsr \
--with-gcc=system \
--with-cmake=system \
--with-ninja=system \
--with-openblas=system \
--with-libxc=no \
--with-libint=no \
--with-libgrpp=no \
--with-fftw=no \
--with-libxsmm=no \
--with-spglib=no \
--with-libvori=no \
--with-tblite=no \
--dry-run
# Dry-run leaves behind config files for the followup install scripts.
# This breaks up the lengthy installation into smaller build steps.
COPY ./tools/toolchain/scripts/stage0/ ./scripts/stage0/
RUN ./scripts/stage0/install_stage0.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage1/ ./scripts/stage1/
RUN ./scripts/stage1/install_stage1.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage2/ ./scripts/stage2/
RUN ./scripts/stage2/install_stage2.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage3/ ./scripts/stage3/
RUN ./scripts/stage3/install_stage3.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage4/ ./scripts/stage4/
RUN ./scripts/stage4/install_stage4.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage5/ ./scripts/stage5/
RUN ./scripts/stage5/install_stage5.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage6/ ./scripts/stage6/
RUN ./scripts/stage6/install_stage6.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage7/ ./scripts/stage7/
RUN ./scripts/stage7/install_stage7.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage8/ ./scripts/stage8/
RUN ./scripts/stage8/install_stage8.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/stage9/ ./scripts/stage9/
RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
COPY ./tools/toolchain/scripts/arch_base.tmpl \
./tools/toolchain/scripts/generate_arch_files.sh \
./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build
# Install CP2K sources.
WORKDIR /opt/cp2k

View file

@ -60,14 +60,10 @@ def main() -> None:
for gcc_version in 8, 9, 10, 11, 12, 13, 14:
with OutputFile(f"Dockerfile.test_gcc{gcc_version}", args.check) as f:
if gcc_version > 8:
f.write(install_deps_ubuntu(gcc_version=gcc_version))
f.write(regtest_cmake("ubuntu", "ssmp"))
else:
f.write(install_deps_ubuntu2004(gcc_version=gcc_version))
# Have to use Makefile because Ubuntu:20.04 ships with CMake 3.16.3.
# Skip some tests due to bug in LDA_C_PMGB06 functional in libxc <5.2.0.
f.write(regtest("ssmp", testopts="--skipdir=QS/regtest-rs-dhft"))
# Skip some tests due to bug in LDA_C_PMGB06 functional in libxc <5.2.0.
testopts = "--skipdir=QS/regtest-rs-dhft" if gcc_version == 8 else ""
f.write(install_deps_ubuntu(gcc_version=gcc_version))
f.write(regtest_cmake("ubuntu", "ssmp", testopts=testopts))
with OutputFile("Dockerfile.test_arm64-psmp", args.check) as f:
base_img = "arm64v8/ubuntu:24.04"
@ -423,13 +419,9 @@ def install_deps_toolchain(
# ======================================================================================
def install_deps_ubuntu(
base_image: str = "ubuntu:24.04", gcc_version: int = 13, with_libxsmm: bool = True
) -> str:
assert gcc_version > 8
output = rf"""
FROM {base_image}
"""
def install_deps_ubuntu(gcc_version: int = 13) -> str:
base_image = "ubuntu:24.04" if gcc_version > 8 else "ubuntu:20.04"
output = f"\nFROM {base_image}\n"
if gcc_version > 13:
output += rf"""
@ -458,8 +450,8 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
libint2-dev \
libxc-dev \
libhdf5-dev \
{"libxsmm-dev" if with_libxsmm else ""} \
libspglib-f08-dev \
{"libxsmm-dev" if gcc_version > 8 else ""} \
{"libspglib-f08-dev" if gcc_version > 8 else ""} \
&& rm -rf /var/lib/apt/lists/*
# Create links in /usr/local/bin to overrule links in /usr/bin.
@ -467,54 +459,24 @@ RUN ln -sf /usr/bin/gcc-{gcc_version} /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-{gcc_version} /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-{gcc_version} /usr/local/bin/gfortran
# Install DBCSR
COPY ./tools/docker/scripts/install_dbcsr.sh ./
RUN ./install_dbcsr.sh ssmp
"""
return output
# ======================================================================================
def install_deps_ubuntu2004(gcc_version: int = 8) -> str:
output = rf"""
FROM ubuntu:20.04
# Install Ubuntu packages.
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
apt-get update -qq && apt-get install -qq --no-install-recommends \
cmake \
gcc-{gcc_version} \
g++-{gcc_version} \
gfortran-{gcc_version} \
libfftw3-dev \
libopenblas-dev \
libgsl-dev \
libhdf5-dev \
&& rm -rf /var/lib/apt/lists/*
# Create links in /usr/local/bin to overrule links in /usr/bin.
RUN ln -sf /usr/bin/gcc-{gcc_version} /usr/local/bin/gcc && \
ln -sf /usr/bin/g++-{gcc_version} /usr/local/bin/g++ && \
ln -sf /usr/bin/gfortran-{gcc_version} /usr/local/bin/gfortran
"""
output += install_toolchain(
base_image="ubuntu",
# Use toolchain to install DBCSR{"" if gcc_version > 8 else " and CMake"}.
""" + install_toolchain(
base_image=base_image,
mpi_mode="no",
with_dbcsr="",
with_gcc="system",
with_cmake="system",
with_dbcsr="no",
with_fftw="system",
with_cmake="system" if gcc_version > 8 else "",
with_ninja="system",
with_openblas="system",
with_gsl="system",
with_hdf5="system",
with_libxc="no",
with_libint="no",
with_libgrpp="no",
with_libint="install",
with_libxc="install",
with_libxsmm="install",
with_libvori="install",
with_fftw="no",
with_libxsmm="no",
with_spglib="no",
with_libvori="no",
)
return output

View file

@ -1,54 +0,0 @@
#!/bin/bash -e
if (($# != 1)); then
echo "ERROR: Script install_dbcsr.sh expects exactly one argument"
echo "Usage: install_dbcsr.sh <VERSION>"
exit 1
fi
VERSION=$1
DBCSR_ver="2.8.0"
DBCSR_sha256="d55e4f052f28d1ed0faeaa07557241439243287a184d1fd27f875c8b9ca6bd96"
[[ -z "${INSTALL_PREFIX}" ]] && INSTALL_PREFIX="/opt/cp2k"
echo "==================== Installing DBCSR ===================="
wget -q "https://github.com/cp2k/dbcsr/releases/download/v${DBCSR_ver}/dbcsr-${DBCSR_ver}.tar.gz"
echo "${DBCSR_sha256} dbcsr-${DBCSR_ver}.tar.gz" | sha256sum --check > /dev/null
tar xzf dbcsr-${DBCSR_ver}.tar.gz
cd dbcsr-${DBCSR_ver}
mkdir build
cd build
if [[ "${VERSION}" == "ssmp" ]]; then
USE_MPI="OFF"
elif [[ "${VERSION}" == "psmp" ]]; then
USE_MPI="ON"
else
echo "Unknown version: ${VERSION}."
exit 1
fi
if ! cmake -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" -DCMAKE_INSTALL_LIBDIR=lib -DUSE_MPI=${USE_MPI} -DUSE_OPENMP=ON .. &> cmake.log; then
cat cmake.log
exit 1
fi
if ! make -j &> make.log; then
cat make.log
exit 1
fi
if ! make install VERBOSE=1 &> install.log; then
cat install.log
exit 1
fi
cd ../..
rm -rf "dbcsr-${DBCSR_ver}" "dbcsr-${DBCSR_ver}.tar.gz"
#EOF