Skip to content

Commit

Permalink
add onnx-cpp version run exports, fix .so version
Browse files Browse the repository at this point in the history
  • Loading branch information
kuepe-sl committed Oct 16, 2023
1 parent a7155ee commit 3c57c49
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
5 changes: 4 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ source:
sha256: 197c6ce4f2de9176402fb8a634c390e757b729ff48a30e8038a0f7d71ff1f1ae
patches:
- never_call_install_python_deps.patch
- soname_fix.patch # [unix]
# Workaround for https://github.com/conda-forge/onnxruntime-feedstock/pull/56#issuecomment-1586080419
- windows_workaround_conflict_onnxruntime_dll_system32.patch # [win]
# Workaround for https://github.com/microsoft/onnxruntime/issues/13225
- comment_InterThreadPoolWithDenormalAsZero.patch # [osx]


build:
number: 0
number: 1
# Since 1.11, power9 seems to be required.
skip: true # [ppc64le]
skip: true # [cuda_compiler_version == "10.2" or cuda_compiler_version == "11.0" or cuda_compiler_version == "11.1"]
Expand Down Expand Up @@ -88,6 +89,8 @@ outputs:
- name: {{ name|lower }}{{ suffix }}-cpp
build:
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}_{{ build_ext }}
run_exports:
- {{ pin_subpackage((name|lower) + suffix + '-cpp', max_pin='x') }}
script: install-cpp.sh # [unix]
script: install-cpp.bat # [win]
requirements:
Expand Down
24 changes: 24 additions & 0 deletions recipe/soname_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 82a4547..0d09299 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -510,6 +510,7 @@ set(ORTTRAINING_ROOT ${PROJECT_SOURCE_DIR}/../orttraining)
set(ORTTRAINING_SOURCE_DIR ${ORTTRAINING_ROOT}/orttraining)

file (STRINGS "${REPO_ROOT}/VERSION_NUMBER" ORT_VERSION)
+string(REGEX MATCH "[^.]+" ORT_VER_MAJOR "${ORT_VERSION}")

find_package(Threads)
# On Windows we directly use Windows APIs to do the job
diff --git a/cmake/onnxruntime.cmake b/cmake/onnxruntime.cmake
index 59ebf8e..d22aa05 100644
--- a/cmake/onnxruntime.cmake
+++ b/cmake/onnxruntime.cmake
@@ -247,6 +247,7 @@ set_target_properties(onnxruntime PROPERTIES
PUBLIC_HEADER "${ONNXRUNTIME_PUBLIC_HEADERS}"
LINK_DEPENDS ${SYMBOL_FILE}
VERSION ${ORT_VERSION}
+ SOVERSION ${ORT_VER_MAJOR}
FOLDER "ONNXRuntime"
)

0 comments on commit 3c57c49

Please sign in to comment.