-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#23409) onnxruntime: add 1.17.3 & 1.18.1, remove older versions
* onnxruntime: enable cuda provider * onnxruntime: patch 1.16.1 build too * onnxruntime: avoid gsl being patched when cuda is active * onnxruntime: simplify patching Replace the onnxruntime_external_deps.cmake and its FetchContent calls entirely with find_package() calls against Conan targets. * onnxruntime: drop v1.16.0 * onnxruntime: fix build issues * onnxruntime: add dummy targets to avoid accidental linking errors * onnxruntime: silence a warning that gets converted to an error * onnxruntime: fix wil includes not being found * onnxruntime: bump deps * onnxruntime: fix patches * onnxruntime: relax Protobuf version check in CMake * onnxruntime: bump deps * onnxruntime: onnxruntime: add 1.17.1, remove older versions * add version 1.17.3 * bump boost to 1.85.0 * use boost 1.83 * update comment on boost cpp 17 compat * Add patch for missing include * onnxruntime: add version 1.18.0 * fix abseil conflict * add version 1.18.1, remove 1.18.0 * disable building with abeil DLL on Windows * Avoid creating new revisions when new versions are added * review: remove cuda * bump to onnx 1.16.2 * bump wil * remove variables that match the default * empty commit --------- Co-authored-by: Bart Verhagen <bart@kapernikov.com> Co-authored-by: Martin Valgur <martin.valgur@gmail.com> Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> Co-authored-by: czoido <mrgalleta@gmail.com>
- Loading branch information
1 parent
ae4ceb7
commit 2b772b4
Showing
11 changed files
with
371 additions
and
815 deletions.
There are no files selected for viewing
112 changes: 112 additions & 0 deletions
112
recipes/onnxruntime/all/cmake/onnxruntime_external_deps.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# Replacement for https://github.com/microsoft/onnxruntime/blob/v1.16.1/cmake/external/onnxruntime_external_deps.cmake | ||
|
||
if(NOT onnxruntime_DISABLE_ABSEIL) | ||
find_package(absl REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES abseil::abseil) | ||
include_directories(${absl_INCLUDE_DIRS}) | ||
endif() | ||
|
||
find_package(re2 REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES re2::re2) | ||
|
||
#flatbuffers 1.11.0 does not have flatbuffers::IsOutRange, therefore we require 1.12.0+ | ||
find_package(Flatbuffers REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES flatbuffers::flatbuffers) | ||
|
||
find_package(Protobuf REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES protobuf::libprotobuf) | ||
set(ONNX_CUSTOM_PROTOC_EXECUTABLE protoc) | ||
set(PROTOC_EXECUTABLE protoc) | ||
|
||
find_package(date REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES date::date) | ||
include_directories(${date_INCLUDE_DIRS}) | ||
add_library(date_interface INTERFACE) | ||
|
||
find_package(Boost REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES Boost::mp11) | ||
|
||
find_package(nlohmann_json REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES nlohmann_json::nlohmann_json) | ||
|
||
find_package(cpuinfo REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo) | ||
if (TARGET cpuinfo::clog) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::clog) | ||
endif() | ||
set(CPUINFO_SUPPORTED ${cpuinfo_FOUND}) | ||
# Add a dummy targets for onnxruntime CMakelists.txt to depend on | ||
add_library(clog INTERFACE) | ||
add_library(cpuinfo INTERFACE) | ||
|
||
if (NOT WIN32) | ||
find_package(nsync REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES nsync::nsync_cpp) | ||
include_directories(${nsync_INCLUDE_DIRS}) | ||
add_library(nsync_cpp INTERFACE) | ||
endif() | ||
|
||
find_package(Microsoft.GSL 4.0 REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES Microsoft.GSL::GSL) | ||
include_directories(${Microsoft.GSL_INCLUDE_DIRS}) | ||
|
||
find_package(safeint REQUIRED CONFIG) | ||
include_directories(${safeint_INCLUDE_DIRS}) | ||
add_library(safeint_interface INTERFACE) | ||
|
||
find_package(ONNX REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES onnx onnx_proto) | ||
|
||
find_package(Eigen3 REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES Eigen3::Eigen) | ||
set(eigen_INCLUDE_DIRS ${Eigen3_INCLUDE_DIRS}) | ||
|
||
if(WIN32) | ||
find_package(wil REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES WIL::WIL) | ||
include_directories(${wil_INCLUDE_DIRS}) | ||
endif() | ||
|
||
# XNNPACK EP | ||
if (onnxruntime_USE_XNNPACK) | ||
if (onnxruntime_DISABLE_CONTRIB_OPS) | ||
message(FATAL_ERROR "XNNPACK EP requires the internal NHWC contrib ops to be available " | ||
"but onnxruntime_DISABLE_CONTRIB_OPS is ON") | ||
endif() | ||
find_package(xnnpack REQUIRED CONFIG) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES xnnpack::xnnpack) | ||
add_library(XNNPACK INTERFACE) | ||
endif() | ||
|
||
if (onnxruntime_USE_MIMALLOC) | ||
find_package(mimalloc REQUIRED CONFIG) | ||
add_definitions(-DUSE_MIMALLOC) | ||
endif() | ||
|
||
# The source code of onnx_proto is generated, we must build this lib first before starting to compile the other source code that uses ONNX protobuf types. | ||
# The other libs do not have the problem. All the sources are already there. We can compile them in any order. | ||
set(onnxruntime_EXTERNAL_DEPENDENCIES | ||
onnx_proto | ||
flatbuffers::flatbuffers | ||
) | ||
|
||
if (onnxruntime_RUN_ONNX_TESTS) | ||
add_definitions(-DORT_RUN_EXTERNAL_ONNX_TESTS) | ||
endif() | ||
|
||
if(onnxruntime_ENABLE_ATEN) | ||
message("Aten fallback is enabled.") | ||
find_package(dlpack REQUIRED CONFIG) | ||
endif() | ||
|
||
if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxruntime_BUILD_UNIT_TESTS)) | ||
find_package(cxxopts REQUIRED CONFIG) | ||
endif() | ||
|
||
if(onnxruntime_USE_SNPE) | ||
include(external/find_snpe.cmake) | ||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${SNPE_NN_LIBS}) | ||
endif() | ||
|
||
file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} ORT_BINARY_DIR) | ||
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} ORT_SOURCE_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.