Skip to content

Commit 8a66f5a

Browse files
committed
builds on macos
1 parent 86f8111 commit 8a66f5a

12 files changed

Lines changed: 26 additions & 40 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ endif()
101101
if(WITH_ONNX)
102102
# New onnxruntime (at least 1.17.1 and above) provide a onnxruntimeConfig.cmake
103103
# and use the name onnxruntime
104-
find_package(onnxruntime)
105-
if (NOT onnxruntime_FOUND)
104+
find_package(onnxruntime REQUIRED)
105+
if (NOT TARGET onnxruntime::onnxruntime)
106106
message(STATUS "Could not find onnxruntime (> 1.17.1). Looking for an older version")
107-
find_package(ONNXRuntime)
107+
else()
108+
set(onnxruntime_FOUND TRUE)
108109
endif()
109110

110111
if(onnxruntime_FOUND OR ONNXRuntime_FOUND)

addons/FastJet/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ add_custom_command(TARGET FastJet POST_BUILD
2121
install(FILES
2222
${CMAKE_CURRENT_LIST_DIR}/ExternalRecombiner.h
2323
${CMAKE_CURRENT_LIST_DIR}/ValenciaPlugin.h
24-
${CMAKE_CURRENT_LIST_DIR}/JetClustering.h
2524
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/FastJet
2625
)
2726

addons/ONNXRuntime/ONNXRuntime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ONNXRuntime {
2222
const std::vector<std::string>& inputNames() const { return input_names_; }
2323

2424
template <typename T>
25-
Tensor<T> run(Tensor<T>&, const Tensor<long>& = {}, unsigned long long = 1ull) const;
25+
Tensor<T> run(Tensor<T>&, const Tensor<int64_t>& = {}, unsigned long long = 1ull) const;
2626

2727
private:
2828
size_t variablePos(const std::string&) const;

addons/ONNXRuntime/WeaverInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class WeaverInterface {
6363

6464
std::unique_ptr<ONNXRuntime> onnx_;
6565
std::vector<std::string> variables_names_;
66-
ONNXRuntime::Tensor<long> input_shapes_;
66+
ONNXRuntime::Tensor<int64_t> input_shapes_;
6767
std::vector<unsigned int> input_sizes_;
6868
std::unordered_map<std::string, PreprocessParams> prep_info_map_;
6969
ONNXRuntime::Tensor<float> data_;

addons/ONNXRuntime/src/ONNXRuntime.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <numeric>
44
#include <algorithm>
5+
#include <vector>
56

67
ONNXRuntime::ONNXRuntime(const std::string& model_path, const std::vector<std::string>& input_names)
78
: env_(new Ort::Env(OrtLoggingLevel::ORT_LOGGING_LEVEL_WARNING, "onnx_runtime")),
@@ -58,16 +59,16 @@ ONNXRuntime::~ONNXRuntime() {}
5859

5960
template <typename T>
6061
ONNXRuntime::Tensor<T> ONNXRuntime::run(Tensor<T>& input,
61-
const Tensor<long>& input_shapes,
62+
const Tensor<int64_t>& input_shapes,
6263
unsigned long long batch_size) const {
6364
std::vector<Ort::Value> tensors_in;
6465
for (const auto& name : input_node_strings_) {
6566
auto input_pos = variablePos(name);
6667
auto value = input.begin() + input_pos;
67-
std::vector<int64_t> input_dims;
68+
std::vector< int64_t> input_dims;
6869
if (input_shapes.empty()) {
69-
input_dims = input_node_dims_.at(name);
70-
input_dims[0] = batch_size;
70+
input_dims = input_node_dims_.at(name);
71+
input_dims[0] = (int64_t) batch_size;
7172
} else {
7273
input_dims = input_shapes[input_pos];
7374
// rely on the given input_shapes to set the batch size
@@ -117,4 +118,4 @@ size_t ONNXRuntime::variablePos(const std::string& name) const {
117118
return iter - input_names_.begin();
118119
}
119120

120-
template ONNXRuntime::Tensor<float> ONNXRuntime::run(Tensor<float>&, const Tensor<long>&, unsigned long long) const;
121+
template ONNXRuntime::Tensor<float> ONNXRuntime::run(Tensor<float>&, const Tensor<int64_t>&, unsigned long long) const;

analyzers/dataframe/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ target_include_directories(FCCAnalyses PUBLIC
5959

6060
message(STATUS " ====== DELPHES LIBRARY = " ${DELPHES_LIBRARY} )
6161
message(STATUS " ====== DELPHES_EXTERNALS_TKCOV_INCLUDE_DIR = " ${DELPHES_EXTERNALS_TKCOV_INCLUDE_DIR} )
62+
message(STATUS " ====== ADDONS_LIBRARIES " ${ADDONS_LIBRARIES})
6263

6364
target_link_libraries(FCCAnalyses PUBLIC
6465
ROOT::Physics
@@ -73,7 +74,6 @@ target_link_libraries(FCCAnalyses PUBLIC
7374
podio::podioDataSource
7475
${ADDONS_LIBRARIES}
7576
${DELPHES_LIBRARY}
76-
gfortran # todo: why necessary?
7777
)
7878

7979
if(WITH_DD4HEP)

analyzers/dataframe/FCCAnalyses/Algorithms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "edm4hep/ReconstructedParticleData.h"
88

9-
#include "FastJet/JetClustering.h"
9+
#include "FCCAnalyses/JetClustering.h"
1010

1111
//#include "TFitter.h"
1212
#include "Math/Minimizer.h"
File renamed without changes.

analyzers/dataframe/FCCAnalyses/JetClusteringUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "Math/Vector4D.h"
66
#include "ROOT/RVec.hxx"
77

8-
#include "FastJet/JetClustering.h"
8+
#include "FCCAnalyses/JetClustering.h"
99
#include "fastjet/JetDefinition.hh"
1010

1111
#include "TRandom3.h"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "FastJet/JetClustering.h"
1+
#include "FCCAnalyses/JetClustering.h"
22
#include "FastJet/ExternalRecombiner.h"
33

44
#include "FCCAnalyses/JetClusteringUtils.h"

0 commit comments

Comments
 (0)