From bc3b548f8d16894fb2ff457a42669027b356aa6d Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Wed, 15 Oct 2025 16:19:04 +0200 Subject: [PATCH] Integrate ACTS v44.0.1 (with minimal changes) as an external Enable the plugins for SVG, Json, Root, DD4Hep, Geant4, Covfie, and Detray, and define individual tools for each Acts plugin and external library. Backport acts-project/acts#4357 to the v44.0.x branch: implement the Gen3 geometry to detray conversion. Backport acts-project/acts#4757 to the v44.0.x branch: Update namespace for Nlohmann Json v3.11 and later. Backport acts-project/acts#4758 to the v44.0.x branch: update Traccc to v0.26.0 to be compatible with Acts v44.0.x, with the corresponding external updates: - detary v0.103.0 - covfie v0.15.2 - vecmem v1.21.0 - algebra plugins v0.28.0 The update to detray v0.103.0 requires a change to DetrayIntersection type used in the Traccc examples. Target the CUDA architectures supported by CMSSW, while the HIP/ROCm support is not yet working correctly. --- acts.spec | 123 ++++++++++++++++++ cmssw-tools.spec | 1 + scram-tools.file/tools/acts/acts-common.xml | 11 ++ scram-tools.file/tools/acts/acts-core.xml | 7 + scram-tools.file/tools/acts/acts-covfie.xml | 6 + scram-tools.file/tools/acts/acts-dd4hep.xml | 18 +++ scram-tools.file/tools/acts/acts-detray.xml | 8 ++ scram-tools.file/tools/acts/acts-geant4.xml | 12 ++ scram-tools.file/tools/acts/acts-json.xml | 6 + scram-tools.file/tools/acts/acts-root.xml | 13 ++ scram-tools.file/tools/acts/acts-svg.xml | 6 + scram-tools.file/tools/acts/actsvg.xml | 6 + scram-tools.file/tools/acts/covfie.xml | 4 + scram-tools.file/tools/acts/detray.xml | 7 + scram-tools.file/tools/acts/traccc-cuda.xml | 8 ++ scram-tools.file/tools/acts/traccc-io.xml | 10 ++ .../tools/acts/traccc-performance.xml | 16 +++ scram-tools.file/tools/acts/traccc.xml | 12 ++ scram-tools.file/tools/acts/vecmem-cuda.xml | 6 + scram-tools.file/tools/acts/vecmem-rocm.xml | 6 + scram-tools.file/tools/acts/vecmem.xml | 8 ++ 21 files changed, 294 insertions(+) create mode 100644 acts.spec create mode 100644 scram-tools.file/tools/acts/acts-common.xml create mode 100644 scram-tools.file/tools/acts/acts-core.xml create mode 100644 scram-tools.file/tools/acts/acts-covfie.xml create mode 100644 scram-tools.file/tools/acts/acts-dd4hep.xml create mode 100644 scram-tools.file/tools/acts/acts-detray.xml create mode 100644 scram-tools.file/tools/acts/acts-geant4.xml create mode 100644 scram-tools.file/tools/acts/acts-json.xml create mode 100644 scram-tools.file/tools/acts/acts-root.xml create mode 100644 scram-tools.file/tools/acts/acts-svg.xml create mode 100644 scram-tools.file/tools/acts/actsvg.xml create mode 100644 scram-tools.file/tools/acts/covfie.xml create mode 100644 scram-tools.file/tools/acts/detray.xml create mode 100644 scram-tools.file/tools/acts/traccc-cuda.xml create mode 100644 scram-tools.file/tools/acts/traccc-io.xml create mode 100644 scram-tools.file/tools/acts/traccc-performance.xml create mode 100644 scram-tools.file/tools/acts/traccc.xml create mode 100644 scram-tools.file/tools/acts/vecmem-cuda.xml create mode 100644 scram-tools.file/tools/acts/vecmem-rocm.xml create mode 100644 scram-tools.file/tools/acts/vecmem.xml diff --git a/acts.spec b/acts.spec new file mode 100644 index 00000000000..1452dc8d260 --- /dev/null +++ b/acts.spec @@ -0,0 +1,123 @@ +### RPM external acts v44.0.1 +## INCLUDE cpp-standard +## INCLUDE microarch_flags +## INCLUDE compilation_flags +## INCLUDE compilation_flags_lto +## INCLUDE cuda-flags +## INCLUDE rocm-flags + +%define tag 2d4cf6938 +%define branch cms/%{realversion} +%define github_user cms-externals +Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz +Source99: scram-tools.file/tools/eigen/env + +# Do not build the Acts and Traccc tests +%define build_test 0 + +# ROCm support is not yet building correctly +%define without_rocm 1 + +BuildRequires: cmake +Requires: boost +Requires: dd4hep +Requires: eigen +Requires: expat +Requires: geant4 +Requires: json +Requires: python3 +Requires: root +Requires: xerces-c +Requires: zlib +%{!?without_cuda:Requires: cuda} +%{!?without_rocm:Requires: rocm} +%if %{build_test} +# These are ony used to build the examples and unit tests +Requires: hepmc3 +Requires: tbb +%endif + +%prep +%setup -n %{n}-%{realversion} + +%build +rm -rf ../build +mkdir ../build +cd ../build +source %{_sourcedir}/env + +%define cuda_enabled %{?without_cuda:OFF}%{!?without_cuda:ON} +%define rocm_enabled %{?without_rocm:OFF}%{!?without_rocm:ON} + +# Notes: +# - gcc-ar and gcc-ranlib are needed to build static libraries with LTO support. +# - building with RPATH enabled is necessary to build and run the tests; set CMAKE_SKIP_INSTALL_RPATH to strip the RPATH +# information after installing the libraries. +# - HIP/ROCm support is not yet working correctly. + +cmake ../%{n}-%{realversion} \ + -DCMAKE_PREFIX_PATH="%{cmake_prefix_path}" \ + -DCMAKE_CXX_COMPILER="$GCC_ROOT/bin/g++" \ + -DCMAKE_CXX_STANDARD="%{cms_cxx_standard}" \ + -DCMAKE_CXX_FLAGS="-fPIC $CMS_EIGEN_CXX_FLAGS %{arch_build_flags} %{selected_microarch} %{lto_build_flags}" \ + -DCMAKE_AR="$GCC_ROOT/bin/gcc-ar" \ + -DCMAKE_RANLIB="$GCC_ROOT/bin/gcc-ranlib" \ + -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INSTALL_PREFIX="%{i}" \ + -DCMAKE_SKIP_INSTALL_RPATH="ON" \ + -DCMAKE_CUDA_ARCHITECTURES="$(echo %{cuda_arch} | sed -e 's/ \+/;/g')" \ + -DCMAKE_CUDA_FLAGS="-Wno-deprecated-gpu-targets --threads 0" \ + -DCMAKE_HIP_ARCHITECTURES="$(echo %{rocm_archs} | sed -e 's/ \+/;/g')" \ + -DAMDGPU_TARGETS="$(echo %{rocm_archs} | sed -e 's/ \+/;/g')" \ + -DBUILD_SHARED_LIBS="ON" \ + -DACTS_NLOHMANNJSON_SOURCE="" \ + -DACTS_USE_SYSTEM_NLOHMANN_JSON="ON" \ + -DACTS_BUILD_PLUGIN_ACTSVG="ON" \ + -DACTS_BUILD_PLUGIN_JSON="ON" \ + -DACTS_BUILD_PLUGIN_ROOT="ON" \ + -DACTS_BUILD_PLUGIN_DD4HEP="ON" \ + -DACTS_BUILD_PLUGIN_GEANT4="ON" \ + -DACTS_BUILD_PLUGIN_TRACCC="ON" \ + -DACTS_ENABLE_LOG_FAILURE_THRESHOLD="ON" \ + -DCOVFIE_PLATFORM_CPU="ON" \ + -DCOVFIE_PLATFORM_CUDA="%{cuda_enabled}" \ + -DCOVFIE_PLATFORM_HIP="%{rocm_enabled}" \ + -DDETRAY_SETUP_NLOHMANN="ON" \ + -DDETRAY_USE_SYSTEM_NLOHMANN="ON" \ + -DDETRAY_BUILD_HOST="ON" \ + -DDETRAY_BUILD_CUDA="%{cuda_enabled}" \ + -DDETRAY_BUILD_HIP="%{rocm_enabled}" \ + -DTRACCC_BUILD_CUDA="%{cuda_enabled}" \ + -DTRACCC_BUILD_HIP="%{rocm_enabled}" \ + -DTRACCC_SETUP_THRUST="%{cuda_enabled}" \ + -DTRACCC_SETUP_ROCTHRUST="%{rocm_enabled}" \ + -DTRACCC_USE_SYSTEM_THRUST="%{cuda_enabled}" \ + -DTRACCC_USE_SYSTEM_ROCTHRUST="%{rocm_enabled}" \ + -DVECMEM_BUILD_CUDA_LIBRARY="%{cuda_enabled}" \ + -DVECMEM_BUILD_HIP_LIBRARY="%{rocm_enabled}" \ +%if %{build_test} + -DACTS_BUILD_UNITTESTS="ON" \ + -DACTS_BUILD_INTEGRATIONTESTS="ON" \ + -DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS="ON" \ + -DTRACCC_BUILD_TESTING="ON" \ +%endif + -L + +make %{makeprocesses} VERBOSE=1 + +%install +cd ../build +make install VERBOSE=1 + +%if %{build_test} +# download the traccc test data file to the .../data directory +mkdir -p %{i}/data +./_deps/traccc-src/data/traccc_data_get_files.sh -o %{i}/data +%endif + +# remove the scripts used to set the Acts environment variables +rm %{i}/bin/this_acts.sh +rm %{i}/bin/this_acts_withdeps.sh + +%post +%{relocateConfig}lib64/cmake/*/*.cmake diff --git a/cmssw-tools.spec b/cmssw-tools.spec index 19abc3797b2..4ae9ce2b035 100644 --- a/cmssw-tools.spec +++ b/cmssw-tools.spec @@ -8,6 +8,7 @@ Requires: AXOL1TL Requires: TOPO Requires: CICADA Requires: OpenBLAS +Requires: acts Requires: celeritas Requires: crab Requires: cmssw-wm-tools diff --git a/scram-tools.file/tools/acts/acts-common.xml b/scram-tools.file/tools/acts/acts-common.xml new file mode 100644 index 00000000000..212f34bc1a2 --- /dev/null +++ b/scram-tools.file/tools/acts/acts-common.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/scram-tools.file/tools/acts/acts-core.xml b/scram-tools.file/tools/acts/acts-core.xml new file mode 100644 index 00000000000..ad7e5f708a3 --- /dev/null +++ b/scram-tools.file/tools/acts/acts-core.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/scram-tools.file/tools/acts/acts-covfie.xml b/scram-tools.file/tools/acts/acts-covfie.xml new file mode 100644 index 00000000000..01da6e60484 --- /dev/null +++ b/scram-tools.file/tools/acts/acts-covfie.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/scram-tools.file/tools/acts/acts-dd4hep.xml b/scram-tools.file/tools/acts/acts-dd4hep.xml new file mode 100644 index 00000000000..c78f7e8d4ea --- /dev/null +++ b/scram-tools.file/tools/acts/acts-dd4hep.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/scram-tools.file/tools/acts/acts-detray.xml b/scram-tools.file/tools/acts/acts-detray.xml new file mode 100644 index 00000000000..224e2f0da67 --- /dev/null +++ b/scram-tools.file/tools/acts/acts-detray.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/scram-tools.file/tools/acts/acts-geant4.xml b/scram-tools.file/tools/acts/acts-geant4.xml new file mode 100644 index 00000000000..8bf051f99e8 --- /dev/null +++ b/scram-tools.file/tools/acts/acts-geant4.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/scram-tools.file/tools/acts/acts-json.xml b/scram-tools.file/tools/acts/acts-json.xml new file mode 100644 index 00000000000..a629c3147fc --- /dev/null +++ b/scram-tools.file/tools/acts/acts-json.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/scram-tools.file/tools/acts/acts-root.xml b/scram-tools.file/tools/acts/acts-root.xml new file mode 100644 index 00000000000..ba7926ab5b1 --- /dev/null +++ b/scram-tools.file/tools/acts/acts-root.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/scram-tools.file/tools/acts/acts-svg.xml b/scram-tools.file/tools/acts/acts-svg.xml new file mode 100644 index 00000000000..ecae63eb1df --- /dev/null +++ b/scram-tools.file/tools/acts/acts-svg.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/scram-tools.file/tools/acts/actsvg.xml b/scram-tools.file/tools/acts/actsvg.xml new file mode 100644 index 00000000000..7bde1e38a69 --- /dev/null +++ b/scram-tools.file/tools/acts/actsvg.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/scram-tools.file/tools/acts/covfie.xml b/scram-tools.file/tools/acts/covfie.xml new file mode 100644 index 00000000000..cb7e1127b30 --- /dev/null +++ b/scram-tools.file/tools/acts/covfie.xml @@ -0,0 +1,4 @@ + + + + diff --git a/scram-tools.file/tools/acts/detray.xml b/scram-tools.file/tools/acts/detray.xml new file mode 100644 index 00000000000..1c44e5e1ac4 --- /dev/null +++ b/scram-tools.file/tools/acts/detray.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/scram-tools.file/tools/acts/traccc-cuda.xml b/scram-tools.file/tools/acts/traccc-cuda.xml new file mode 100644 index 00000000000..ff22808a092 --- /dev/null +++ b/scram-tools.file/tools/acts/traccc-cuda.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/scram-tools.file/tools/acts/traccc-io.xml b/scram-tools.file/tools/acts/traccc-io.xml new file mode 100644 index 00000000000..6d5c28d6b16 --- /dev/null +++ b/scram-tools.file/tools/acts/traccc-io.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/scram-tools.file/tools/acts/traccc-performance.xml b/scram-tools.file/tools/acts/traccc-performance.xml new file mode 100644 index 00000000000..1029e59824d --- /dev/null +++ b/scram-tools.file/tools/acts/traccc-performance.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/scram-tools.file/tools/acts/traccc.xml b/scram-tools.file/tools/acts/traccc.xml new file mode 100644 index 00000000000..c37725cab14 --- /dev/null +++ b/scram-tools.file/tools/acts/traccc.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/scram-tools.file/tools/acts/vecmem-cuda.xml b/scram-tools.file/tools/acts/vecmem-cuda.xml new file mode 100644 index 00000000000..61acbafd447 --- /dev/null +++ b/scram-tools.file/tools/acts/vecmem-cuda.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/scram-tools.file/tools/acts/vecmem-rocm.xml b/scram-tools.file/tools/acts/vecmem-rocm.xml new file mode 100644 index 00000000000..aeca8501f5d --- /dev/null +++ b/scram-tools.file/tools/acts/vecmem-rocm.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/scram-tools.file/tools/acts/vecmem.xml b/scram-tools.file/tools/acts/vecmem.xml new file mode 100644 index 00000000000..b5f722f8ce5 --- /dev/null +++ b/scram-tools.file/tools/acts/vecmem.xml @@ -0,0 +1,8 @@ + + + + + + + +