From 3c57c49499601c1afffb9280560478dd493dc624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCffner?= Date: Fri, 13 Oct 2023 09:28:46 +0200 Subject: [PATCH] add onnx-cpp version run exports, fix .so version --- recipe/meta.yaml | 5 ++++- recipe/soname_fix.patch | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 recipe/soname_fix.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 575a71cb..cf08bfad 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -12,6 +12,7 @@ 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 @@ -19,7 +20,7 @@ source: 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"] @@ -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: diff --git a/recipe/soname_fix.patch b/recipe/soname_fix.patch new file mode 100644 index 00000000..73be88f3 --- /dev/null +++ b/recipe/soname_fix.patch @@ -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" + ) +