Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Change CMake settings for traccc deps #3620

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ 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_TRACCC "Build Traccc plugin" OFF)
option(ACTS_TRACCC_ENABLE_CUDA "Enable CUDA for the traccc plugin" OFF)
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)
Expand Down Expand Up @@ -439,14 +440,19 @@ if(ACTS_BUILD_PLUGIN_GEANT4)
endif()

if(ACTS_BUILD_PLUGIN_TRACCC)
# TODO: Algebra-plugins should set this up itself!
add_definitions(-DALGEBRA_PLUGINS_INCLUDE_ARRAY)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a global define? Could we define this on the target itself somehow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to fix this in acts-project/traccc#704.


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)
# TODO: Version requirement temporarily removed while detray sorts out
# their versioning.
find_package(detray REQUIRED CONFIG)
else()
add_subdirectory(thirdparty/detray)
endif()
Expand Down
21 changes: 10 additions & 11 deletions cmake/ActsConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ if (PluginHashing IN_LIST Acts_COMPONENTS)
find_dependency(Annoy @ANNOY_VERSION@ CONFIG EXACT)
endif()

if (PluginCovfie IN_LIST Acts_COMPONENTS OR PluginDetray IN_LIST Acts_COMPONENTS)
find_dependency(covfie @covfie_VERSION@ CONFIG EXACT)
endif()

if(PluginDetray IN_LIST Acts_COMPONENTS)
find_dependency(vecmem @vecmem_VERSION@ CONFIG EXACT)
find_dependency(algebra-plugins @algebra-plugins_VERSION@ CONFIG EXACT)
find_dependency(detray @detray_VERSION@ CONFIG EXACT)
endif()

# dependencies that we have built ourselves but cannot be
# straightforwardly handed to cmake
if(NOT @ACTS_USE_SYSTEM_BOOST@)
Expand All @@ -99,17 +109,6 @@ if(PluginPodio IN_LIST Acts_COMPONENTS)
include(${CMAKE_CURRENT_LIST_DIR}/ActsPodioEdmTargets.cmake)
endif()

if(PluginDetray IN_LIST Acts_COMPONENTS)
find_dependency(vecmem @vecmem_VERSION@ CONFIG EXACT)
find_dependency(covfie @cofvie_VERSION@ CONFIG EXACT)
find_dependency(algebra-plugins @algebra-plugins_VERSION@ CONFIG EXACT)
find_dependency(detray @detray_VERSION@ CONFIG EXACT)
endif()

if (PluginCovfie IN_LIST Acts_COMPONENTS)
find_dependency(covfie @covfie_VERSION@ CONFIG EXACT)
endif()

# load **all** available components. we can not just include the requested
# components since there can be interdependencies between them.
if(NOT Acts_FIND_QUIETLY)
Expand Down
1 change: 1 addition & 0 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ components.
| ACTS_BUILD_PLUGIN_FPEMON | Build FPE monitoring plugin<br> type: `bool`, default: `OFF` |
| ACTS_BUILD_PLUGIN_GEOMODEL | Build GeoModel plugin<br> type: `bool`, default: `OFF` |
| ACTS_BUILD_PLUGIN_TRACCC | Build Traccc plugin<br> type: `bool`, default: `OFF` |
| ACTS_TRACCC_ENABLE_CUDA | Enable CUDA for the traccc plugin<br> type: `bool`, default: `OFF` |
paulgessinger marked this conversation as resolved.
Show resolved Hide resolved
| ACTS_BUILD_PLUGIN_GEANT4 | Build Geant4 plugin<br> type: `bool`, default: `OFF` |
| ACTS_BUILD_PLUGIN_EXATRKX | Build the Exa.TrkX plugin<br> type: `bool`, default: `OFF` |
| ACTS_EXATRKX_ENABLE_ONNX | Build the Onnx backend for the exatrkx<br>plugin<br> type: `bool`, default: `OFF` |
Expand Down
5 changes: 5 additions & 0 deletions thirdparty/detray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ set(DETRAY_SETUP_DFELIBS
"Do not set up Dfelibs as part of Detray"
)
set(DETRAY_SVG_DISPLAY OFF CACHE BOOL "No not build the ActSVG display module")
set(DETRAY_BUILD_CUDA
${ACTS_TRACCC_ENABLE_CUDA}
CACHE BOOL
"Turn on/off the detray CUDA build"
)

#Now set up its build.
FetchContent_MakeAvailable(Detray)
6 changes: 6 additions & 0 deletions thirdparty/traccc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ set(TRACCC_BUILD_BENCHMARKS
CACHE BOOL
"Turn off the build of the Traccc benchmarks"
)
set(TRACCC_BUILD_IO OFF CACHE BOOL "Turn off the build of the Traccc IO code")
set(TRACCC_BUILD_CUDA
${ACTS_TRACCC_ENABLE_CUDA}
CACHE BOOL
"Turn on/off the traccc CUDA build"
)

# Now set up its build.
FetchContent_MakeAvailable(traccc)
5 changes: 5 additions & 0 deletions thirdparty/vecmem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ set(VECMEM_BUILD_BENCHMARKING
CACHE BOOL
"Turn off the build of VecMem benchmarking"
)
set(VECMEM_BUILD_CUDA_LIBRARY
${ACTS_TRACCC_ENABLE_CUDA}
CACHE BOOL
"Turn on/off the vecmem CUDA build"
)

# Now set up its build.
FetchContent_MakeAvailable(VecMem)
Loading