Skip to content

Commit

Permalink
build: Cleanup cmake options, fix detray plugin (#3509)
Browse files Browse the repository at this point in the history
- builtin boost is remove
- extern sources set up to actually check hashes
- detray sets up dfelibs (was removed)
- fix ordering: algebra-plugins needs to go before detray
- traccc doesn't specify cmake minimum version
- reorder options to be more readable
- preset tries to enable everything in the build
- detray and covfie plugins are removed in favor of a single traccc plugin

Blocked by:
- #3511
  • Loading branch information
paulgessinger authored Aug 15, 2024
1 parent 616c313 commit df0ab36
Show file tree
Hide file tree
Showing 34 changed files with 224 additions and 438 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Checks: '-*, \
readability-named-parameter, \
readability-operators-representation'
HeaderFilterRegex: '.*(?<!nlohmann\/json)\.(hpp|cpp|ipp)$'
AnalyzeTemporaryDtors: true
CheckOptions:
readability-operators-representation.BinaryOperators: '&&;&=;&;|;~;!;!=;||;|=;^;^='
readability-operators-representation.OverloadedOperators: '&&;&=;&;|;~;!;!=;||;|=;^;^='
4 changes: 2 additions & 2 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env:
jobs:
build_debug:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2404:53
container: ghcr.io/acts-project/ubuntu2404:58
steps:

- uses: actions/checkout@v4
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:

build_performance:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2404:53
container: ghcr.io/acts-project/ubuntu2404:58
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:
jobs:
linux_ubuntu:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2404:57
container: ghcr.io/acts-project/ubuntu2404:58
env:
INSTALL_DIR: ${{ github.workspace }}/install
ACTS_LOG_FAILURE_THRESHOLD: WARNING
Expand Down Expand Up @@ -59,7 +59,6 @@ jobs:
--preset=github-ci
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-DACTS_BUILD_PLUGIN_ONNX=ON
-DACTS_BUILD_PLUGIN_GEOMODEL=ON
- name: Build
run: cmake --build build
Expand Down Expand Up @@ -109,7 +108,7 @@ jobs:

linux_examples_test:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2404:57
container: ghcr.io/acts-project/ubuntu2404:58
needs: [linux_ubuntu]
env:
ACTS_SEQUENCER_DISABLE_FPEMON: true
Expand Down Expand Up @@ -146,7 +145,7 @@ jobs:
linux_physmon:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2404:57
container: ghcr.io/acts-project/ubuntu2404:58
needs: [linux_ubuntu]
env:
ACTS_SEQUENCER_DISABLE_FPEMON: true
Expand Down Expand Up @@ -233,7 +232,7 @@ jobs:
std: 20
- image: ubuntu2204_clang
std: 20
container: ghcr.io/acts-project/${{ matrix.image }}:57
container: ghcr.io/acts-project/${{ matrix.image }}:58
env:
INSTALL_DIR: ${{ github.workspace }}/install
ACTS_LOG_FAILURE_THRESHOLD: WARNING
Expand Down Expand Up @@ -349,8 +348,6 @@ jobs:
-DCMAKE_PREFIX_PATH="${{ env.DEPENDENCY_DIR }}"
-DPython_EXECUTABLE=${{ env.DEPENDENCY_DIR }}/bin/python3
-DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}"
-DACTS_BUILD_PLUGIN_GEOMODEL=ON
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON
- name: Build
run: cmake --build build
- name: ccache stats
Expand Down
23 changes: 12 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ variables:

clang_tidy:
stage: build
image: ghcr.io/acts-project/ubuntu2404:57
image: ghcr.io/acts-project/ubuntu2404:58
tags:
- large
artifacts:
Expand Down Expand Up @@ -55,7 +55,7 @@ clang_tidy:

build_exatrkx_cpu:
stage: build
image: ghcr.io/acts-project/ubuntu2204_exatrkx:52
image: ghcr.io/acts-project/ubuntu2204_exatrkx:58
tags:
- large

Expand Down Expand Up @@ -86,7 +86,7 @@ build_exatrkx_cpu:

build_exatrkx:
stage: build
image: ghcr.io/acts-project/ubuntu2204_exatrkx:52
image: ghcr.io/acts-project/ubuntu2204_exatrkx:58
tags:
- large

Expand Down Expand Up @@ -126,7 +126,7 @@ build_exatrkx:
# stage: test
# needs:
# - build_exatrkx
# image: ghcr.io/acts-project/ubuntu2204_exatrkx:52
# image: ghcr.io/acts-project/ubuntu2204_exatrkx:58
# tags:
# - docker-gpu-nvidia
# script:
Expand All @@ -136,7 +136,7 @@ build_exatrkx:
# stage: test
# needs:
# - build_exatrkx
# image: ghcr.io/acts-project/ubuntu2204_exatrkx:52
# image: ghcr.io/acts-project/ubuntu2204_exatrkx:58
# tags:
# - docker-gpu-nvidia
# script:
Expand All @@ -152,7 +152,7 @@ build_exatrkx:

