Skip to content

Commit

Permalink
add onnxruntime
Browse files Browse the repository at this point in the history
  • Loading branch information
harrypuuter committed Apr 8, 2024
1 parent a52255b commit f060a2e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cmake/AddOnnxruntime.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Find ONNXRuntime
# first check if we have an LCG stack via LCG_VERSION environment variable
if (DEFINED ENV{LCG_VERSION})
string(REPLACE ":" ";" RUNTIME_PATH "$ENV{LD_LIBRARY_PATH}")
message(STATUS "Found LCG stack, using it to find ONNXRuntime")
find_library(ONNX_RUNTIME_LIB_PATH
NAMES onnxruntime
HINTS ${RUNTIME_PATH}
)
if (ONNX_RUNTIME_LIB_PATH)
# get the real path of the library to find the include directory
get_filename_component(ONNX_RUNTIME_LIB_PATH ${ONNX_RUNTIME_LIB_PATH} REALPATH)
get_filename_component(ONNX_RUNTIME_INCLUDE_PATH ${ONNX_RUNTIME_LIB_PATH}/../../include REALPATH)
message(STATUS "ONNXRuntime include path: ${ONNX_RUNTIME_INCLUDE_PATH}")
include_directories("${ONNX_RUNTIME_INCLUDE_PATH}/core/session")
endif()

message(STATUS "ONNXRuntime library path: ${ONNX_RUNTIME_LIB_PATH}")
else()
message(STATUS "No LCG stack found, not adding ONNXRuntime")
endif()
1 change: 1 addition & 0 deletions code_generation/analysis_template.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <TObjString.h>
#include <TTree.h>
#include <TVector.h>
#include "onnxruntime_cxx_api.h"
#include <regex>
#include <string>
// {INCLUDES}
Expand Down
1 change: 1 addition & 0 deletions code_generation/analysis_template_friends.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <TObjString.h>
#include <TTree.h>
#include <TVector.h>
#include "onnxruntime_cxx_api.h"
#include <filesystem>
#include <regex>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions code_generation/subset_template.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "include/fakefactors.hxx"
#include "include/utility/Logger.hxx"
#include <ROOT/RLogger.hxx>
#include "onnxruntime_cxx_api.h"
#include <TFile.h>
#include <TTree.h>
#include <regex>
Expand Down

0 comments on commit f060a2e

Please sign in to comment.