make_cp2k.sh: Use Spack v1.2.0 (#5546)

This commit is contained in:
SY Wang 2026-07-08 18:39:19 +08:00 committed by GitHub
parent cccb9b4cd4
commit 345b391c5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 12 deletions

View file

@ -914,7 +914,7 @@ echo ""
### Build CP2K dependencies with Spack if needed or requested ###
# Spack version
export SPACK_VERSION="${SPACK_VERSION:-1.1.1}"
export SPACK_VERSION="${SPACK_VERSION:-1.2.1}"
export SPACK_BUILD_PATH="${BUILD_PATH}/spack"
export SPACK_ROOT="${SPACK_BUILD_PATH}/spack"
@ -1159,7 +1159,7 @@ if [[ ! -f "${SPACK_BUILD_PATH}/BUILD_DEPENDENCIES_COMPLETED" ]]; then
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)"
GCC_VERSION_NEWEST="$(spack compilers | sed -nE 's/.*gcc@([0-9]+(\.[0-9]+)*).*/\1/p' | sort -V | tail -n 1)"
echo "The newest GCC compiler version found by spack is ${GCC_VERSION_NEWEST}"
GCC_VERSION_NEWEST="$(echo "${GCC_VERSION_NEWEST}" | sed -E -e 's/.*@([0-9]+).*/\1/' | cut -d. -f1)"
@ -1230,7 +1230,7 @@ if [[ ! -f "${SPACK_BUILD_PATH}/BUILD_DEPENDENCIES_COMPLETED" ]]; then
${EXIT_CMD} 1
fi
# Concretize CP2K dependencies
if ! spack -e "${CP2K_ENV}" concretize --fresh --jobs $((NUM_PROCS)); then
if ! spack -e "${CP2K_ENV}" concretize --fresh --jobs "${NUM_PROCS}"; then
echo -e "\nERROR: The spack concretize for environment \"${CP2K_ENV}\" failed"
echo ""
echo "HINT: The (-ue | --use_externals) flags can cause conflicts with outdated"
@ -1257,7 +1257,7 @@ if [[ ! -f "${SPACK_BUILD_PATH}/BUILD_DEPENDENCIES_COMPLETED" ]]; then
spack compiler list
fi
fi
if ! spack -e "${CP2K_ENV}" --no-user-config --no-system-config concretize --fresh --jobs $((NUM_PROCS)); then
if ! spack -e "${CP2K_ENV}" concretize --fresh --jobs "${NUM_PROCS}"; then
echo -e "\nERROR: The spack concretize for environment \"${CP2K_ENV}\" failed"
${EXIT_CMD} 1
fi
@ -1266,7 +1266,7 @@ if [[ ! -f "${SPACK_BUILD_PATH}/BUILD_DEPENDENCIES_COMPLETED" ]]; then
((VERBOSE > 0)) && spack find -c
# Install CP2K dependencies via Spack
if ! spack -e "${CP2K_ENV}" install --jobs "$((NUM_PROCS / NUM_PACKAGES))" --concurrent-packages "${NUM_PACKAGES}" "${VERBOSE_SPACK}"; then
if ! spack -e "${CP2K_ENV}" install -j "${NUM_PROCS}" -p "${NUM_PACKAGES}" "${VERBOSE_SPACK}"; then
echo "ERROR: Building the CP2K dependencies with spack failed"
if [[ "${USE_EXTERNALS}" == "yes" ]]; then
echo "HINT: Try to re-run the build without the (-ue | --use_externals) flag which avoids"

View file

@ -3,7 +3,7 @@
# Usage: ./spack_cache_start.sh; podman build --shm-size=1g -t spack_ssmp-static -f ./Dockerfile.test_spack_ssmp-static ../../
#
ARG BASE_IMAGE="ubuntu:24.04"
ARG BASE_IMAGE="ubuntu:26.04"
###### Stage 1: Build CP2K dependencies ######
@ -48,7 +48,7 @@ WORKDIR /opt/cp2k
COPY ./tools/spack ./tools/spack
COPY ./tools/docker ./tools/docker
COPY ./make_cp2k.sh .
RUN ./make_cp2k.sh -bd_only -cv ssmp-static -gpu none -gv 14 -mpi no
RUN ./make_cp2k.sh -bd_only -cv ssmp-static -gpu none -mpi no
###### Stage 2: Build CP2K ######
@ -60,7 +60,7 @@ COPY ./tools/build_utils ./tools/build_utils
COPY ./cmake ./cmake
COPY ./CMakeLists.txt .
RUN ./make_cp2k.sh -cv ssmp-static -gv 14 -gpu none -mpi no
RUN ./make_cp2k.sh -cv ssmp-static -gpu none -mpi no
###### Stage 3: Install CP2K ######

View file

@ -192,8 +192,6 @@ 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,
)

View file

@ -48,8 +48,8 @@ class Libint(CMakePackage):
depends_on("cxx", type="build")
depends_on("fortran", type="build", when="+fortran")
depends_on("boost", type="build")
depends_on("eigen", type="build")
depends_on("boost")
depends_on("eigen")
def setup_build_environment(self, env):
env.append_flags("CXXFLAGS", "-g1")