diff --git a/cmake/CompilerConfiguration.cmake b/cmake/CompilerConfiguration.cmake index 1d901033a5..86d5fb0efb 100644 --- a/cmake/CompilerConfiguration.cmake +++ b/cmake/CompilerConfiguration.cmake @@ -82,19 +82,27 @@ add_compile_options( ) # Debug + +# TODO: Replace deprecated MASTER constructs with MASKED (only available since +# GCC 12) and remove "-Wno-error=deprecated-openmp" once GCC 11 support is +# dropped. add_compile_options( "$<$,$>:-O1;${_CP2K_GNU_NATIVE_TUNE}>" "$<$,$>:-O1;${_CP2K_GNU_NATIVE_TUNE}>" "$<$,$>:-O1;${_CP2K_GNU_NATIVE_TUNE};-Wall;-Wextra;-Werror>" + "$<$,$,$,16>>:-Wno-error=deprecated-openmp>" ) +# FIXME: GCC 16 diagnoses legacy character-length mismatches that were not +# reported by earlier GCC versions. Restore "-Werror=character-truncation" after +# auditing and resolving them. add_compile_options( "$<$,$>:-fsanitize=leak;-Werror=realloc-lhs>" "$<$,$>:-fcheck=all,no-array-temps;-finline-matmul-limit=0>" "$<$,$>:-ffpe-trap=invalid,zero,overflow>" "$<$,$>:-finit-derived;-finit-real=snan;-finit-integer=-42>" "$<$,$>:-Werror=aliasing;-Werror=ampersand;-Werror=c-binding-type>" - "$<$,$>:-Werror=character-truncation;-Werror=intrinsic-shadow>" - "$<$,$>:-Werror=intrinsics-std;-Werror=line-truncation;-Werror=tabs;-Werror=target-lifetime>" + "$<$,$>:-Werror=intrinsics-std;-Werror=intrinsic-shadow>" + "$<$,$>:-Werror=line-truncation;-Werror=tabs;-Werror=target-lifetime>" "$<$,$>:-Werror=underflow;-Werror=unused-but-set-variable;-Werror=unused-variable>" "$<$,$>:-Werror=unused-dummy-argument;-Werror=unused-parameter>" "$<$,$>:-Werror=unused-label;-Werror=conversion;-Werror=zerotrip>" diff --git a/tools/dashboard/dashboard.conf b/tools/dashboard/dashboard.conf index 1e83e53a3f..55be1f1df2 100644 --- a/tools/dashboard/dashboard.conf +++ b/tools/dashboard/dashboard.conf @@ -312,23 +312,17 @@ timeout: 170 host: GCP report_url: https://storage.googleapis.com/cp2k-ci/dashboard_fedora-psmp_report.txt -[rawhide-psmp] -name: Rawhide Toolchain (psmp) +[rawhide-pdbg] +name: Rawhide Toolchain (pdbg) timeout: 170 host: GCP -report_url: https://storage.googleapis.com/cp2k-ci/dashboard_rawhide-psmp_report.txt +report_url: https://storage.googleapis.com/cp2k-ci/dashboard_rawhide-pdbg_report.txt -[spack-ssmp-rawhide] -name: Spack (ssmp, rawhide) +[spack-pdbg-rawhide] +name: Spack (pdbg, rawhide) timeout: 170 host: GCP -report_url: https://storage.googleapis.com/cp2k-ci/dashboard_spack-ssmp-rawhide_report.txt - -[spack-psmp-rawhide] -name: Spack (psmp, rawhide) -timeout: 170 -host: GCP -report_url: https://storage.googleapis.com/cp2k-ci/dashboard_spack-psmp-rawhide_report.txt +report_url: https://storage.googleapis.com/cp2k-ci/dashboard_spack-pdbg-rawhide_report.txt [spack-psmp-fedora] name: Spack (psmp, fedora) diff --git a/tools/docker/Dockerfile.test_rawhide-psmp b/tools/docker/Dockerfile.test_rawhide-pdbg similarity index 96% rename from tools/docker/Dockerfile.test_rawhide-psmp rename to tools/docker/Dockerfile.test_rawhide-pdbg index d34f2e5b43..f21c9b953b 100644 --- a/tools/docker/Dockerfile.test_rawhide-psmp +++ b/tools/docker/Dockerfile.test_rawhide-pdbg @@ -1,6 +1,6 @@ # # This file was created by generate_dockerfiles.py. -# Usage: podman build --shm-size=1g -f ./Dockerfile.test_rawhide-psmp ../../ +# Usage: podman build --shm-size=1g -f ./Dockerfile.test_rawhide-pdbg ../../ # FROM fedora:rawhide @@ -70,7 +70,7 @@ COPY ./CMakeLists.txt . # Compile CP2K. COPY ./tools/docker/scripts/build_cp2k.sh . -RUN ./build_cp2k.sh toolchain psmp +RUN ./build_cp2k.sh toolchain pdbg # Run regression tests. ARG TESTOPTS="" @@ -78,7 +78,7 @@ COPY ./tests ./tests COPY ./tools/docker/scripts/test_regtest.sh ./ RUN /bin/bash -o pipefail -c " \ TESTOPTS='${TESTOPTS}' \ - ./test_regtest.sh toolchain psmp |& tee report.log && \ + ./test_regtest.sh toolchain pdbg |& tee report.log && \ rm -rf regtesting" # Output the report if the image is old and was therefore pulled from the build cache. diff --git a/tools/docker/Dockerfile.test_spack_psmp-rawhide b/tools/docker/Dockerfile.test_spack_pdbg-rawhide similarity index 87% rename from tools/docker/Dockerfile.test_spack_psmp-rawhide rename to tools/docker/Dockerfile.test_spack_pdbg-rawhide index 39b58a38ea..0b0845891e 100644 --- a/tools/docker/Dockerfile.test_spack_psmp-rawhide +++ b/tools/docker/Dockerfile.test_spack_pdbg-rawhide @@ -1,6 +1,6 @@ # # This file was created by generate_dockerfiles.py. -# Usage: ./spack_cache_start.sh; podman build --shm-size=1g -t spack_psmp-rawhide -f ./Dockerfile.test_spack_psmp-rawhide ../../ +# Usage: ./spack_cache_start.sh; podman build --shm-size=1g -t spack_pdbg-rawhide -f ./Dockerfile.test_spack_pdbg-rawhide ../../ # ARG BASE_IMAGE="fedora:rawhide" @@ -14,6 +14,7 @@ RUN dnf -qy install \ g++ gcc gfortran \ git \ libffi-devel \ + liblsan \ libtool \ make \ patch \ @@ -28,7 +29,7 @@ RUN dnf -qy install \ && dnf clean -q all ARG IMAGE_TAG -ENV IMAGE_TAG=${IMAGE_TAG:-spack_psmp-rawhide} +ENV IMAGE_TAG=${IMAGE_TAG:-spack_pdbg-rawhide} ARG SPACK_CACHE ENV SPACK_CACHE="${SPACK_CACHE:-s3://spack-cache --s3-endpoint-url=http://host.containers.internal:9000}" @@ -39,13 +40,13 @@ COPY . cp2k/ # Build CP2K dependencies WORKDIR /opt/cp2k -RUN ./make_cp2k.sh -bd_only -cv psmp -gpu none -mpi mpich -ue -ef openpmd +RUN ./make_cp2k.sh -bd_only -cv pdbg -gpu none -mpi mpich -ue -ef openpmd ###### Stage 2: Build CP2K ###### FROM build_deps AS build_cp2k -RUN ./make_cp2k.sh -cv psmp -gpu none -mpi mpich -ef openpmd +RUN ./make_cp2k.sh -cv pdbg -gpu none -mpi mpich -ef openpmd ###### Stage 3: Install CP2K ###### @@ -54,6 +55,7 @@ FROM "${BASE_IMAGE}" AS install_cp2k RUN dnf -qy install \ g++ gcc gfortran \ python3 \ + liblsan \ && dnf clean -q all WORKDIR /opt/cp2k diff --git a/tools/docker/Dockerfile.test_spack_psmp b/tools/docker/Dockerfile.test_spack_psmp deleted file mode 100644 index 3bd5a70552..0000000000 --- a/tools/docker/Dockerfile.test_spack_psmp +++ /dev/null @@ -1,94 +0,0 @@ -# -# This file was created by generate_dockerfiles.py. -# Usage: ./spack_cache_start.sh; podman build --shm-size=1g -t spack_psmp -f ./Dockerfile.test_spack_psmp ../../ -# - -ARG BASE_IMAGE="ubuntu:26.04" - -###### Stage 1: Build CP2K dependencies ###### - -FROM "${BASE_IMAGE}" AS build_deps - -RUN apt-get update -qq && apt-get install -qq --no-install-recommends \ - bzip2 \ - ca-certificates \ - cmake \ - g++ g++-14 gcc gcc-14 gfortran gfortran-14 \ - git \ - gnupg \ - libssh-dev \ - libssl-dev \ - libtool \ - libtool-bin \ - lsb-release \ - make \ - patch \ - pkgconf \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv \ - unzip \ - wget \ - xxd \ - xz-utils \ - zlib1g \ - zlib1g-dev \ - zstd \ - && rm -rf /var/lib/apt/lists/* - -ARG IMAGE_TAG -ENV IMAGE_TAG=${IMAGE_TAG:-spack_psmp} - -ARG SPACK_CACHE -ENV SPACK_CACHE="${SPACK_CACHE:-s3://spack-cache --s3-endpoint-url=http://host.containers.internal:9000}" - -# Copy CP2K repository into container -WORKDIR /opt -COPY . cp2k/ - -# Build CP2K dependencies -WORKDIR /opt/cp2k -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 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++-14 gcc gcc-14 gfortran gfortran-14 \ - python3 \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /opt/cp2k - -# Install CP2K dependencies built with spack -COPY --from=build_cp2k /opt/cp2k/spack/spack/opt/spack ./spack/spack/opt/spack - -# Install CP2K -COPY --from=build_cp2k /opt/cp2k/install ./install - -# Install CP2K regression tests -COPY --from=build_cp2k /opt/cp2k/tests ./tests -COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks - -# Install CP2K/Quickstep CI benchmarks -COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI - -# Do not rely only on LD_LIBRARY_PATH because it is fragile -COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf -RUN ldconfig - -# Run CP2K regression test -RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests --keepalive || echo "ERROR: Tests failed" - -# Create entrypoint and finalise container build -WORKDIR /mnt -ENTRYPOINT ["/opt/cp2k/install/bin/launch"] -CMD ["cp2k", "--help", "--version"] diff --git a/tools/docker/Dockerfile.test_spack_psmp-fedora b/tools/docker/Dockerfile.test_spack_psmp-fedora index a6bc42906e..2f9d0e9df2 100644 --- a/tools/docker/Dockerfile.test_spack_psmp-fedora +++ b/tools/docker/Dockerfile.test_spack_psmp-fedora @@ -14,6 +14,7 @@ RUN dnf -qy install \ g++ gcc gfortran \ git \ libffi-devel \ + liblsan \ libtool \ make \ patch \ @@ -54,6 +55,7 @@ FROM "${BASE_IMAGE}" AS install_cp2k RUN dnf -qy install \ g++ gcc gfortran \ python3 \ + liblsan \ && dnf clean -q all WORKDIR /opt/cp2k diff --git a/tools/docker/Dockerfile.test_spack_ssmp-rawhide b/tools/docker/Dockerfile.test_spack_ssmp-rawhide deleted file mode 100644 index 6aa497649a..0000000000 --- a/tools/docker/Dockerfile.test_spack_ssmp-rawhide +++ /dev/null @@ -1,84 +0,0 @@ -# -# This file was created by generate_dockerfiles.py. -# Usage: ./spack_cache_start.sh; podman build --shm-size=1g -t spack_ssmp-rawhide -f ./Dockerfile.test_spack_ssmp-rawhide ../../ -# - -ARG BASE_IMAGE="fedora:rawhide" - -###### Stage 1: Build CP2K dependencies ###### - -FROM "${BASE_IMAGE}" AS build_deps - -RUN dnf -qy install \ - cmake \ - g++ gcc gfortran \ - git \ - libffi-devel \ - libtool \ - make \ - patch \ - perl-core \ - pkg-config \ - python3 \ - python3-devel \ - unzip \ - wget \ - zlib-devel \ - zlib-static \ - && dnf clean -q all - -ARG IMAGE_TAG -ENV IMAGE_TAG=${IMAGE_TAG:-spack_ssmp-rawhide} - -ARG SPACK_CACHE -ENV SPACK_CACHE="${SPACK_CACHE:-s3://spack-cache --s3-endpoint-url=http://host.containers.internal:9000}" - -# Copy CP2K repository into container -WORKDIR /opt -COPY . cp2k/ - -# Build CP2K dependencies -WORKDIR /opt/cp2k -RUN ./make_cp2k.sh -bd_only -cv ssmp -gpu none -mpi no -ue - -###### Stage 2: Build CP2K ###### - -FROM build_deps AS build_cp2k - -RUN ./make_cp2k.sh -cv ssmp -gpu none -mpi no - -###### Stage 3: Install CP2K ###### - -FROM "${BASE_IMAGE}" AS install_cp2k - -RUN dnf -qy install \ - g++ gcc gfortran \ - python3 \ - && dnf clean -q all - -WORKDIR /opt/cp2k - -# Install CP2K dependencies built with spack -COPY --from=build_cp2k /opt/cp2k/spack/spack/opt/spack ./spack/spack/opt/spack - -# Install CP2K -COPY --from=build_cp2k /opt/cp2k/install ./install - -# Install CP2K regression tests -COPY --from=build_cp2k /opt/cp2k/tests ./tests -COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks - -# Install CP2K/Quickstep CI benchmarks -COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI - -# Do not rely only on LD_LIBRARY_PATH because it is fragile -COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf -RUN ldconfig - -# Run CP2K regression test -RUN /opt/cp2k/install/bin/launch /opt/cp2k/install/bin/run_tests --keepalive || echo "ERROR: Tests failed" - -# Create entrypoint and finalise container build -WORKDIR /mnt -ENTRYPOINT ["/opt/cp2k/install/bin/launch"] -CMD ["cp2k", "--help", "--version"] diff --git a/tools/docker/cp2k-ci.conf b/tools/docker/cp2k-ci.conf index 2afa3860eb..bd5d5a3ea0 100644 --- a/tools/docker/cp2k-ci.conf +++ b/tools/docker/cp2k-ci.conf @@ -432,29 +432,21 @@ nodepools: pool-main build_path: / dockerfile: /tools/docker/Dockerfile.test_fedora-psmp -[rawhide-psmp] -display_name: Fedora Rawhide +[rawhide-pdbg] +display_name: Fedora Rawhide (pdbg) tags: weekly-afternoon cpu: 32 nodepools: pool-main build_path: / -dockerfile: /tools/docker/Dockerfile.test_rawhide-psmp +dockerfile: /tools/docker/Dockerfile.test_rawhide-pdbg -[spack-ssmp-rawhide] -display_name: Spack (ssmp, rawhide) +[spack-pdbg-rawhide] +display_name: Spack (pdbg, rawhide) tags: weekly-afternoon cpu: 32 nodepools: pool-main build_path: / -dockerfile: /tools/docker/Dockerfile.test_spack_ssmp-rawhide - -[spack-psmp-rawhide] -display_name: Spack (psmp, rawhide) -tags: weekly-afternoon -cpu: 32 -nodepools: pool-main -build_path: / -dockerfile: /tools/docker/Dockerfile.test_spack_psmp-rawhide +dockerfile: /tools/docker/Dockerfile.test_spack_pdbg-rawhide [spack-psmp-fedora] display_name: Spack (psmp, fedora) diff --git a/tools/docker/generate_dockerfiles.py b/tools/docker/generate_dockerfiles.py index d1d032db82..ff65777049 100755 --- a/tools/docker/generate_dockerfiles.py +++ b/tools/docker/generate_dockerfiles.py @@ -37,9 +37,9 @@ def main() -> None: f.write(install_deps_toolchain(base_image="fedora:44")) f.write(regtest("toolchain", "psmp")) - with OutputFile(f"Dockerfile.test_rawhide-psmp", args.check) as f: + with OutputFile(f"Dockerfile.test_rawhide-pdbg", args.check) as f: f.write(install_deps_toolchain(base_image="fedora:rawhide")) - f.write(regtest("toolchain", "psmp")) + f.write(regtest("toolchain", "pdbg")) for version in "ssmp", "psmp": mpi_mode = "intelmpi" if version.startswith("p") else "no" @@ -92,21 +92,10 @@ def main() -> None: ) ) - with OutputFile(f"Dockerfile.test_spack_ssmp-rawhide", args.check) as f: + with OutputFile(f"Dockerfile.test_spack_pdbg-rawhide", args.check) as f: f.write( install_cp2k_spack( - version="ssmp", - mpi_mode="no", - base_image="fedora:rawhide", - testopts=testopts, - image_tag=f.image_tag, - ) - ) - - with OutputFile(f"Dockerfile.test_spack_psmp-rawhide", args.check) as f: - f.write( - install_cp2k_spack( - version="psmp", + version="pdbg", mpi_mode="mpich", base_image="fedora:rawhide", feature_flags="-ef openpmd", @@ -816,6 +805,7 @@ RUN dnf -qy install \ {gcc_compilers} \ git \ libffi-devel \ + liblsan \ libtool \ make \ patch \ @@ -928,6 +918,7 @@ FROM "${{BASE_IMAGE}}" AS install_cp2k RUN dnf -qy install \ {gcc_compilers} \ python3 \ + liblsan \ && dnf clean -q all """ elif "opensuse/leap" in base_image: diff --git a/tools/toolchain/install_requirements_fedora.sh b/tools/toolchain/install_requirements_fedora.sh index 08e4210c89..cc9a289834 100755 --- a/tools/toolchain/install_requirements_fedora.sh +++ b/tools/toolchain/install_requirements_fedora.sh @@ -18,6 +18,7 @@ dnf -qy install \ gfortran \ git \ less \ + liblsan \ libtool \ make \ nano \ diff --git a/tools/toolchain/scripts/tool_kit.sh b/tools/toolchain/scripts/tool_kit.sh index b953befebc..87c52e4162 100644 --- a/tools/toolchain/scripts/tool_kit.sh +++ b/tools/toolchain/scripts/tool_kit.sh @@ -156,8 +156,8 @@ reverse() ( get_nprocs() { if [ -n "${NPROCS_OVERWRITE}" ]; then echo ${NPROCS_OVERWRITE} | sed 's/^0*//' - elif $(command -v lscpu > /dev/null 2>&1); then - echo $(lscpu -p=Core,Socket | grep -v '#' | sort -u | wc -l) + elif $(command -v nproc > /dev/null 2>&1); then + echo $(nproc --all) elif $(command -v sysctl > /dev/null 2>&1); then echo $(sysctl -n hw.ncpu) else