From 4f9f55ff0d1af2bc89693465e2ec2ba1359c35ee Mon Sep 17 00:00:00 2001 From: luncliff Date: Sun, 7 Jan 2024 20:34:47 +0900 Subject: [PATCH] [onnxruntime] use GNUInstallDirs, fix xnnpack link --- ports/onnxruntime/fix-cmake.patch | 2 +- .../onnxruntime/onnxruntime_vcpkg_deps.cmake | 7 ++-- ports/onnxruntime/vcpkg.json | 36 +++++++++---------- versions/baseline.json | 4 +-- versions/o-/onnxruntime.json | 5 +++ 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/ports/onnxruntime/fix-cmake.patch b/ports/onnxruntime/fix-cmake.patch index 2154bc18..32e8c09f 100644 --- a/ports/onnxruntime/fix-cmake.patch +++ b/ports/onnxruntime/fix-cmake.patch @@ -7,7 +7,7 @@ index 34355fb..8b69561 100644 include(CheckLanguage) include(CMakeDependentOption) -include(FetchContent) -+# include(FetchContent) # Using vcpkg. See external/onnxruntime_vcpkg_deps.cmake ++include(GNUInstallDirs) # Using vcpkg. See external/onnxruntime_vcpkg_deps.cmake include(CheckFunctionExists) # TODO: update this once all system adapt c++20 diff --git a/ports/onnxruntime/onnxruntime_vcpkg_deps.cmake b/ports/onnxruntime/onnxruntime_vcpkg_deps.cmake index 7939ae6d..1cc604c9 100644 --- a/ports/onnxruntime/onnxruntime_vcpkg_deps.cmake +++ b/ports/onnxruntime/onnxruntime_vcpkg_deps.cmake @@ -53,7 +53,7 @@ endif() if (NOT WIN32) find_package(nsync CONFIG REQUIRED) - list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES nsync::nsync_cpp) + list(APPEND onnxruntime_EXTERNAL_LIBRARIES nsync::nsync_cpp) endif() find_package(Microsoft.GSL CONFIG REQUIRED) @@ -80,9 +80,10 @@ if (onnxruntime_USE_XNNPACK) 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 CONFIG REQUIRED) # xnnpack + find_package(cpuinfo CONFIG REQUIRED) find_library(PTHREADPOOL_LIBRARY NAMES pthreadpool REQUIRED) - list(APPEND onnxruntime_EXTERNAL_LIBRARIES xnnpack ${PTHREADPOOL_LIBRARY}) + find_package(xnnpack CONFIG REQUIRED) # xnnpack + list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo ${PTHREADPOOL_LIBRARY} xnnpack) endif() if (onnxruntime_USE_MIMALLOC) diff --git a/ports/onnxruntime/vcpkg.json b/ports/onnxruntime/vcpkg.json index 6ab4d3d5..7540ddef 100644 --- a/ports/onnxruntime/vcpkg.json +++ b/ports/onnxruntime/vcpkg.json @@ -65,36 +65,33 @@ "description": "Artifact will be Apple framework", "supports": "osx | ios" }, - "python": { - "description": "Enable python buildings", + "mpi": { + "description": "Build with MPI support", "dependencies": [ - { - "name": "vcpkg-get-python-packages", - "host": true - } + "mpi" ] }, + "nccl": { + "description": "Build with NCCL support" + }, "openvino": { "description": "Build with OpenVINO support", "dependencies": [ "openvino" ] }, - "training": { - "description": "Build with NCCL support" + "python": { + "description": "Enable python buildings", + "dependencies": [ + { + "name": "vcpkg-get-python-packages", + "host": true + } + ] }, "tensorrt": { "description": "Build with NVIDIA TensorRT support" }, - "nccl": { - "description": "Build with NCCL support" - }, - "mpi": { - "description": "Build with MPI support", - "dependencies": [ - "mpi" - ] - }, "test": { "description": "Build ONNXRuntime unit tests", "dependencies": [ @@ -102,6 +99,9 @@ "gtest" ] }, + "training": { + "description": "Build with NCCL support" + }, "winml": { "description": "Build with WinML support" }, @@ -112,4 +112,4 @@ ] } } -} \ No newline at end of file +} diff --git a/versions/baseline.json b/versions/baseline.json index 0aa53a2a..a93a3e21 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -85,8 +85,8 @@ "port-version": 0 }, "onnxruntime": { - "baseline": "1.16.0", - "port-version": 1 + "baseline": "2024-01-04", + "port-version": 0 }, "openssl": { "baseline": "3.1.3", diff --git a/versions/o-/onnxruntime.json b/versions/o-/onnxruntime.json index 520bcc0f..17f01555 100644 --- a/versions/o-/onnxruntime.json +++ b/versions/o-/onnxruntime.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c84b3a4afbe389b3452d376c7aad3abb42435710", + "version-date": "2024-01-04", + "port-version": 0 + }, { "git-tree": "e9046291855178e0aebf9728e65f233a5507c3c0", "version-semver": "1.16.0",