From df0ab36396d6f03d23ae5beb16c5265dc9b20e82 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Thu, 15 Aug 2024 18:22:09 +0200 Subject: [PATCH] build: Cleanup cmake options, fix detray plugin (#3509) - 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 --- .clang-tidy | 1 - .github/workflows/analysis.yml | 4 +- .github/workflows/builds.yml | 11 +- .gitlab-ci.yml | 23 ++-- CMakeLists.txt | 80 +++++------ CMakePresets.json | 12 ++ Examples/Python/CMakeLists.txt | 2 +- Examples/Python/src/GeoModel.cpp | 4 +- .../Kernel/detail/SimulationActor.hpp | 2 +- Plugins/CMakeLists.txt | 2 +- Plugins/Detray/CMakeLists.txt | 1 + .../Plugins/Detray/DetrayConversionHelper.hpp | 125 ------------------ Plugins/Detray/src/DetrayConverter.cpp | 5 +- .../GeoModel/GeoModelBlueprintCreater.hpp | 8 +- .../detail/GenericGeoShapeConverter.hpp | 1 + .../GeoModel/detail/GeoBoxConverter.hpp | 6 +- .../GeoIntersectionAnnulusConverter.hpp | 6 +- .../GeoModel/detail/GeoShiftConverter.hpp | 7 +- .../GeoModel/detail/GeoTubeConverter.hpp | 11 +- .../detail/GeoUnionDoubleTrdConverter.hpp | 10 +- .../src/GeoModelDetectorSurfaceFactory.cpp | 7 +- .../GeoModel/src/detail/GeoShiftConverter.cpp | 7 + .../GeoModel/src/detail/GeoTubeConverter.cpp | 1 - .../src/detail/GeoUnionDoubleTrdConverter.cpp | 2 +- Plugins/Json/CMakeLists.txt | 3 +- .../Acts/Plugins/Json/DetrayJsonHelper.hpp | 82 +----------- Plugins/Json/src/DetrayJsonHelper.cpp | 88 ++++++++++++ .../Plugins/GeoModel/GeoBoxConverterTests.cpp | 3 +- cmake/ActsConfig.cmake.in | 1 + cmake/ActsExternSources.cmake | 21 ++- docs/getting_started.md | 21 ++- thirdparty/boost/CMakeLists.txt | 93 ------------- thirdparty/detray/CMakeLists.txt | 2 +- thirdparty/traccc/CMakeLists.txt | 10 +- 34 files changed, 224 insertions(+), 438 deletions(-) delete mode 100644 Plugins/Detray/include/Acts/Plugins/Detray/DetrayConversionHelper.hpp create mode 100644 Plugins/Json/src/DetrayJsonHelper.cpp delete mode 100644 thirdparty/boost/CMakeLists.txt diff --git a/.clang-tidy b/.clang-tidy index 8a4f9b20918..98e5bf4bb2f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -21,7 +21,6 @@ Checks: '-*, \ readability-named-parameter, \ readability-operators-representation' HeaderFilterRegex: '.*(? // clang-format on #include "Acts/Detector/CylindricalContainerBuilder.hpp" diff --git a/Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp b/Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp index 991b8bc8f89..ee8a5e3ba7a 100644 --- a/Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp +++ b/Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp @@ -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) { diff --git a/Plugins/CMakeLists.txt b/Plugins/CMakeLists.txt index b10ef860c2c..b0d006a61c1 100644 --- a/Plugins/CMakeLists.txt +++ b/Plugins/CMakeLists.txt @@ -10,7 +10,7 @@ add_component_if(Json PluginJson ACTS_BUILD_PLUGIN_JSON) add_component_if(Legacy PluginLegacy ACTS_BUILD_PLUGIN_LEGACY) add_component_if(Onnx PluginOnnx ACTS_BUILD_PLUGIN_ONNX) add_component_if(ExaTrkX PluginExaTrkX ACTS_BUILD_PLUGIN_EXATRKX) -add_component_if(Detray PluginDetray ACTS_BUILD_PLUGIN_DETRAY) +add_component_if(Detray PluginDetray ACTS_BUILD_PLUGIN_TRACCC) # dependent plugins. depend either on a independent plugins or on one another add_component_if(TGeo PluginTGeo ACTS_BUILD_PLUGIN_TGEO) diff --git a/Plugins/Detray/CMakeLists.txt b/Plugins/Detray/CMakeLists.txt index c04879d7c2e..3af182b7b7f 100644 --- a/Plugins/Detray/CMakeLists.txt +++ b/Plugins/Detray/CMakeLists.txt @@ -17,6 +17,7 @@ target_link_libraries( ActsPluginDetray PUBLIC ActsCore + ActsPluginJson detray::core detray::core_array detray::io diff --git a/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConversionHelper.hpp b/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConversionHelper.hpp deleted file mode 100644 index d3452bed680..00000000000 --- a/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConversionHelper.hpp +++ /dev/null @@ -1,125 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2023 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Surfaces/SurfaceBounds.hpp" -#include "Acts/Utilities/BinningData.hpp" - -#include -#include - -#include - -#include "detray/io/frontend/definitions.hpp" - -namespace Acts::DetrayConversionHelper { - -/// @brief Helper function to switch keys from ACTS to detray -/// -/// DETRAY types @todo change to detray imports when available -/// annulus2 = 0u, -/// cuboid3 = 1u, -/// cylinder2 = 2u, -/// cylinder3 = 3u, -/// portal_cylinder2 = 4u, -/// rectangle2 = 5u, -/// ring2 = 6u, -/// trapezoid2 = 7u, -/// cell_wire = 8u, -/// straw_wire = 9u, -/// single1 = 10u, -/// single2 = 11u, -/// single3 = 12u, -/// unknown = 13u -/// -/// @param sBounds is the surface bounds type -/// @param portal is the flag for conversion into detray portal format -/// -/// @return type and value array in detray format -inline static std::tuple> maskFromBounds( - const Acts::SurfaceBounds& sBounds, bool portal = false) { - auto bType = sBounds.type(); - auto bValues = sBounds.values(); - // Return value - unsigned int type = 13u; - std::vector boundaries = bValues; - // Special treatment for some portals - if (portal && bType == SurfaceBounds::BoundsType::eCylinder) { - boundaries = {bValues[0u], -bValues[1u], bValues[1u]}; - type = 4u; - } else { - switch (bType) { - case SurfaceBounds::BoundsType::eAnnulus: { - type = 0u; - } break; - case SurfaceBounds::BoundsType::eRectangle: { - type = 5u; - // ACTS: eMinX = 0, eMinY = 1, eMaxX = 2, eMaxY = 3, - // detray: e_half_x, e_half_y - boundaries = {0.5 * (bValues[2] - bValues[0]), - 0.5 * (bValues[3] - bValues[1])}; - } break; - case SurfaceBounds::BoundsType::eCylinder: { - boundaries = {bValues[0u], -bValues[1u], bValues[1u]}; - type = 2u; - } break; - case SurfaceBounds::BoundsType::eTrapezoid: { - type = 7u; - boundaries = {bValues[0u], bValues[1u], bValues[2u], - 1 / (2 * bValues[2u])}; - } break; - case SurfaceBounds::BoundsType::eDisc: { - boundaries = {bValues[0u], bValues[1u]}; - type = 6u; - } break; - default: - break; - } - } - return std::tie(type, boundaries); -} - -/// Determine the acceleration link from a grid -/// -/// @param casts are the grid axes cast types -/// -/// @return the acceleration link idnetifier -template -inline static std::size_t accelerationLink(const binning_values_t& casts) { - // Default is `brute_force` - std::size_t accLink = detray::io::accel_id::brute_force; - if (casts.size() == 2u) { - if (casts[0u] == Acts::BinningValue::binX && - casts[1u] == Acts::BinningValue::binY) { - accLink = detray::io::accel_id::cartesian2_grid; - } else if (casts[0u] == Acts::BinningValue::binR && - casts[1u] == Acts::BinningValue::binPhi) { - accLink = detray::io::accel_id::polar2_grid; - } else if (casts[0u] == Acts::BinningValue::binZ && - casts[1u] == Acts::BinningValue::binPhi) { - accLink = detray::io::accel_id::cylinder2_grid; - } else if (casts[0u] == Acts::BinningValue::binZ && - casts[1u] == Acts::BinningValue::binR) { - accLink = detray::io::accel_id::cylinder3_grid; - } - } else if (casts.size() == 3u) { - if (casts[0u] == Acts::BinningValue::binX && - casts[1u] == Acts::BinningValue::binY && - casts[2u] == Acts::BinningValue::binZ) { - accLink = detray::io::accel_id::cuboid3_grid; - } else if (casts[0u] == Acts::BinningValue::binZ && - casts[1u] == Acts::BinningValue::binPhi && - casts[2u] == Acts::BinningValue::binR) { - accLink = detray::io::accel_id::cylinder3_grid; - } - } - return accLink; -} - -} // namespace Acts::DetrayConversionHelper diff --git a/Plugins/Detray/src/DetrayConverter.cpp b/Plugins/Detray/src/DetrayConverter.cpp index 2aec9d55274..b4f19fcbaea 100644 --- a/Plugins/Detray/src/DetrayConverter.cpp +++ b/Plugins/Detray/src/DetrayConverter.cpp @@ -12,7 +12,7 @@ #include "Acts/Detector/DetectorVolume.hpp" #include "Acts/Detector/Portal.hpp" #include "Acts/Navigation/PortalNavigation.hpp" -#include "Acts/Plugins/Detray/DetrayConversionHelper.hpp" +#include "Acts/Plugins/Json/DetrayJsonHelper.hpp" #include "Acts/Surfaces/CylinderBounds.hpp" #include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/Surfaces/DiscSurface.hpp" @@ -69,8 +69,7 @@ detray::io::transform_payload Acts::DetrayConverter::convertTransform( detray::io::mask_payload Acts::DetrayConverter::convertMask( const Acts::SurfaceBounds& bounds, bool portal) { detray::io::mask_payload maskPayload; - auto [shape, boundaries] = - DetrayConversionHelper::maskFromBounds(bounds, portal); + auto [shape, boundaries] = DetrayJsonHelper::maskFromBounds(bounds, portal); maskPayload.shape = static_cast(shape); maskPayload.boundaries = static_cast>(boundaries); // default maskPayload.volume_link diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp index ccd9a0495da..7f832a4643a 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/GeoModelBlueprintCreater.hpp @@ -83,7 +83,7 @@ class GeoModelBlueprintCreater { /// bounds TEXT, internals TEXT, binnings TEXT, materials TEXT)") /// struct TableEntry { - int id; + int id{}; std::string type; std::string name; std::string bounds; @@ -116,13 +116,13 @@ class GeoModelBlueprintCreater { /// @param gctx the geometry context /// @param entry the table entry /// @param tableEntryMap the map of table entries allows construction of children - /// @param externalExtent an extent given from external parameters (e.g. mother volume) + /// @param motherExtent an extent given from external parameters (e.g. mother volume) /// /// @return a newly created node std::unique_ptr createNode( Cache& cache, const GeometryContext& gctx, const TableEntry& entry, const std::map& tableEntryMap, - const Extent& externalExtent = Extent()) const; + const Extent& motherExtent = Extent()) const; /// Create an IInternalStructureBuilder /// @@ -151,7 +151,7 @@ class GeoModelBlueprintCreater { std::tuple, Vector3> parseBounds(const std::string& boundsEntry, const Extent& externalExtent = Extent(), - const Extent& internalExtant = Extent()) const; + const Extent& internalExtent = Extent()) const; /// Private access to the logger const Logger& logger() const { return *m_logger; } diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GenericGeoShapeConverter.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GenericGeoShapeConverter.hpp index 617df570534..1115ee05545 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GenericGeoShapeConverter.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GenericGeoShapeConverter.hpp @@ -13,6 +13,7 @@ #include #include +#include namespace Acts::detail { diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoBoxConverter.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoBoxConverter.hpp index 1ed6f59950d..61190f88a38 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoBoxConverter.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoBoxConverter.hpp @@ -17,9 +17,8 @@ #include -namespace Acts { +namespace Acts::detail { -namespace detail { struct GeoBoxConverter { /// @brief Convert a GeoBox to a detector element and surface /// @@ -34,6 +33,5 @@ struct GeoBoxConverter { const Transform3& absTransform, bool sensitive) const; }; -} // namespace detail -} // namespace Acts +} // namespace Acts::detail diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoIntersectionAnnulusConverter.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoIntersectionAnnulusConverter.hpp index 3e79d9b116d..534f290a887 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoIntersectionAnnulusConverter.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoIntersectionAnnulusConverter.hpp @@ -17,9 +17,8 @@ #include -namespace Acts { +namespace Acts::detail { -namespace detail { struct GeoIntersectionAnnulusConverter { /// @brief Convert a GeoBox to a detector element and surface /// @@ -33,6 +32,5 @@ struct GeoIntersectionAnnulusConverter { const GeoFullPhysVol& geoFPV, const GeoShapeIntersection& geoIntersection, const Transform3& absTransform, bool sensitive) const; }; -} // namespace detail -} // namespace Acts +} // namespace Acts::detail diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoShiftConverter.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoShiftConverter.hpp index 96be34f6144..95a5cd2403a 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoShiftConverter.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoShiftConverter.hpp @@ -16,9 +16,7 @@ #include -namespace Acts { - -namespace detail { +namespace Acts::detail { struct GeoShiftConverter { /// @brief Convert a GeoBox to a detector element and surface @@ -34,6 +32,5 @@ struct GeoShiftConverter { const Transform3& absTransform, bool sensitive) const; }; -} // namespace detail -} // namespace Acts +} // namespace Acts::detail diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoTubeConverter.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoTubeConverter.hpp index c98b069777d..fe2f0f5adf3 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoTubeConverter.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoTubeConverter.hpp @@ -13,17 +13,11 @@ #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Result.hpp" -#include -#include - -#include - class GeoFullPhysVol; class GeoTube; -namespace Acts { +namespace Acts::detail { -namespace detail { struct GeoTubeConverter { Surface::SurfaceType targetShape = Surface::SurfaceType::Straw; @@ -40,6 +34,5 @@ struct GeoTubeConverter { const Transform3& absTransform, bool sensitive) const; }; -} // namespace detail -} // namespace Acts +} // namespace Acts::detail diff --git a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoUnionDoubleTrdConverter.hpp b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoUnionDoubleTrdConverter.hpp index c21f40a9f76..a8b651e7409 100644 --- a/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoUnionDoubleTrdConverter.hpp +++ b/Plugins/GeoModel/include/Acts/Plugins/GeoModel/detail/GeoUnionDoubleTrdConverter.hpp @@ -21,9 +21,8 @@ class GeoFullPhysVol; class GeoTube; -namespace Acts { +namespace Acts::detail { -namespace detail { struct GeoUnionDoubleTrdConverter { /// Merge trapezoids up to this gap double gapTolerance = 0.2; @@ -31,16 +30,15 @@ struct GeoUnionDoubleTrdConverter { /// @brief Convert a GeoTube to a detector element and surface /// /// @param geoFPV The full physical volume to convert (contains shape) - /// @param geoTube The GeoTube shape to convert + /// @param geoUnion The GeoUnion shape to convert /// @param absTransform from the GeoPhysVol /// @param bool sensitive /// /// @return The detector element and surface Result operator()(const GeoFullPhysVol& geoFPV, - const GeoShapeUnion& geoTube, + const GeoShapeUnion& geoUnion, const Transform3& absTransform, bool sensitive) const; }; -} // namespace detail -} // namespace Acts +} // namespace Acts::detail diff --git a/Plugins/GeoModel/src/GeoModelDetectorSurfaceFactory.cpp b/Plugins/GeoModel/src/GeoModelDetectorSurfaceFactory.cpp index f2250828d58..2b7553b0512 100644 --- a/Plugins/GeoModel/src/GeoModelDetectorSurfaceFactory.cpp +++ b/Plugins/GeoModel/src/GeoModelDetectorSurfaceFactory.cpp @@ -17,8 +17,6 @@ #include namespace { -std::string recType(const GeoShapeShift &gshift); -std::string recType(const GeoShapeUnion &gunion); std::string recType(const GeoShape &gshape); std::string recType(const GeoShapeShift &gshift) { @@ -37,6 +35,7 @@ std::string recType(const GeoShape &gshape) { } return gshape.type(); } + } // namespace Acts::GeoModelDetectorSurfaceFactory::GeoModelDetectorSurfaceFactory( @@ -44,8 +43,8 @@ Acts::GeoModelDetectorSurfaceFactory::GeoModelDetectorSurfaceFactory( : m_cfg(cfg), m_logger(std::move(mlogger)) {} void Acts::GeoModelDetectorSurfaceFactory::construct( - Cache &cache, const GeometryContext &, const GeoModelTree &geoModelTree, - const Options &options) { + Cache &cache, const GeometryContext & /*gctx*/, + const GeoModelTree &geoModelTree, const Options &options) { if (geoModelTree.geoReader == nullptr) { throw std::invalid_argument("GeoModelTree has no GeoModelReader"); } diff --git a/Plugins/GeoModel/src/detail/GeoShiftConverter.cpp b/Plugins/GeoModel/src/detail/GeoShiftConverter.cpp index 99cd173ba5b..ffba7e7c011 100644 --- a/Plugins/GeoModel/src/detail/GeoShiftConverter.cpp +++ b/Plugins/GeoModel/src/detail/GeoShiftConverter.cpp @@ -16,8 +16,13 @@ #include "Acts/Surfaces/StrawSurface.hpp" #include "Acts/Surfaces/TrapezoidBounds.hpp" +#include +#include + namespace Acts::detail { +namespace { + template Result impl(const GeoFullPhysVol& geoFPV, @@ -58,6 +63,8 @@ Result impl(const GeoFullPhysVol& geoFPV, return std::make_tuple(newEl, newSurface); } +} // namespace + Result GeoShiftConverter::operator()( const GeoFullPhysVol& geoFPV, const GeoShapeShift& geoShift, const Transform3& absTransform, bool sensitive) const { diff --git a/Plugins/GeoModel/src/detail/GeoTubeConverter.cpp b/Plugins/GeoModel/src/detail/GeoTubeConverter.cpp index c63ca616667..1ab1bb2233a 100644 --- a/Plugins/GeoModel/src/detail/GeoTubeConverter.cpp +++ b/Plugins/GeoModel/src/detail/GeoTubeConverter.cpp @@ -8,7 +8,6 @@ #include "Acts/Plugins/GeoModel/detail/GeoTubeConverter.hpp" -#include "Acts/Definitions/Common.hpp" #include "Acts/Definitions/Units.hpp" #include "Acts/Plugins/GeoModel/GeoModelConversionError.hpp" #include "Acts/Surfaces/CylinderBounds.hpp" diff --git a/Plugins/GeoModel/src/detail/GeoUnionDoubleTrdConverter.cpp b/Plugins/GeoModel/src/detail/GeoUnionDoubleTrdConverter.cpp index bd4f614850b..310c1c07963 100644 --- a/Plugins/GeoModel/src/detail/GeoUnionDoubleTrdConverter.cpp +++ b/Plugins/GeoModel/src/detail/GeoUnionDoubleTrdConverter.cpp @@ -52,7 +52,7 @@ Result GeoUnionDoubleTrdConverter::operator()( const auto shiftA = dynamic_cast(geoUnion.getOpA()); const auto shiftB = dynamic_cast(geoUnion.getOpB()); - if (!(shiftA && shiftB)) { + if (shiftA == nullptr || shiftB == nullptr) { return GeoModelConversionError::WrongShapeForConverter; } diff --git a/Plugins/Json/CMakeLists.txt b/Plugins/Json/CMakeLists.txt index 9cbeb06eb0e..3b7f495b1c5 100644 --- a/Plugins/Json/CMakeLists.txt +++ b/Plugins/Json/CMakeLists.txt @@ -19,7 +19,8 @@ add_library( src/UtilitiesJsonConverter.cpp src/VolumeBoundsJsonConverter.cpp src/VolumeJsonConverter.cpp - src/AmbiguityConfigJsonConverter.cpp) + src/AmbiguityConfigJsonConverter.cpp + src/DetrayJsonHelper.cpp) target_include_directories( ActsPluginJson PUBLIC diff --git a/Plugins/Json/include/Acts/Plugins/Json/DetrayJsonHelper.hpp b/Plugins/Json/include/Acts/Plugins/Json/DetrayJsonHelper.hpp index fe00fbc0aee..15f5f461963 100644 --- a/Plugins/Json/include/Acts/Plugins/Json/DetrayJsonHelper.hpp +++ b/Plugins/Json/include/Acts/Plugins/Json/DetrayJsonHelper.hpp @@ -9,9 +9,9 @@ #pragma once #include "Acts/Surfaces/SurfaceBounds.hpp" -#include "Acts/Utilities/BinningData.hpp" +#include "Acts/Utilities/BinningType.hpp" -#include +#include #include #include @@ -40,56 +40,14 @@ namespace Acts::DetrayJsonHelper { /// @param portal is the flag for conversion into detray portal format /// /// @return type and value array in detray format -inline static std::tuple> maskFromBounds( - const Acts::SurfaceBounds& sBounds, bool portal = false) { - auto bType = sBounds.type(); - auto bValues = sBounds.values(); - // Return value - unsigned int type = 13u; - std::vector boundaries = bValues; - // Special treatment for some portals - if (portal && bType == SurfaceBounds::BoundsType::eCylinder) { - boundaries = {bValues[0u], -bValues[1u], bValues[1u]}; - type = 4u; - } else { - switch (bType) { - case SurfaceBounds::BoundsType::eAnnulus: { - type = 0u; - } break; - case SurfaceBounds::BoundsType::eRectangle: { - type = 5u; - // ACTS: eMinX = 0, eMinY = 1, eMaxX = 2, eMaxY = 3, - // detray: e_half_x, e_half_y - boundaries = {0.5 * (bValues[2] - bValues[0]), - 0.5 * (bValues[3] - bValues[1])}; - } break; - case SurfaceBounds::BoundsType::eCylinder: { - boundaries = {bValues[0u], -bValues[1u], bValues[1u]}; - type = 2u; - } break; - case SurfaceBounds::BoundsType::eTrapezoid: { - type = 7u; - boundaries = {bValues[0u], bValues[1u], bValues[2u], - 1 / (2 * bValues[2u])}; - } break; - case SurfaceBounds::BoundsType::eDisc: { - boundaries = {bValues[0u], bValues[1u]}; - type = 6u; - } break; - default: - break; - } - } - return std::tie(type, boundaries); -} +std::tuple> maskFromBounds( + const Acts::SurfaceBounds& sBounds, bool portal = false); /// @brief add volume link /// /// @param jSurface [in,out] is the json object to be patched /// @param vLink is the volume link to be added -inline static void addVolumeLink(nlohmann::json& jSurface, int vLink) { - jSurface["volume_link"] = vLink; -} +void addVolumeLink(nlohmann::json& jSurface, int vLink); /// Determine the acceleration link from a grid /// @@ -104,34 +62,6 @@ inline static void addVolumeLink(nlohmann::json& jSurface, int vLink) { /// @param casts are the grid axes cast types /// /// @return the acceleration link idnetifier -template -inline static std::size_t accelerationLink(const binning_values_t& casts) { - // Default is `brute_force` - std::size_t accLink = 0u; - if (casts.size() == 2u) { - if (casts[0u] == BinningValue::binX && casts[1u] == BinningValue::binY) { - accLink = 1u; - } else if (casts[0u] == BinningValue::binR && - casts[1u] == BinningValue::binPhi) { - accLink = 3u; - } else if (casts[0u] == BinningValue::binZ && - casts[1u] == BinningValue::binPhi) { - accLink = 4u; - } else if (casts[0u] == BinningValue::binZ && - casts[1u] == BinningValue::binR) { - accLink = 5u; - } - } else if (casts.size() == 3u) { - if (casts[0u] == BinningValue::binX && casts[1u] == BinningValue::binY && - casts[2u] == BinningValue::binZ) { - accLink = 2u; - } else if (casts[0u] == BinningValue::binZ && - casts[1u] == BinningValue::binPhi && - casts[2u] == BinningValue::binR) { - accLink = 5u; - } - } - return accLink; -} +std::size_t accelerationLink(std::span casts); } // namespace Acts::DetrayJsonHelper diff --git a/Plugins/Json/src/DetrayJsonHelper.cpp b/Plugins/Json/src/DetrayJsonHelper.cpp new file mode 100644 index 00000000000..50c6a3639d9 --- /dev/null +++ b/Plugins/Json/src/DetrayJsonHelper.cpp @@ -0,0 +1,88 @@ +// This file is part of the Acts project. +// +// Copyright (C) 2024 CERN for the benefit of the Acts project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#include "Acts/Plugins/Json/DetrayJsonHelper.hpp" + +namespace Acts::DetrayJsonHelper { + +std::tuple> maskFromBounds( + const Acts::SurfaceBounds& sBounds, bool portal) { + auto bType = sBounds.type(); + auto bValues = sBounds.values(); + // Return value + unsigned int type = 13u; + std::vector boundaries = bValues; + // Special treatment for some portals + if (portal && bType == SurfaceBounds::BoundsType::eCylinder) { + boundaries = {bValues[0u], -bValues[1u], bValues[1u]}; + type = 4u; + } else { + switch (bType) { + case SurfaceBounds::BoundsType::eAnnulus: { + type = 0u; + } break; + case SurfaceBounds::BoundsType::eRectangle: { + type = 5u; + // ACTS: eMinX = 0, eMinY = 1, eMaxX = 2, eMaxY = 3, + // detray: e_half_x, e_half_y + boundaries = {0.5 * (bValues[2] - bValues[0]), + 0.5 * (bValues[3] - bValues[1])}; + } break; + case SurfaceBounds::BoundsType::eCylinder: { + boundaries = {bValues[0u], -bValues[1u], bValues[1u]}; + type = 2u; + } break; + case SurfaceBounds::BoundsType::eTrapezoid: { + type = 7u; + boundaries = {bValues[0u], bValues[1u], bValues[2u], + 1 / (2 * bValues[2u])}; + } break; + case SurfaceBounds::BoundsType::eDisc: { + boundaries = {bValues[0u], bValues[1u]}; + type = 6u; + } break; + default: + break; + } + } + return std::tie(type, boundaries); +} + +void addVolumeLink(nlohmann::json& jSurface, int vLink) { + jSurface["volume_link"] = vLink; +} + +std::size_t accelerationLink(std::span casts) { + // Default is `brute_force` + std::size_t accLink = 0u; + if (casts.size() == 2u) { + if (casts[0u] == BinningValue::binX && casts[1u] == BinningValue::binY) { + accLink = 1u; + } else if (casts[0u] == BinningValue::binR && + casts[1u] == BinningValue::binPhi) { + accLink = 3u; + } else if (casts[0u] == BinningValue::binZ && + casts[1u] == BinningValue::binPhi) { + accLink = 4u; + } else if (casts[0u] == BinningValue::binZ && + casts[1u] == BinningValue::binR) { + accLink = 5u; + } + } else if (casts.size() == 3u) { + if (casts[0u] == BinningValue::binX && casts[1u] == BinningValue::binY && + casts[2u] == BinningValue::binZ) { + accLink = 2u; + } else if (casts[0u] == BinningValue::binZ && + casts[1u] == BinningValue::binPhi && + casts[2u] == BinningValue::binR) { + accLink = 5u; + } + } + return accLink; +} +} // namespace Acts::DetrayJsonHelper diff --git a/Tests/UnitTests/Plugins/GeoModel/GeoBoxConverterTests.cpp b/Tests/UnitTests/Plugins/GeoModel/GeoBoxConverterTests.cpp index 8c899c9107a..f93437a4580 100644 --- a/Tests/UnitTests/Plugins/GeoModel/GeoBoxConverterTests.cpp +++ b/Tests/UnitTests/Plugins/GeoModel/GeoBoxConverterTests.cpp @@ -22,8 +22,7 @@ #include #include #include - -#include "GeoModelKernel/GeoVPhysVol.h" +#include Acts::GeometryContext tContext; Acts::RotationMatrix3 idRotation = Acts::RotationMatrix3::Identity(); diff --git a/cmake/ActsConfig.cmake.in b/cmake/ActsConfig.cmake.in index 6e4fcb5e06e..127d8b14786 100644 --- a/cmake/ActsConfig.cmake.in +++ b/cmake/ActsConfig.cmake.in @@ -98,6 +98,7 @@ 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() diff --git a/cmake/ActsExternSources.cmake b/cmake/ActsExternSources.cmake index f37387cef8b..70920a42663 100644 --- a/cmake/ActsExternSources.cmake +++ b/cmake/ActsExternSources.cmake @@ -1,25 +1,25 @@ set( ACTS_ACTSVG_SOURCE - "URL;https://github.com/acts-project/actsvg/archive/refs/tags/v0.4.40.tar.gz;URL_MD5;c8f3a7ac47db7f39cd4f215a5bbf148d" CACHE STRING "Source to take ACTSVG from") + "URL;https://github.com/acts-project/actsvg/archive/refs/tags/v0.4.47.tar.gz;URL_HASH;SHA256=aeb3927f8db1c7c9b8afa76adaa720013aa03a01032c8d5f457f623e2b04a172" CACHE STRING "Source to take ACTSVG from") mark_as_advanced( ACTS_ACTSVG_SOURCE ) set( ACTS_VECMEM_SOURCE - "URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.4.0.tar.gz;URL_MD5;af5434e34ca9c084678c2c043441f174" CACHE STRING "Source to take VECMEM from") + "URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.4.0.tar.gz;URL_HASH;SHA256=545dfb4de4f9f3d773eef6a0e3297ebf981bb81950930d0991ad739e31ab16af" CACHE STRING "Source to take VECMEM from") mark_as_advanced( ACTS_VECMEM_SOURCE ) set( ACTS_ALGEBRAPLUGINS_SOURCE - "URL;https://github.com/acts-project/algebra-plugins/archive/refs/tags/v0.22.0.tar.gz;URL_MD5;42bcaad8d19a2c773993a974816dfdf5" CACHE STRING "Source to take ALGEBRAPLUGINS from") + "URL;https://github.com/acts-project/algebra-plugins/archive/refs/tags/v0.22.0.tar.gz;URL_HASH;SHA256=6fde02181c1b856c0a17a1925f0969798eecd5e3d6f2a87ea2eb365b6c948cc1" CACHE STRING "Source to take ALGEBRAPLUGINS from") mark_as_advanced( ACTS_ALGEBRAPLUGINS_SOURCE ) set( ACTS_COVFIE_SOURCE - "URL;https://github.com/acts-project/covfie/archive/refs/tags/v0.10.0.tar.gz;URL_MD5;af59c6e2a1eebfa765b29f0af9fc70f7" CACHE STRING "Source to take COVFIE from") + "URL;https://github.com/acts-project/covfie/archive/refs/tags/v0.10.0.tar.gz;URL_HASH;SHA256=d44142b302ffc193ad2229f1d2cc6d8d720dd9da8c37989ada4f23018f86c964" CACHE STRING "Source to take COVFIE from") mark_as_advanced( ACTS_COVFIE_SOURCE ) set( ACTS_DETRAY_SOURCE - "URL;https://github.com/acts-project/detray/archive/refs/tags/v0.72.1.tar.gz;URL_MD5;342ab0bfba45c5764c8eef3842897c16" CACHE STRING "Source to take DETRAY from") + "URL;https://github.com/acts-project/detray/archive/refs/tags/v0.72.1.tar.gz;URL_HASH;SHA256=6cc8d34bc0d801338e9ab142c4a9884d19d9c02555dbb56972fab86b98d0f75b" CACHE STRING "Source to take DETRAY from") mark_as_advanced( ACTS_DETRAY_SOURCE ) set( ACTS_TRACCC_SOURCE - "URL;https://github.com/acts-project/traccc/archive/refs/tags/v0.13.0.tar.gz;URL_MD5;1ddf757ddcbaa08fd7db3a7752ef7f98" CACHE STRING "Source to take TRACCC from") + "URL;https://github.com/acts-project/traccc/archive/refs/tags/v0.15.0.tar.gz;URL_HASH;SHA256=1a9a1d0d2f6c4a7773eae3119b1e044fb52031ca49dfc88e6dc4ab8a11df167e" CACHE STRING "Source to take TRACCC from") mark_as_advanced( ACTS_TRACCC_SOURCE ) set( ACTS_FRNN_SOURCE @@ -27,16 +27,11 @@ set( ACTS_FRNN_SOURCE mark_as_advanced( ACTS_FRNN_SOURCE ) set( ACTS_NLOHMANNJSON_SOURCE - "URL;https://github.com/nlohmann/json/archive/refs/tags/v3.10.5.tar.gz;URL_HASH;SHA1=8969f5ad1a422e01f040ff48dcae9c0e6ad0811d" CACHE STRING "Source to take nlohmann_json from") + "URL;https://github.com/nlohmann/json/archive/refs/tags/v3.10.5.tar.gz;URL_HASH;SHA256=5daca6ca216495edf89d167f808d1d03c4a4d929cef7da5e10f135ae1540c7e4" CACHE STRING "Source to take nlohmann_json from") mark_as_advanced( ACTS_NLOHMANN_JSON_SOURCE ) -string(REPLACE "." "_" _acts_boost_recommended_version_ ${_acts_boost_recommended_version}) -set( ACTS_BOOST_SOURCE - "URL;https://boostorg.jfrog.io/artifactory/main/release/${_acts_boost_recommended_version}/source/boost_${_acts_boost_recommended_version_}.tar.gz" CACHE STRING "Source to take boost from") -mark_as_advanced( ACTS_BOOST_SOURCE ) - set( ACTS_EIGEN3_SOURCE - "URL;https://gitlab.com/libeigen/eigen/-/archive/${_acts_eigen3_version}/${_acts_eigen3_version}.tar.gz" CACHE STRING "Source to take eigen3 from") + "URL;https://gitlab.com/libeigen/eigen/-/archive/${_acts_eigen3_version}/${_acts_eigen3_version}.tar.gz;URL_HASH;SHA256=ba6ef66ba2d319e0a871a267889411c550d4bdf5bc7c62f86c60276913f3f4ba" CACHE STRING "Source to take eigen3 from") mark_as_advanced( ACTS_EIGEN3_SOURCE ) set( ACTS_PYBIND11_SOURCE diff --git a/docs/getting_started.md b/docs/getting_started.md index 29cc8bae650..ea8c669f5ac 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -262,6 +262,15 @@ components. | ACTS_FORCE_ASSERTIONS | Force assertions regardless of build
type
type: `bool`, default: `OFF` | | ACTS_USE_SYSTEM_LIBS | Use system libraries by default
type: `bool`, default: `OFF` | | ACTS_USE_SYSTEM_ACTSVG | Use the ActSVG system library
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_GEOMODEL | Use a system-provided GeoModel
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_COVFIE | Use a system-provided covfie
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_DETRAY | Use a system-provided detray
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_TRACCC | Use a system-provided traccc
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_VECMEM | Use a system-provided vecmem
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_ALGEBRAPLUGINS | Use a system-provided algebra-plugins
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_NLOHMANN_JSON | Use nlohmann::json provided by the
system instead of the bundled version
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_PYBIND11 | Use a system installation of pybind11
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | +| ACTS_USE_SYSTEM_EIGEN3 | Use a system-provided eigen3
type: `bool`, default: `ON` | | ACTS_BUILD_PLUGIN_ACTSVG | Build SVG display plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_PLUGIN_CUDA | Build CUDA plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_PLUGIN_DD4HEP | Build DD4hep plugin
type: `bool`, default: `OFF` | @@ -269,24 +278,15 @@ components. | ACTS_BUILD_PLUGIN_EDM4HEP | Build EDM4hep plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_PLUGIN_FPEMON | Build FPE monitoring plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_PLUGIN_GEOMODEL | Build GeoModel plugin
type: `bool`, default: `OFF` | -| ACTS_BUILD_PLUGIN_COVFIE | Build Covfie plugin
type: `bool`, default: `OFF` | -| ACTS_BUILD_PLUGIN_DETRAY | Build Detray plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_PLUGIN_TRACCC | Build Traccc plugin
type: `bool`, default: `OFF` | -| ACTS_USE_SYSTEM_GEOMODEL | Use a system-provided GeoModel
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | | ACTS_BUILD_PLUGIN_GEANT4 | Build Geant4 plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_PLUGIN_EXATRKX | Build the Exa.TrkX plugin
type: `bool`, default: `OFF` | | ACTS_EXATRKX_ENABLE_ONNX | Build the Onnx backend for the exatrkx
plugin
type: `bool`, default: `OFF` | | ACTS_EXATRKX_ENABLE_TORCH | Build the torchscript backend for the
exatrkx plugin
type: `bool`, default: `ON` | | ACTS_EXATRKX_ENABLE_CUDA | Enable CUDA for the exatrkx plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_PLUGIN_JSON | Build json plugin
type: `bool`, default: `OFF` | -| ACTS_USE_SYSTEM_NLOHMANN_JSON | Use nlohmann::json provided by the
system instead of the bundled version
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | | ACTS_BUILD_PLUGIN_LEGACY | Build legacy plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_PLUGIN_ONNX | Build ONNX plugin
type: `bool`, default: `OFF` | -| ACTS_USE_SYSTEM_COVFIE | Use a system-provided covfie
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | -| ACTS_USE_SYSTEM_DETRAY | Use a system-provided detray
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | -| ACTS_USE_SYSTEM_TRACCC | Use a system-provided traccc
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | -| ACTS_USE_SYSTEM_VECMEM | Use a system-provided vecmem
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | -| ACTS_USE_SYSTEM_ALGEBRAPLUGINS | Use a system-provided algebra-plugins
installation
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | | ACTS_BUILD_PLUGIN_TGEO | Build TGeo plugin
type: `bool`, default: `OFF` | | ACTS_BUILD_FATRAS | Build FAst TRAcking Simulation package
type: `bool`, default: `OFF` | | ACTS_BUILD_FATRAS_GEANT4 | Build Geant4 Fatras package
type: `bool`, default: `OFF` | @@ -298,7 +298,6 @@ components. | ACTS_BUILD_EXAMPLES_HEPMC3 | Build HepMC3-based code in the examples
type: `bool`, default: `OFF` | | ACTS_BUILD_EXAMPLES_PYTHIA8 | Build Pythia8-based code in the examples
type: `bool`, default: `OFF` | | ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS | Build python bindings for the examples
type: `bool`, default: `OFF` | -| ACTS_USE_SYSTEM_PYBIND11 | Use a system installation of pybind11
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | | ACTS_USE_EXAMPLES_TBB | Use Threading Building Blocks library in
the examples
type: `bool`, default: `ON` | | ACTS_BUILD_ANALYSIS_APPS | Build Analysis applications in the
examples
type: `bool`, default: `OFF` | | ACTS_BUILD_BENCHMARKS | Build benchmarks
type: `bool`, default: `OFF` | @@ -309,9 +308,7 @@ components. | ACTS_RUN_CLANG_TIDY | Run clang-tidy static analysis
type: `bool`, default: `OFF` | | ACTS_BUILD_DOCS | Build documentation
type: `bool`, default: `OFF` | | ACTS_SETUP_BOOST | Explicitly set up Boost for the project
type: `bool`, default: `ON` | -| ACTS_USE_SYSTEM_BOOST | Use a system-provided boost
type: `bool`, default: `ON` | | ACTS_SETUP_EIGEN3 | Explicitly set up Eigen3 for the project
type: `bool`, default: `ON` | -| ACTS_USE_SYSTEM_EIGEN3 | Use a system-provided eigen3
type: `bool`, default: `ON` | | ACTS_BUILD_ODD | Build the OpenDataDetector
type: `bool`, default: `OFF` | | ACTS_ENABLE_CPU_PROFILING | Enable CPU profiling using gperftools
type: `bool`, default: `OFF` | | ACTS_ENABLE_MEMORY_PROFILING | Enable memory profiling using gperftools
type: `bool`, default: `OFF` | diff --git a/thirdparty/boost/CMakeLists.txt b/thirdparty/boost/CMakeLists.txt deleted file mode 100644 index 94c51b9dbca..00000000000 --- a/thirdparty/boost/CMakeLists.txt +++ /dev/null @@ -1,93 +0,0 @@ -message(STATUS "Building Boost ${_acts_boost_recommended_version}") - -include(ExternalProject) - -string(REPLACE "." "_" _acts_boost_recommended_version_ ${_acts_boost_recommended_version}) -set(Boost_LIBRARY_LIST "filesystem,program_options,test") -set(Boost_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/boost-prefix/src/boost) -set(Boost_INCLUDE_DIR ${Boost_SOURCE_DIR}) -set(Boost_LIBRARY_DIR ${Boost_SOURCE_DIR}/stage/lib) -set(Boost_B2_CXXFLAGS -std=c++17\ -fPIC\ -O3) -set(Boost_B2_FLAGS variant=release threading=multi runtime-link=shared link=shared cxxflags=${Boost_B2_CXXFLAGS}) - -# Target for boost headers - -# Note: Since all builds below depend on the headers, use this step to -# download the boost release - -ExternalProject_Add( boost "${ACTS_BOOST_SOURCE};CONFIGURE_COMMAND;;BUILD_COMMAND;;INSTALL_COMMAND;" ) - -add_library(Boost::boost INTERFACE IMPORTED GLOBAL) -add_dependencies(Boost::boost boost) -target_include_directories(Boost::boost INTERFACE ${Boost_INCLUDE_DIR}) -install(DIRECTORY ${Boost_INCLUDE_DIR}/boost DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - -# Target for bootstrap step - -# Note: Required by all builds but not by header-only target, so need -# a separate target - -# Note: Re-use ExternalProject_Add instead of Add_Step because I can't -# figure out how to avoid race conditions and duplicate downloads with -# Add_Step targets. From cmake's point of view they will all be -# different project but they all use the same working directory, so it -# does the right thing. (L-G) - -ExternalProject_Add( - boost_bootstrap - DOWNLOAD_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND ./bootstrap.sh --with-libraries=${Boost_LIBRARY_LIST} - INSTALL_COMMAND "" - DEPENDS boost - LOG_BUILD true - SOURCE_DIR ${Boost_SOURCE_DIR} - BUILD_IN_SOURCE true - EXCLUDE_FROM_ALL true -) - -# Target for Boost::program_options - -ExternalProject_Add( - boost_build_program_options - DOWNLOAD_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND ./b2 ${Boost_B2_FLAGS} --with-program_options - INSTALL_COMMAND "" - DEPENDS boost_bootstrap - SOURCE_DIR ${Boost_SOURCE_DIR} - LOG_BUILD true - BUILD_IN_SOURCE true - BUILD_BYPRODUCTS ${Boost_LIBRARY_DIR}/libboost_program_options.so.${_acts_boost_recommended_version} - EXCLUDE_FROM_ALL true -) - -add_library(boost_program_options SHARED IMPORTED GLOBAL) -target_link_libraries(boost_program_options INTERFACE Boost::boost) -set_target_properties(boost_program_options PROPERTIES IMPORTED_LOCATION ${Boost_LIBRARY_DIR}/libboost_program_options.so.${_acts_boost_recommended_version}) -add_dependencies(boost_program_options boost_build_program_options) -add_library(Boost::program_options ALIAS boost_program_options) -install(FILES ${Boost_LIBRARY_DIR}/libboost_program_options.so.${_acts_boost_recommended_version} DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) - -# Target for Boost::unit_test_framework - -ExternalProject_Add( - boost_build_unit_test_framework - DOWNLOAD_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND ./b2 ${Boost_B2_FLAGS} --with-test - INSTALL_COMMAND "" - DEPENDS boost_bootstrap - SOURCE_DIR ${Boost_SOURCE_DIR} - LOG_BUILD true - BUILD_IN_SOURCE true - BUILD_BYPRODUCTS ${Boost_LIBRARY_DIR}/libboost_unit_test_framework.so.${_acts_boost_recommended_version} - EXCLUDE_FROM_ALL true -) - -add_library(boost_unit_test_framework SHARED IMPORTED GLOBAL) -target_link_libraries(boost_unit_test_framework INTERFACE Boost::boost) -set_target_properties(boost_unit_test_framework PROPERTIES IMPORTED_LOCATION ${Boost_LIBRARY_DIR}/libboost_unit_test_framework.so.${_acts_boost_recommended_version}) -add_dependencies(boost_unit_test_framework boost_build_unit_test_framework) -add_library(Boost::unit_test_framework ALIAS boost_unit_test_framework) -install(FILES ${Boost_LIBRARY_DIR}/libboost_unit_test_framework.so.${_acts_boost_recommended_version} DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) diff --git a/thirdparty/detray/CMakeLists.txt b/thirdparty/detray/CMakeLists.txt index 97d920da144..c93c79cc72e 100644 --- a/thirdparty/detray/CMakeLists.txt +++ b/thirdparty/detray/CMakeLists.txt @@ -52,7 +52,7 @@ set( DETRAY_SETUP_NLOHMANN OFF CACHE BOOL "Do not set up Nlohmann as part of Detray" ) set( DETRAY_SETUP_ACTSVG OFF CACHE BOOL "Do not set up Actsvg as part of Detray" ) -set( DETRAY_SETUP_DFELIBS OFF CACHE BOOL +set( DETRAY_SETUP_DFELIBS ON CACHE BOOL "Do not set up Dfelibs as part of Detray" ) set( DETRAY_SVG_DISPLAY OFF CACHE BOOL "No not build the ActSVG display module" ) diff --git a/thirdparty/traccc/CMakeLists.txt b/thirdparty/traccc/CMakeLists.txt index 06c434e938f..a33636c9c8d 100644 --- a/thirdparty/traccc/CMakeLists.txt +++ b/thirdparty/traccc/CMakeLists.txt @@ -7,16 +7,18 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # CMake include(s). -cmake_minimum_required(VERSION 3.14) include(FetchContent) # Tell the user what's happening. -message( STATUS "Building tracc as part of the Acts project" ) +message( STATUS "Building traccc as part of the Acts project" ) set( TRACCC_VERSION "${_acts_traccc_version}") # Declare where to get traccc from. -FetchContent_Declare( traccc ${ACTS_TRACCC_SOURCE} ) +FetchContent_Declare( + traccc + ${ACTS_TRACCC_SOURCE} +) if(ACTS_CUSTOM_SCALARTYPE) set(ACTS_TRACCC_SCALARTYPE ${ACTS_CUSTOM_SCALARTYPE}) @@ -50,6 +52,8 @@ set( TRACCC_BUILD_TESTING OFF CACHE BOOL "Turn off the build of the Traccc unit tests" ) set( TRACCC_BUILD_EXAMPLES OFF CACHE BOOL "Turn off the build of the Traccc examples" ) +set (TRACCC_BUILD_BENCHMARKS OFF CACHE BOOL + "Turn off the build of the Traccc benchmarks") # Now set up its build. FetchContent_MakeAvailable( traccc )