Use base image ubuntu 26.04 and gcc 14 as default for the spack tester (#5154)

This commit is contained in:
Matthias Krack 2026-05-09 21:45:11 +02:00 committed by GitHub
parent 46d6027c6b
commit 4104e3fc41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 88 additions and 52 deletions

View file

@ -69,6 +69,15 @@ else
EXIT_CMD="exit"
fi
# Check platform
if [[ "$(uname -s)" == "Darwin" ]]; then
echo "ERROR: A build for Apple macOS (Darwin, Homebrew) is not supported yet,"
echo " but CP2K can be built within a container using podman."
echo " Check the Dockerfiles in the folder cp2k/tools/docker like"
echo " Dockerfile.test_spack_openmpi-psmp and the usage description in their header"
${EXIT_CMD} 1
fi
# Help finding ldconfig
if ! command -v ldconfig &> /dev/null; then
PATH="${PATH}:/sbin"
@ -83,13 +92,6 @@ for package in awk bzip2 find g++ gcc gfortran git gzip ldconfig make patch pyth
fi
done
# Check platform
if [[ "$(uname -s)" == "Darwin" ]]; then
echo "ERROR: A build for Apple macOS (Darwin, Homebrew) is not supported yet,"
echo " but CP2K can be built within a container, e.g. using Ubuntu"
${EXIT_CMD} 1
fi
# Print OS info if available
if [[ -f /etc/os-release ]]; then
echo ""

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -t spack_openmpi-pdbg -f ./Dockerfile.test_spack_openmpi-pdbg ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -13,7 +13,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
git \
gnupg \
libssh-dev \
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
@ -47,20 +49,20 @@ COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
RUN ./make_cp2k.sh -bd_only -cv pdbg -gpu none -gv 13 -mpi openmpi -ue -ef openpmd
RUN ./make_cp2k.sh -bd_only -cv pdbg -gpu none -gv 14 -mpi openmpi -ef openpmd
###### Stage 2: Build CP2K ######
FROM build_deps AS build_cp2k
RUN ./make_cp2k.sh -cv pdbg -gv 13 -gpu none -mpi openmpi -ef openpmd
RUN ./make_cp2k.sh -cv pdbg -gv 14 -gpu none -mpi openmpi -ef openpmd
###### Stage 3: Install CP2K ######
FROM "${BASE_IMAGE}" AS install_cp2k
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
python3 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -t spack_openmpi-psmp -f ./Dockerfile.test_spack_openmpi-psmp ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -13,7 +13,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
git \
gnupg \
libssh-dev \
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
@ -47,20 +49,20 @@ COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 13 -mpi openmpi -ue -ef openpmd
RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 14 -mpi openmpi -ef openpmd
###### Stage 2: Build CP2K ######
FROM build_deps AS build_cp2k
RUN ./make_cp2k.sh -cv psmp -gv 13 -gpu none -mpi openmpi -ef openpmd
RUN ./make_cp2k.sh -cv psmp -gv 14 -gpu none -mpi openmpi -ef openpmd
###### Stage 3: Install CP2K ######
FROM "${BASE_IMAGE}" AS install_cp2k
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
python3 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -t spack_pdbg -f ./Dockerfile.test_spack_pdbg ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -13,7 +13,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
git \
gnupg \
libssh-dev \
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
@ -47,20 +49,20 @@ COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
RUN ./make_cp2k.sh -bd_only -cv pdbg -gpu none -gv 13 -mpi mpich -ue -ef openpmd
RUN ./make_cp2k.sh -bd_only -cv pdbg -gpu none -gv 14 -mpi mpich -ue -ef openpmd
###### Stage 2: Build CP2K ######
FROM build_deps AS build_cp2k
RUN ./make_cp2k.sh -cv pdbg -gv 13 -gpu none -mpi mpich -ef openpmd
RUN ./make_cp2k.sh -cv pdbg -gv 14 -gpu none -mpi mpich -ef openpmd
###### Stage 3: Install CP2K ######
FROM "${BASE_IMAGE}" AS install_cp2k
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
python3 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -t spack_psmp -f ./Dockerfile.test_spack_psmp ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -13,7 +13,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
git \
gnupg \
libssh-dev \
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
@ -47,20 +49,20 @@ COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 13 -mpi mpich -ue -ef openpmd
RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 14 -mpi mpich -ue -ef openpmd
###### Stage 2: Build CP2K ######
FROM build_deps AS build_cp2k
RUN ./make_cp2k.sh -cv psmp -gv 13 -gpu none -mpi mpich -ef openpmd
RUN ./make_cp2k.sh -cv psmp -gv 14 -gpu none -mpi mpich -ef openpmd
###### Stage 3: Install CP2K ######
FROM "${BASE_IMAGE}" AS install_cp2k
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
python3 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -t spack_psmp-4x2 -f ./Dockerfile.test_spack_psmp-4x2 ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -13,7 +13,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
git \
gnupg \
libssh-dev \
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
@ -47,20 +49,20 @@ COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 13 -mpi mpich -ue -ef openpmd
RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -gv 14 -mpi mpich -ue -ef openpmd
###### Stage 2: Build CP2K ######
FROM build_deps AS build_cp2k
RUN ./make_cp2k.sh -cv psmp -gv 13 -gpu none -mpi mpich -ef openpmd
RUN ./make_cp2k.sh -cv psmp -gv 14 -gpu none -mpi mpich -ef openpmd
###### Stage 3: Install CP2K ######
FROM "${BASE_IMAGE}" AS install_cp2k
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
python3 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*

View file

@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*

View file

@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*

View file

@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -t spack_psmp-gcc14 -f ./Dockerfile.test_spack_psmp-gcc14 ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*

View file

@ -13,7 +13,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
g++ gcc gfortran \
g++ g++-15 gcc gcc-15 gfortran gfortran-15 \
git \
gnupg \
libssh-dev \
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
@ -60,7 +62,7 @@ RUN ./make_cp2k.sh -cv psmp -gv 15 -gpu none -mpi mpich -ef openpmd
FROM "${BASE_IMAGE}" AS install_cp2k
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
g++ gcc gfortran \
g++ g++-15 gcc gcc-15 gfortran gfortran-15 \
python3 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -t spack_sdbg -f ./Dockerfile.test_spack_sdbg ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -13,7 +13,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
git \
gnupg \
libssh-dev \
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
@ -47,20 +49,20 @@ COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
RUN ./make_cp2k.sh -bd_only -cv sdbg -gpu none -gv 13 -mpi no -ue
RUN ./make_cp2k.sh -bd_only -cv sdbg -gpu none -gv 14 -mpi no -ue
###### Stage 2: Build CP2K ######
FROM build_deps AS build_cp2k
RUN ./make_cp2k.sh -cv sdbg -gv 13 -gpu none -mpi no
RUN ./make_cp2k.sh -cv sdbg -gv 14 -gpu none -mpi no
###### Stage 3: Install CP2K ######
FROM "${BASE_IMAGE}" AS install_cp2k
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
python3 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --network=host --shm-size=1g -t spack_ssmp -f ./Dockerfile.test_spack_ssmp ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -13,7 +13,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
git \
gnupg \
libssh-dev \
@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
@ -47,20 +49,20 @@ COPY . cp2k/
# Build CP2K dependencies
WORKDIR /opt/cp2k
RUN ./make_cp2k.sh -bd_only -cv ssmp -gpu none -gv 13 -mpi no -ue
RUN ./make_cp2k.sh -bd_only -cv ssmp -gpu none -gv 14 -mpi no -ue
###### Stage 2: Build CP2K ######
FROM build_deps AS build_cp2k
RUN ./make_cp2k.sh -cv ssmp -gv 13 -gpu none -mpi no
RUN ./make_cp2k.sh -cv ssmp -gv 14 -gpu none -mpi no
###### Stage 3: Install CP2K ######
FROM "${BASE_IMAGE}" AS install_cp2k
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
g++ g++-13 gcc gcc-13 gfortran gfortran-13 \
g++ g++-14 gcc gcc-14 gfortran gfortran-14 \
python3 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*

View file

@ -32,6 +32,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*

View file

@ -87,7 +87,7 @@ def main() -> None:
with OutputFile(
f"Dockerfile.test_spack_psmp-gcc{gcc_version}", args.check
) as f:
base_image = "ubuntu:26.04" if gcc_version > 14 else "ubuntu:24.04"
base_image = "ubuntu:26.04" if gcc_version > 12 else "ubuntu:24.04"
f.write(
install_cp2k_spack(
version="psmp",
@ -212,6 +212,7 @@ def main() -> None:
install_cp2k_spack(
version="ssmp-static",
mpi_mode="no",
base_image="ubuntu:24.04",
gcc_version=14,
testopts=testopts,
image_tag=f.image_tag,
@ -713,15 +714,14 @@ RUN ./scripts/stage9/install_stage9.sh && rm -rf ./build
def install_cp2k_spack(
version: str,
mpi_mode: str,
base_image: str = "ubuntu:24.04",
gcc_version: int = 13,
base_image: str = "ubuntu:26.04",
gcc_version: int = 14,
gpu_model: str = "none",
feature_flags: str = "",
testopts: str = "",
image_tag: str = "",
) -> str:
# Ubuntu 24.04 provides no gcc-15 package whereas GCC 15 is the default for fedora:43
if gcc_version == 15 or "fedora" in base_image:
if "fedora" in base_image:
gcc_compilers = "g++ gcc gfortran"
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"
@ -729,6 +729,8 @@ def install_cp2k_spack(
gcc_compilers = f"gcc gcc-c++ gcc-fortran"
else:
gcc_compilers = f"g++ g++-{gcc_version} gcc gcc-{gcc_version} gfortran gfortran-{gcc_version}"
# Use external packages if possible
use_externals = "-ue"
# Static CP2K builds use the GCC compiler built with spack
if version.endswith("-static"):
use_externals = ""
@ -737,8 +739,8 @@ def install_cp2k_spack(
# of the host system and ignoring all externals at the same
# time is not supported
gcc_compilers = "g++ gcc gfortran"
else:
use_externals = "-ue"
if mpi_mode == "openmpi":
use_externals = ""
# Assemble docker file
output = (
install_base_image(
@ -908,6 +910,8 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
wget \
xxd \
xz-utils \
zlib1g \
zlib1g-dev \
zstd \
&& rm -rf /var/lib/apt/lists/*
"""