build_linux_ubuntu:
stage: build
image: ghcr.io/acts-project/ubuntu2404:57
image: ghcr.io/acts-project/ubuntu2404:58

cache:
key: ccache-${CI_JOB_NAME_SLUG}-${HEAD_REF}-${CCACHE_KEY_SUFFIX}
Expand Down Expand Up @@ -191,7 +191,7 @@ build_linux_ubuntu:

linux_test_examples:
stage: test
image: ghcr.io/acts-project/ubuntu2404:57
image: ghcr.io/acts-project/ubuntu2404:58
needs: [build_linux_ubuntu]

script:
Expand All @@ -212,7 +212,7 @@ linux_test_examples:

linux_physmon:
stage: test
image: ghcr.io/acts-project/ubuntu2404:57
image: ghcr.io/acts-project/ubuntu2404:58
needs: [build_linux_ubuntu]

artifacts:
Expand Down Expand Up @@ -299,21 +299,21 @@ linux_ubuntu_2404:
<<: *linux_ubuntu_extra
variables:
CXXSTD: 20
image: ghcr.io/acts-project/ubuntu2404:57
image: ghcr.io/acts-project/ubuntu2404:58

linux_ubuntu_2204_clang:
<<: *linux_ubuntu_extra
variables:
CXXSTD: 20
image: ghcr.io/acts-project/ubuntu2204_clang:52
image: ghcr.io/acts-project/ubuntu2204_clang:58


######################
### LCG JOB MATRIX ###
######################

.lcg: &lcg_base_job
image: ghcr.io/acts-project/${OS}-base:57
image: ghcr.io/acts-project/${OS}-base:58
stage: build
tags:
- cvmfs
Expand Down Expand Up @@ -364,6 +364,7 @@ linux_ubuntu_2204_clang:
cmake -B build -S src
--preset=gitlab-ci
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-DACTS_BUILD_PLUGIN_GEOMODEL=OFF # GeoModel is not in LCG at this point
- ccache -z
- cmake --build build -- -j2
Expand Down
80 changes: 34 additions & 46 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,32 @@ option(ACTS_FORCE_ASSERTIONS "Force assertions regardless of build type" OFF)
option(ACTS_USE_SYSTEM_LIBS "Use system libraries by default" OFF)
# plugins related options
option(ACTS_USE_SYSTEM_ACTSVG "Use the ActSVG system library" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_GEOMODEL "Use a system-provided GeoModel installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_COVFIE "Use a system-provided covfie installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_DETRAY "Use a system-provided detray installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_TRACCC "Use a system-provided traccc installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_VECMEM "Use a system-provided vecmem installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_ALGEBRAPLUGINS "Use a system-provided algebra-plugins installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_NLOHMANN_JSON "Use nlohmann::json provided by the system instead of the bundled version" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_PYBIND11 "Use a system installation of pybind11" ${ACTS_USE_SYSTEM_LIBS} )
option(ACTS_USE_SYSTEM_EIGEN3 "Use a system-provided eigen3" ON)

