From 12426aee75273b262bc8b6c15aa5ef1510eafcee Mon Sep 17 00:00:00 2001 From: Seth R Johnson Date: Sat, 13 Jul 2024 09:16:56 -0400 Subject: [PATCH] Update scripts from upstream/develop --- scripts/cmake-presets/esseivaj.json | 89 ++++++++++++++++++++++++--- scripts/cmake-presets/goldfinger.json | 20 ++++++ scripts/cmake-presets/perlmutter.json | 3 + scripts/cmake-presets/wildstyle.json | 9 +++ scripts/dev/iwyu-apple-clang.imp | 2 +- scripts/dev/run-iwyu.sh | 1 - scripts/docker/build.sh | 4 +- scripts/env/perlmutter.sh | 14 +++-- 8 files changed, 125 insertions(+), 17 deletions(-) diff --git a/scripts/cmake-presets/esseivaj.json b/scripts/cmake-presets/esseivaj.json index ab9272982b..14e512d8e4 100644 --- a/scripts/cmake-presets/esseivaj.json +++ b/scripts/cmake-presets/esseivaj.json @@ -3,11 +3,11 @@ "cmakeMinimumRequired": {"major": 3, "minor": 21, "patch": 0}, "configurePresets": [ { - "name": "base", + "name": ".base", + "hidden": true, "inherits": ["default", ".debug"], - "displayName": "esseivaj default options", - "binaryDir": "${sourceDir}/build-${presetName}", "generator": "Ninja", + "binaryDir": "${sourceDir}/build-${presetName}", "cacheVariables": { "CELERITAS_BUILD_DOCS": {"type": "BOOL", "value": "OFF"}, "CELERITAS_BUILD_DEMOS": {"type": "BOOL", "value": "ON"}, @@ -17,12 +17,71 @@ "CELERITAS_USE_JSON": {"type": "BOOL", "value": "ON"}, "CELERITAS_USE_HepMC3": {"type": "BOOL", "value": "ON"}, "CELERITAS_USE_OpenMP": {"type": "BOOL", "value": "OFF"}, - "CELERITAS_USE_ROOT": {"type": "BOOL", "value": "ON"}, + "CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"}, "CELERITAS_USE_SWIG": {"type": "BOOL", "value": "OFF"}, "CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "ON"}, + "CELERITAS_USE_Perfetto": {"type": "BOOL", "value": "ON"}, + "PERFETTO_ROOT": {"type": "PATH", "value": "$env{PERFETTO_ROOT}/perfetto/sdk"}, "CMAKE_CXX_STANDARD": {"type": "STRING", "value": "17"}, - "CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-error=deprecated -pedantic -fdiagnostics-color=always" + "CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-error=deprecated -pedantic -fdiagnostics-color=always", + "CMAKE_EXPORT_COMPILE_COMMANDS": {"type": "BOOL", "value": "ON"} + } + }, + { + "name": ".no-vg", + "hidden": true, + "cacheVariables": { + "CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "OFF"} + } + }, { + "name": ".profile", + "hidden": true, + "cacheVariables": { + "BUILD_SHARED_LIBS":{"type": "BOOL", "value": "ON"}, + "CELERITAS_DEBUG": {"type": "BOOL", "value": "OFF"}, + "CMAKE_BUILD_TYPE": {"type": "STRING", "value": "RelWithDebInfo"}, + "CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-O2 -g -DNDEBUG -fno-omit-frame-pointer" } + }, + { + "name": "base", + "displayName": "Vecgeom debug", + "inherits": [".base"] + }, + { + "name": "base-novg", + "displayName": "ORANGE debug", + "inherits": [".no-vg", ".base"] + }, + { + "name": "reldeb", + "displayName": "Vecgeom release debug", + "inherits": [".reldeb", ".base"] + }, + { + "name": "reldeb-profile", + "displayName": "Vecgeom profile mode", + "inherits": [".profile", "reldeb"] + }, + { + "name": "reldeb-novg", + "displayName": "ORANGE release debug", + "inherits": [".no-vg", ".reldeb", ".base"] + }, + { + "name": "reldeb-novg-profile", + "displayName": "ORANGE profile mode", + "inherits": [".profile", "reldeb-novg"] + }, + { + "name": "ndebug", + "displayName": "Vecgeom release", + "inherits": [".ndebug", ".base"] + }, + { + "name": "ndebug-novg", + "displayName": "ORANGE release", + "inherits": [".no-vg", ".ndebug", ".base"] } ], "buildPresets": [ @@ -31,14 +90,28 @@ "configurePreset": "base", "jobs": 16, "nativeToolOptions": ["-k0"] - } + }, + {"name": "base-novg", "configurePreset": "base-novg", "inherits": "base"}, + {"name": "ndebug", "configurePreset": "ndebug", "inherits": "base"}, + {"name": "ndebug-novg", "configurePreset": "ndebug-novg", "inherits": "base"}, + {"name": "reldeb", "configurePreset": "reldeb", "inherits": "base"}, + {"name": "reldeb-profile", "configurePreset": "reldeb-profile", "inherits": "base"}, + {"name": "reldeb-novg", "configurePreset": "reldeb-novg", "inherits": "base"}, + {"name": "reldeb-novg-profile", "configurePreset": "reldeb-novg-profile", "inherits": "base"} ], "testPresets": [ { "name": "base", "configurePreset": "base", "output": {"outputOnFailure": true}, - "execution": {"noTestsAction": "error", "stopOnFailure": false} - } + "execution": {"noTestsAction": "error", "stopOnFailure": false, "jobs": 8} + }, + {"name": "base-novg", "configurePreset": "base-novg", "inherits": "base"}, + {"name": "ndebug", "configurePreset": "ndebug", "inherits": "base"}, + {"name": "ndebug-novg", "configurePreset": "ndebug-novg", "inherits": "base"}, + {"name": "reldeb", "configurePreset": "reldeb", "inherits": "base"}, + {"name": "reldeb-profile", "configurePreset": "reldeb-profile", "inherits": "base"}, + {"name": "reldeb-novg", "configurePreset": "reldeb-novg", "inherits": "base"}, + {"name": "reldeb-novg-profile", "configurePreset": "reldeb-novg-profile", "inherits": "base"} ] } diff --git a/scripts/cmake-presets/goldfinger.json b/scripts/cmake-presets/goldfinger.json index 3c871338ed..dedb60c0c9 100644 --- a/scripts/cmake-presets/goldfinger.json +++ b/scripts/cmake-presets/goldfinger.json @@ -24,6 +24,7 @@ "CMAKE_CXX_STANDARD": {"type": "STRING", "value": "17"}, "CMAKE_CXX_EXTENSIONS": {"type": "BOOL", "value": "OFF"}, "CMAKE_FIND_FRAMEWORK": {"type": "STRING", "value": "LAST"}, + "CMAKE_INSTALL_PREFIX": "${sourceDir}/install-${presetName}", "CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-O2 -g -DNDEBUG -fno-inline -fno-omit-frame-pointer", "CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-error=deprecated -pedantic -fdiagnostics-color=always" } @@ -58,6 +59,25 @@ "CELERITAS_REAL_TYPE": "float" } }, + { + "name": "clhep", + "displayName": "With CLHEP units", + "inherits": [".base", ".debug", "default"], + "cacheVariables": { + "CELERITAS_UNITS": "CLHEP", + "CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "ON"} + } + }, + { + "name": "si", + "displayName": "With SI units", + "inherits": [".base", ".debug", "default"], + "cacheVariables": { + "CELERITAS_UNITS": "SI", + "CELERITAS_CORE_GEO": "VecGeom", + "CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "ON"} + } + }, { "name": "vecgeom", "displayName": "With vecgeom", diff --git a/scripts/cmake-presets/perlmutter.json b/scripts/cmake-presets/perlmutter.json index f22ebb5cb9..7256dd8a30 100644 --- a/scripts/cmake-presets/perlmutter.json +++ b/scripts/cmake-presets/perlmutter.json @@ -26,6 +26,9 @@ "CMAKE_CUDA_ARCHITECTURES": {"type": "STRING", "value": "80"}, "CMAKE_CXX_STANDARD": {"type": "STRING", "value": "17"}, "CMAKE_CXX_EXTENSIONS": {"type": "BOOL", "value": "OFF"}, + "CMAKE_CXX_COMPILER_LAUNCHER": "ccache", + "CMAKE_C_COMPILER": {"type": "PATH", "value": "cc"}, + "CMAKE_CXX_COMPILER": {"type": "PATH", "value": "CC"}, "CMAKE_INSTALL_PREFIX": "${sourceDir}/install-${presetName}", "CMAKE_CXX_FLAGS_RELEASE": "-O3 -DNDEBUG -march=znver3 -mtune=znver3", "CMAKE_EXPORT_COMPILE_COMMANDS": {"type": "BOOL", "value": "ON"} diff --git a/scripts/cmake-presets/wildstyle.json b/scripts/cmake-presets/wildstyle.json index f4ad2086ba..50e5f0631d 100644 --- a/scripts/cmake-presets/wildstyle.json +++ b/scripts/cmake-presets/wildstyle.json @@ -72,6 +72,15 @@ "CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "ON"} } }, + { + "name": "clhep", + "displayName": "Debug with VecGeom and clhep units", + "inherits": [".debug", ".base"], + "cacheVariables": { + "CELERITAS_UNITS": "CLHEP", + "CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "ON"} + } + }, { "name": "reldeb", "displayName": "Everything but vecgeom in release mode with debug symbols and assertions", diff --git a/scripts/dev/iwyu-apple-clang.imp b/scripts/dev/iwyu-apple-clang.imp index cdb34092e7..655eddcf53 100644 --- a/scripts/dev/iwyu-apple-clang.imp +++ b/scripts/dev/iwyu-apple-clang.imp @@ -8,7 +8,7 @@ { include: ["@<__algorithm/.*>", private, "", public ] }, { include: ["@<__chrono/.*>", private, "", public ] }, { include: ["@<__functional/.*>", private, "", public ] }, - { include: ["@<__fwd/string_view.h>", private, "", public ] }, + { include: ["@<__fwd/(.*)\\.h>", private, "<\\1>", public ] }, { include: ["@<__iterator/.*>", private, "", public ] }, { include: ["@<__memory/.*>", private, "", public ] }, { include: ["@<__mutex_base>", private, "", public ] }, diff --git a/scripts/dev/run-iwyu.sh b/scripts/dev/run-iwyu.sh index 8227cb3542..40ce06d985 100755 --- a/scripts/dev/run-iwyu.sh +++ b/scripts/dev/run-iwyu.sh @@ -43,5 +43,4 @@ if [ -z "${SKIP_FORMAT}" ]; then git add -u :/ SKIP_GCF=1 git commit --amend -m "IWYU+Clean" >/dev/null git reset HEAD^ - git co HEAD -- ":/src/celeritas/*/generated/*" fi diff --git a/scripts/docker/build.sh b/scripts/docker/build.sh index 9c4b5fc9e6..0af01d95a9 100755 --- a/scripts/docker/build.sh +++ b/scripts/docker/build.sh @@ -47,7 +47,9 @@ case $CONFIG in VECGEOM= ;; jammy-cuda11) - # ***IMPORTANT***: update cuda external version in dev/jammy-cuda11! + # ***IMPORTANT***: update the following after modification + # - cuda external version in dev/jammy-cuda11 + # - CI versions listed in README.md DOCKERFILE_DISTRO=ubuntu BASE_TAG=nvidia/cuda:11.8.0-devel-ubuntu22.04 VECGEOM=v1.2.5 diff --git a/scripts/env/perlmutter.sh b/scripts/env/perlmutter.sh index c7b0a80a53..1d5c997958 100755 --- a/scripts/env/perlmutter.sh +++ b/scripts/env/perlmutter.sh @@ -4,12 +4,13 @@ # If using Spack, this will cause a compile error in VecGeom+cuda. # Spack uses this CUDA install as external CUDA package and doesn't look in the math_libs directory for extra headers. # --> the fix for now is to unload these modules and install our own cudatoolkit using Spack. -module unload gpu cudatoolkit -module load PrgEnv-gnu/8.3.3 +module unload gpu +module load PrgEnv-gnu -# Spack module on Perlmutter currently fails to create the spack env from spack.yaml, we need Spack v0.18.0; use our own install instead. -# Expects the spack git repo to have been cloned at _SPACK_INSTALL and the environment celeritas to exist -_SPACK_INSTALL=${SCRATCH}/spack + +# Expects the spack git repo to have been cloned at _SPACK_INSTALL (default to $SPACK_ROOT) +# The environment named celeritas must exists +_SPACK_INSTALL=${SPACK_ROOT:-$SCRATCH/spack} _SPACK_SOURCE_FILE=${_SPACK_INSTALL}/share/spack/setup-env.sh if [ ! -f "${_SPACK_SOURCE_FILE}" ]; then echo "Expected to find a spack install at ${_SPACK_INSTALL}" >&2 @@ -18,4 +19,5 @@ fi . ${_SPACK_SOURCE_FILE} spack env activate celeritas -export LD_LIBRARY_PATH=$SPACK_ENV/.spack-env/view/lib64:$LD_LIBRARY_PATH \ No newline at end of file + +export PKG_CONFIG_PATH=/opt/cray/xpmem/default/lib64/pkgconfig:"${PKG_CONFIG_PATH}"