Skip to content

Commit

Permalink
refactor: Remove dfelibs from dependencies (acts-project#3489)
Browse files Browse the repository at this point in the history
This imports the two header files that we use and removes the dependency on dfelibs.
  • Loading branch information
paulgessinger authored Aug 8, 2024
1 parent cc3f620 commit d49e2f8
Show file tree
Hide file tree
Showing 29 changed files with 712 additions and 133 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ 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_DFELIBS "Use a system-provided dfelibs 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)
Expand Down Expand Up @@ -254,11 +253,6 @@ if (ACTS_SETUP_EIGEN3)
endif()
endif()

if (ACTS_USE_SYSTEM_DFELIBS)
find_package(dfelibs ${_acts_dfelibs_version} REQUIRED)
else()
add_subdirectory(thirdparty/dfelibs)
endif()

find_package(Filesystem REQUIRED)

Expand Down
5 changes: 1 addition & 4 deletions Examples/Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ target_link_libraries(
ActsExamplesFramework
PUBLIC ActsCore ActsFatras ActsPluginFpeMonitoring Boost::boost ROOT::Core ROOT::Hist
PRIVATE std::filesystem)
acts_target_link_libraries_system(
ActsExamplesFramework
PRIVATE dfelibs)
target_compile_definitions(
ActsExamplesFramework
PRIVATE BOOST_FILESYSTEM_NO_DEPRECATED)
Expand Down Expand Up @@ -67,7 +64,7 @@ install(
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(
DIRECTORY include/ActsExamples
DIRECTORY include/ActsExamples
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

add_subdirectory_if(ML ACTS_BUILD_PLUGIN_ONNX)
26 changes: 9 additions & 17 deletions Examples/Framework/src/Framework/Sequencer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <cstdint>
#include <cstdlib>
#include <exception>
#include <fstream>
#include <functional>
#include <iterator>
#include <limits>
Expand All @@ -50,8 +51,6 @@
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/core/demangle.hpp>
#include <dfe/dfe_io_dsv.hpp>
#include <dfe/dfe_namedtuple.hpp>

namespace ActsExamples {

Expand Down Expand Up @@ -390,27 +389,20 @@ inline std::string perEvent(D duration, std::size_t numEvents) {
return asString(duration / numEvents) + "/event";
}

// Store timing data
struct TimingInfo {
std::string identifier;
double time_total_s = 0;
double time_perevent_s = 0;

DFE_NAMEDTUPLE(TimingInfo, identifier, time_total_s, time_perevent_s);
};

void storeTiming(const std::vector<std::string>& identifiers,
const std::vector<Duration>& durations, std::size_t numEvents,
const std::string& path) {
dfe::NamedTupleTsvWriter<TimingInfo> writer(path, 4);
std::ofstream file(path);

file << "identifier,time_total_s,time_perevent_s\n";

for (std::size_t i = 0; i < identifiers.size(); ++i) {
TimingInfo info;
info.identifier = identifiers[i];
info.time_total_s =
const auto time_total_s =
std::chrono::duration_cast<Seconds>(durations[i]).count();
info.time_perevent_s = info.time_total_s / numEvents;
writer.append(info);
file << identifiers[i] << "," << time_total_s << ","
<< time_total_s / numEvents;
}
file << std::endl;
}
} // namespace

Expand Down
11 changes: 4 additions & 7 deletions Examples/Io/Csv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ add_library(
src/CsvTrackingGeometryWriter.cpp
src/CsvTrackParameterReader.cpp
src/CsvTrackParameterWriter.cpp
src/CsvSeedWriter.cpp
src/CsvTrackWriter.cpp
src/CsvDriftCircleReader.cpp
src/CsvMuonSimHitReader.cpp
src/CsvSeedWriter.cpp
src/CsvTrackWriter.cpp
src/CsvDriftCircleReader.cpp
src/CsvMuonSimHitReader.cpp
src/CsvProtoTrackWriter.cpp
src/CsvSpacePointWriter.cpp
src/CsvExaTrkXGraphWriter.cpp
Expand All @@ -30,9 +30,6 @@ target_link_libraries(
ActsCore
ActsExamplesFramework ActsExamplesDigitization
Threads::Threads)
acts_target_link_libraries_system(
ActsExamplesIoCsv
PRIVATE dfelibs)

install(
TARGETS ActsExamplesIoCsv
Expand Down
Loading

0 comments on commit d49e2f8

Please sign in to comment.