option(ACTS_BUILD_PLUGIN_ACTSVG "Build SVG display plugin" OFF)
option(ACTS_BUILD_PLUGIN_CUDA "Build CUDA plugin" OFF)
option(ACTS_BUILD_PLUGIN_DD4HEP "Build DD4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_PODIO "Build Podio plugin" OFF)
option(ACTS_BUILD_PLUGIN_EDM4HEP "Build EDM4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_FPEMON "Build FPE monitoring plugin" OFF)
option(ACTS_BUILD_PLUGIN_GEOMODEL "Build GeoModel plugin" OFF)
option(ACTS_BUILD_PLUGIN_COVFIE "Build Covfie plugin" OFF)
option(ACTS_BUILD_PLUGIN_DETRAY "Build Detray plugin" OFF)
option(ACTS_BUILD_PLUGIN_TRACCC "Build Traccc plugin" OFF)
option(ACTS_USE_SYSTEM_GEOMODEL "Use a system-provided GeoModel installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_BUILD_PLUGIN_GEANT4 "Build Geant4 plugin" OFF)
option(ACTS_BUILD_PLUGIN_EXATRKX "Build the Exa.TrkX plugin" OFF)
option(ACTS_EXATRKX_ENABLE_ONNX "Build the Onnx backend for the exatrkx plugin" OFF)
option(ACTS_EXATRKX_ENABLE_TORCH "Build the torchscript backend for the exatrkx plugin" ON)
option(ACTS_EXATRKX_ENABLE_CUDA "Enable CUDA for the exatrkx plugin" OFF)
option(ACTS_BUILD_PLUGIN_JSON "Build json plugin" OFF)
option(ACTS_USE_SYSTEM_NLOHMANN_JSON "Use nlohmann::json provided by the system instead of the bundled version" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_BUILD_PLUGIN_LEGACY "Build legacy plugin" OFF)
option(ACTS_BUILD_PLUGIN_ONNX "Build ONNX plugin" OFF)
option(ACTS_USE_SYSTEM_COVFIE "Use a system-provided covfie installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_DETRAY "Use a system-provided detray installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_TRACCC "Use a system-provided traccc installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_VECMEM "Use a system-provided vecmem installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_USE_SYSTEM_ALGEBRAPLUGINS "Use a system-provided algebra-plugins installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_BUILD_PLUGIN_TGEO "Build TGeo plugin" OFF)
# fatras related options
option(ACTS_BUILD_FATRAS "Build FAst TRAcking Simulation package" OFF)
Expand All @@ -68,7 +69,6 @@ option(ACTS_BUILD_EXAMPLES_GEANT4 "Build Geant4-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_HEPMC3 "Build HepMC3-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_PYTHIA8 "Build Pythia8-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS "Build python bindings for the examples" OFF)
option(ACTS_USE_SYSTEM_PYBIND11 "Use a system installation of pybind11" ${ACTS_USE_SYSTEM_LIBS} )
option(ACTS_USE_EXAMPLES_TBB "Use Threading Building Blocks library in the examples" ON)
option(ACTS_BUILD_ANALYSIS_APPS "Build Analysis applications in the examples" OFF)
# test related options
Expand All @@ -86,9 +86,7 @@ option(ACTS_RUN_CLANG_TIDY "Run clang-tidy static analysis" OFF)
# other options
option(ACTS_BUILD_DOCS "Build documentation" OFF)
option(ACTS_SETUP_BOOST "Explicitly set up Boost for the project" ON)
option(ACTS_USE_SYSTEM_BOOST "Use a system-provided boost" ON)
option(ACTS_SETUP_EIGEN3 "Explicitly set up Eigen3 for the project" ON)
option(ACTS_USE_SYSTEM_EIGEN3 "Use a system-provided eigen3" ON)
option(ACTS_BUILD_ODD "Build the OpenDataDetector" OFF)
# profiling related optios
option(ACTS_ENABLE_CPU_PROFILING "Enable CPU profiling using gperftools" OFF)
Expand Down Expand Up @@ -148,15 +146,9 @@ set_option_if(
set_option_if(
ACTS_BUILD_PLUGIN_FPEMON
ACTS_BUILD_EXAMPLES)
set_option_if(
ACTS_BUILD_PLUGIN_DETRAY
ACTS_BUILD_PLUGIN_TRACCC)
set_option_if(
ACTS_BUILD_PLUGIN_JSON
ACTS_BUILD_PLUGIN_DETRAY)
set_option_if(
ACTS_BUILD_PLUGIN_COVFIE
ACTS_BUILD_PLUGIN_DETRAY)
ACTS_BUILD_PLUGIN_TRACCC)

# feature tests
include(CheckCXXSourceCompiles)
Expand Down Expand Up @@ -227,24 +219,20 @@ endif()

# required packages
if (ACTS_SETUP_BOOST)
if (ACTS_USE_SYSTEM_BOOST)
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()

# Enable both program_options and unit_test_framework to reduce complexity
# Also Cuda tests seem to use program_options
if( ACTS_BUILD_ANALYSIS_APPS OR ACTS_BUILD_UNITTESTS OR ACTS_BUILD_INTEGRATIONTESTS OR ACTS_BUILD_BENCHMARKS )
find_package(Boost ${_acts_boost_version} REQUIRED COMPONENTS program_options unit_test_framework)
else()
find_package(Boost ${_acts_boost_version} REQUIRED COMPONENTS)
endif()

if(Boost_VERSION VERSION_LESS _acts_boost_recommended_version)
message(WARNING "Found Boost ${Boost_VERSION} - recommended is at least ${_acts_boost_recommended_version}")
endif()
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()

# Enable both program_options and unit_test_framework to reduce complexity
# Also Cuda tests seem to use program_options
if( ACTS_BUILD_ANALYSIS_APPS OR ACTS_BUILD_UNITTESTS OR ACTS_BUILD_INTEGRATIONTESTS OR ACTS_BUILD_BENCHMARKS )
find_package(Boost ${_acts_boost_version} REQUIRED COMPONENTS program_options unit_test_framework)
else()
add_subdirectory(thirdparty/boost)
find_package(Boost ${_acts_boost_version} REQUIRED COMPONENTS)
endif()

if(Boost_VERSION VERSION_LESS _acts_boost_recommended_version)
message(WARNING "Found Boost ${Boost_VERSION} - recommended is at least ${_acts_boost_recommended_version}")
endif()
endif()

Expand Down Expand Up @@ -363,7 +351,14 @@ endif()
if(ACTS_BUILD_PLUGIN_GEANT4)
find_package(Geant4 REQUIRED CONFIG COMPONENTS gdml)
endif()
if(ACTS_BUILD_PLUGIN_DETRAY)

if(ACTS_BUILD_PLUGIN_TRACCC)
if (ACTS_USE_SYSTEM_ALGEBRAPLUGINS)
find_package(algebra-plugins ${_acts_algebraplugins_version} REQUIRED)
else()
add_subdirectory(thirdparty/algebra-plugins)
endif()

if(ACTS_USE_SYSTEM_DETRAY)
find_package(detray ${_acts_detray_version} REQUIRED CONFIG)
else()
Expand All @@ -378,20 +373,12 @@ if(ACTS_BUILD_PLUGIN_DETRAY)
include( "${VECMEM_LANGUAGE_DIR}/vecmem-check-language.cmake" )
endif()

if (ACTS_USE_SYSTEM_ALGEBRAPLUGINS)
find_package(algebra-plugins ${_acts_algebraplugins_version} REQUIRED)
else()
add_subdirectory(thirdparty/algebra-plugins)
endif()
endif()
if(ACTS_BUILD_PLUGIN_COVFIE)
if(ACTS_USE_SYSTEM_COVFIE)
find_package(covfie ${_acts_covfie_version} REQUIRED CONFIG)
else()
add_subdirectory(thirdparty/covfie)
endif()
endif()
if(ACTS_BUILD_PLUGIN_TRACCC)

# traccc also depends on vecmem and covfie, but those plugins should always
# be enabled if traccc is.
if(ACTS_USE_SYSTEM_TRACCC)
Expand All @@ -401,6 +388,7 @@ if(ACTS_BUILD_PLUGIN_TRACCC)
endif()
endif()


# examples dependencies
if(ACTS_BUILD_EXAMPLES)
set(THREADS_PREFER_PTHREAD_FLAG ON)
Expand Down
12 changes: 12 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,19 @@
"ACTS_BUILD_ALIGNMENT": "ON",
"ACTS_BUILD_FATRAS_GEANT4": "ON",
"ACTS_BUILD_PLUGIN_ACTSVG": "ON",
"ACTS_BUILD_PLUGIN_CUDA": "OFF",
"ACTS_BUILD_PLUGIN_DD4HEP": "ON",
"ACTS_BUILD_PLUGIN_PODIO": "ON",
"ACTS_BUILD_PLUGIN_EDM4HEP": "ON",
"ACTS_BUILD_PLUGIN_GEOMODEL": "ON",
"ACTS_BUILD_PLUGIN_TRACCC": "ON",
"ACTS_BUILD_PLUGIN_GEANT4": "ON",
"ACTS_BUILD_PLUGIN_EXATRKX": "OFF",
"ACTS_BUILD_PLUGIN_JSON": "ON",
"ACTS_BUILD_PLUGIN_ONNX": "OFF",
"ACTS_BUILD_PLUGIN_TGEO": "ON",
"ACTS_BUILD_EXAMPLES_EDM4HEP": "ON",
"ACTS_BUILD_EXAMPLES_EXATRKX": "OFF",
"ACTS_BUILD_EXAMPLES_GEANT4": "ON",
"ACTS_BUILD_EXAMPLES_HEPMC3": "ON",
"ACTS_BUILD_EXAMPLES_PYTHIA8": "ON"
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ else()
target_sources(ActsPythonBindings PRIVATE src/GeoModelStub.cpp)
endif()

if(ACTS_BUILD_PLUGIN_DETRAY)
if(ACTS_BUILD_PLUGIN_TRACCC)
target_link_libraries(ActsPythonBindings PUBLIC ActsPluginDetray)
target_sources(ActsPythonBindings PRIVATE src/Detray.cpp)
else()
Expand Down
4 changes: 3 additions & 1 deletion Examples/Python/src/GeoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// Must be on top to avoid some conflict between forward declare and typedef
// Needed until https://gitlab.cern.ch/GeoModelDev/GeoModel/-/merge_requests/351
// is deployed
// clang-format off
#include "GeoModelRead/ReadGeoModel.h"
#include <GeoModelRead/ReadGeoModel.h>
// clang-format on

#include "Acts/Detector/CylindricalContainerBuilder.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct SimulationActor {
void operator()(propagator_state_t &state, stepper_t &stepper,
navigator_t &navigator, result_type &result,
const Acts::Logger &logger) const {
assert(generator and "The generator pointer must be valid");
assert(generator && "The generator pointer must be valid");

// actors are called once more after the propagation terminated
if (!result.isAlive) {
Expand Down
Loading

0 comments on commit df0ab36

Please sign in to comment.