diff --git a/CMakeLists.txt b/CMakeLists.txt index 72b6280a..e2bd08ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,9 @@ find_package(EDM4HEP 0.10.1) # implicit: Podio find_package(DD4hep) find_package(k4geo) find_package(ONNXRuntime) +# New versions of ONNRuntime package provide onnxruntime-Config.cmake +# and use the name onnxruntime +find_package(onnxruntime) #--------------------------------------------------------------- diff --git a/RecFCCeeCalorimeter/CMakeLists.txt b/RecFCCeeCalorimeter/CMakeLists.txt index a5b25da9..31dd6889 100644 --- a/RecFCCeeCalorimeter/CMakeLists.txt +++ b/RecFCCeeCalorimeter/CMakeLists.txt @@ -7,6 +7,11 @@ include_directories("${ONNXRUNTIME_INCLUDE_DIRS}") # libs link_directories("${ONNXRUNTIME_LIBRARY_DIRS}") +# New versions of ONNXRuntime add directories to include +# through the target onnxruntime::onnxruntime +if(onnxruntime_FOUND) + set(ONNXRUNTIME_LIBRARY onnxruntime::onnxruntime) +endif() file(GLOB _module_sources src/components/*.cpp) gaudi_add_module(k4RecFCCeeCalorimeterPlugins diff --git a/RecFCCeeCalorimeter/src/components/CalibrateCaloClusters.cpp b/RecFCCeeCalorimeter/src/components/CalibrateCaloClusters.cpp index 1340b7b9..e0043aee 100644 --- a/RecFCCeeCalorimeter/src/components/CalibrateCaloClusters.cpp +++ b/RecFCCeeCalorimeter/src/components/CalibrateCaloClusters.cpp @@ -241,7 +241,7 @@ StatusCode CalibrateCaloClusters::readCalibrationFile(const std::string &calibra debug() << "Input Node Name/Shape (" << m_input_names.size() << "):" << endmsg; for (std::size_t i = 0; i < m_ortSession->GetInputCount(); i++) { - m_input_names.emplace_back(m_ortSession->GetInputName(i, allocator)); + m_input_names.insert(m_input_names.end(), m_ortSession->GetInputNames().begin(), m_ortSession->GetInputNames().end()); m_input_shapes = m_ortSession->GetInputTypeInfo(i).GetTensorTypeAndShapeInfo().GetShape(); debug() << "\t" << m_input_names.at(i) << " : "; for (std::size_t k = 0; k < m_input_shapes.size() - 1; k++) @@ -263,7 +263,7 @@ StatusCode CalibrateCaloClusters::readCalibrationFile(const std::string &calibra debug() << "Output Node Name/Shape (" << m_output_names.size() << "):" << endmsg; for (std::size_t i = 0; i < m_ortSession->GetOutputCount(); i++) { - m_output_names.emplace_back(m_ortSession->GetOutputName(i, allocator)); + m_output_names.insert(m_output_names.end(), m_ortSession->GetOutputNames().begin(), m_ortSession->GetOutputNames().end()); m_output_shapes = m_ortSession->GetOutputTypeInfo(i).GetTensorTypeAndShapeInfo().GetShape(); debug() << "\t" << m_output_names.at(i) << " : "; for (std::size_t k = 0; k < m_output_shapes.size() - 1; k++)