Skip to content

[onnxruntime] new ports for microsoft/onnxruntime v1.23.2 - #36850

Merged
Billy O'Neal (BillyONeal) merged 16 commits into
microsoft:masterfrom
luncliff:port/onnxruntime
Dec 5, 2025
Merged

[onnxruntime] new ports for microsoft/onnxruntime v1.23.2#36850
Billy O'Neal (BillyONeal) merged 16 commits into
microsoft:masterfrom
luncliff:port/onnxruntime

Conversation

@luncliff

@luncliff PARK DongHa (luncliff) commented Feb 19, 2024

Copy link
Copy Markdown
Contributor

Notes

With my experience in the registry, Some features may not work well with toolchain.

Hope more feature contributions after this work.

# triplet example: x64-windows.cmake
message(STATUS "Using CUDA_PATH: $ENV{CUDA_PATH}")
set(TENSORRT_HOME "$ENV{CUDA_PATH}/TensorRT-10.9.0.34")
get_filename_component(TENSORRT_HOME "${TENSORRT_HOME}" ABSOLUTE)
message(STATUS "Using TENSORRT_HOME: ${TENSORRT_HOME}")
-- Using CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8
-- Using TENSORRT_HOME: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/TensorRT-10.9.0.34

References

ONNXRuntime

microsoft/vcpkg

luncliff/vcpkg-registry

Checklist

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

Comment thread ports/onnxruntime/fix-cmake.patch Outdated
Comment thread ports/onnxruntime/fix-cmake.patch Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
@jimwang118 jim wang (jimwang118) added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Feb 20, 2024
@luncliff

Copy link
Copy Markdown
Contributor Author

Hmm.. for some reason CMake tries old version of Xcode ...

[1/2] "/opt/homebrew/Cellar/cmake/3.28.1/bin/cmake" -E chdir "../../arm64-osx-dbg" "/opt/homebrew/Cellar/cmake/3.28.1/bin/cmake" "/Users/vcpkg/Data/b/onnxruntime/src/v1.17.0-ab094f3828.clean/cmake" "-G" "Xcode" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=/Users/vcpkg/Data/p/onnxruntime_arm64-osx/debug" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-Donnxruntime_ENABLE_PYTHON=OFF" "-Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF" "-Donnxruntime_ENABLE_TRAINING=OFF" "-Donnxruntime_ENABLE_TRAINING_APIS=OFF" "-Donnxruntime_USE_CUDA=OFF" "-Donnxruntime_USE_CUDA_NHWC_OPS=OFF" "-Donnxruntime_USE_OPENVINO=OFF" "-Donnxruntime_USE_TENSORRT=OFF" "-Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=OFF" "-Donnxruntime_USE_DML=OFF" "-Donnxruntime_USE_CUSTOM_DIRECTML=OFF" "-Donnxruntime_USE_WINML=OFF" "-Donnxruntime_USE_COREML=OFF" "-Donnxruntime_USE_MIMALLOC=OFF" "-Donnxruntime_USE_VALGRIND=OFF" "-Donnxruntime_USE_XNNPACK=OFF" "-Donnxruntime_USE_NNAPI_BUILTIN=OFF" "-Donnxruntime_USE_AZURE=OFF" "-Donnxruntime_USE_LLVM=OFF" "-Donnxruntime_BUILD_UNIT_TESTS=OFF" "-Donnxruntime_BUILD_BENCHMARKS=OFF" "-Donnxruntime_RUN_ONNX_TESTS=OFF" "-Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF" "-Donnxruntime_BUILD_OBJC=OFF" "-Donnxruntime_USE_NCCL=OFF" "-Donnxruntime_USE_MPI=OFF" "-Donnxruntime_ORT_MINIMAL_BUILD=OFF" "-Donnxruntime_DISABLE_ABSEIL=ON" "-Donnxruntime_USE_MEMORY_EFFICIENT_ATTENTION=ON" "-DPython_EXECUTABLE:FILEPATH=/opt/homebrew/bin/python3" "-DProtobuf_PROTOC_EXECUTABLE:FILEPATH=/Users/vcpkg/Data/installed/arm64-osx/tools/protobuf/protoc" "-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON" "-DBUILD_PKGCONFIG_FILES=0" "-Donnxruntime_BUILD_SHARED_LIB=0" "-Donnxruntime_BUILD_WEBASSEMBLY=OFF" "-Donnxruntime_CROSS_COMPILING=0" "-Donnxruntime_USE_FULL_PROTOBUF=OFF" "-Donnxruntime_USE_PREINSTALLED_EIGEN=ON" "-Donnxruntime_USE_EXTENSIONS=OFF" "-Donnxruntime_USE_NNAPI_BUILTIN=" "-Donnxruntime_ENABLE_CPUINFO=ON" "-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF" "-Donnxruntime_ENABLE_BITCODE=" "-Donnxruntime_ENABLE_PYTHON=OFF" "-Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF" "-Donnxruntime_ENABLE_LAZY_TENSOR=OFF" "-Donnxruntime_NVCC_THREADS=1" "-Donnxruntime_DISABLE_RTTI=OFF" "-Donnxruntime_USE_NEURAL_SPEED=OFF" "-DUSE_NEURAL_SPEED=OFF" "-DORT_GIT_COMMIT:STRING="v1.17.0"" "-DORT_GIT_BRANCH:STRING="v1.17.0"" "-DCMAKE_SYSTEM_NAME=Darwin" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/1/s/scripts/toolchains/osx.cmake" "-DVCPKG_TARGET_TRIPLET=arm64-osx" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/Users/vcpkg/Data/work/1/s" "-D_VCPKG_INSTALLED_DIR=/Users/vcpkg/Data/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DCMAKE_OSX_ARCHITECTURES=arm64" "-Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF" "-Donnxruntime_ENABLE_MEMORY_PROFILE=OFF" "-Donnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1"
FAILED: ../../arm64-osx-dbg/CMakeCache.txt 
"/opt/homebrew/Cellar/cmake/3.28.1/bin/cmake" -E chdir "../../arm64-osx-dbg" "/opt/homebrew/Cellar/cmake/3.28.1/bin/cmake" "/Users/vcpkg/Data/b/onnxruntime/src/v1.17.0-ab094f3828.clean/cmake" "-G" "Xcode" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=/Users/vcpkg/Data/p/onnxruntime_arm64-osx/debug" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-Donnxruntime_ENABLE_PYTHON=OFF" "-Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF" "-Donnxruntime_ENABLE_TRAINING=OFF" "-Donnxruntime_ENABLE_TRAINING_APIS=OFF" "-Donnxruntime_USE_CUDA=OFF" "-Donnxruntime_USE_CUDA_NHWC_OPS=OFF" "-Donnxruntime_USE_OPENVINO=OFF" "-Donnxruntime_USE_TENSORRT=OFF" "-Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=OFF" "-Donnxruntime_USE_DML=OFF" "-Donnxruntime_USE_CUSTOM_DIRECTML=OFF" "-Donnxruntime_USE_WINML=OFF" "-Donnxruntime_USE_COREML=OFF" "-Donnxruntime_USE_MIMALLOC=OFF" "-Donnxruntime_USE_VALGRIND=OFF" "-Donnxruntime_USE_XNNPACK=OFF" "-Donnxruntime_USE_NNAPI_BUILTIN=OFF" "-Donnxruntime_USE_AZURE=OFF" "-Donnxruntime_USE_LLVM=OFF" "-Donnxruntime_BUILD_UNIT_TESTS=OFF" "-Donnxruntime_BUILD_BENCHMARKS=OFF" "-Donnxruntime_RUN_ONNX_TESTS=OFF" "-Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF" "-Donnxruntime_BUILD_OBJC=OFF" "-Donnxruntime_USE_NCCL=OFF" "-Donnxruntime_USE_MPI=OFF" "-Donnxruntime_ORT_MINIMAL_BUILD=OFF" "-Donnxruntime_DISABLE_ABSEIL=ON" "-Donnxruntime_USE_MEMORY_EFFICIENT_ATTENTION=ON" "-DPython_EXECUTABLE:FILEPATH=/opt/homebrew/bin/python3" "-DProtobuf_PROTOC_EXECUTABLE:FILEPATH=/Users/vcpkg/Data/installed/arm64-osx/tools/protobuf/protoc" "-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON" "-DBUILD_PKGCONFIG_FILES=0" "-Donnxruntime_BUILD_SHARED_LIB=0" "-Donnxruntime_BUILD_WEBASSEMBLY=OFF" "-Donnxruntime_CROSS_COMPILING=0" "-Donnxruntime_USE_FULL_PROTOBUF=OFF" "-Donnxruntime_USE_PREINSTALLED_EIGEN=ON" "-Donnxruntime_USE_EXTENSIONS=OFF" "-Donnxruntime_USE_NNAPI_BUILTIN=" "-Donnxruntime_ENABLE_CPUINFO=ON" "-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF" "-Donnxruntime_ENABLE_BITCODE=" "-Donnxruntime_ENABLE_PYTHON=OFF" "-Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF" "-Donnxruntime_ENABLE_LAZY_TENSOR=OFF" "-Donnxruntime_NVCC_THREADS=1" "-Donnxruntime_DISABLE_RTTI=OFF" "-Donnxruntime_USE_NEURAL_SPEED=OFF" "-DUSE_NEURAL_SPEED=OFF" "-DORT_GIT_COMMIT:STRING="v1.17.0"" "-DORT_GIT_BRANCH:STRING="v1.17.0"" "-DCMAKE_SYSTEM_NAME=Darwin" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/1/s/scripts/toolchains/osx.cmake" "-DVCPKG_TARGET_TRIPLET=arm64-osx" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/Users/vcpkg/Data/work/1/s" "-D_VCPKG_INSTALLED_DIR=/Users/vcpkg/Data/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DCMAKE_OSX_ARCHITECTURES=arm64" "-Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF" "-Donnxruntime_ENABLE_MEMORY_PROFILE=OFF" "-Donnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1"
CMake Error:
  Xcode 1.5 not supported.


CMake Error: Could not create named generator Xcode

Generators
* Unix Makefiles               = Generates standard UNIX makefiles.

@luncliff
PARK DongHa (luncliff) marked this pull request as ready for review February 20, 2024 10:43
@dg0yt

Copy link
Copy Markdown
Contributor

IIRC the xcode generator needs a GUI session, i.e. doesn't work in CI.

@luncliff

Copy link
Copy Markdown
Contributor Author

Added notes for the current features.
If the PR is labeled with https://github.com/microsoft/vcpkg/labels/requires%3Aall-feature-testing,
I will change it to draft and then add more ports to the upstream.

@jimwang118
jim wang (jimwang118) marked this pull request as draft February 21, 2024 02:34
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
@luncliff

Copy link
Copy Markdown
Contributor Author

Can't fix the errors of the CUDA code. I will remove cuda and xnnpack feature for this work.
I think I can support them in next port-version...

@luncliff

Copy link
Copy Markdown
Contributor Author

So the build error comes from arm_neon build.

  • Reproduced in NDK 25.2.9519653
  • NOT reproduced in NDK 26.2.11394342

Let me check the details...

Comment thread ports/onnxruntime/fix-cmake.patch Outdated
Comment thread ports/onnxruntime/onnxruntime_vcpkg_deps.cmake Outdated
Comment thread ports/onnxruntime/vcpkg.json
Comment thread ports/onnxruntime/vcpkg.json Outdated
@luncliff

Copy link
Copy Markdown
Contributor Author

So the build error comes from arm_neon build.

  • Reproduced in NDK 25.2.9519653
  • NOT reproduced in NDK 26.2.11394342

Let me check the details...

For NDK 25(Clang 14.0.7), I tried -march=armv8.2-a+bf16 and -march=armv8.2-a+fp16 compiler option but didn't work.
I think I haver to wait NDK 26 for Android...

@luncliff
PARK DongHa (luncliff) marked this pull request as ready for review March 12, 2024 13:46
Comment thread ports/onnxruntime/vcpkg.json
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/onnxruntime_vcpkg_deps.cmake Outdated
@luncliff
PARK DongHa (luncliff) marked this pull request as draft April 1, 2024 04:20
@luncliff
PARK DongHa (luncliff) marked this pull request as ready for review April 15, 2024 03:40
@luncliff
PARK DongHa (luncliff) marked this pull request as draft April 15, 2024 03:52
@luncliff
PARK DongHa (luncliff) marked this pull request as ready for review April 15, 2024 11:48
@luncliff

Copy link
Copy Markdown
Contributor Author
  • 6109c62 Temporary allow failure of onnxruntime:arm64-android

@dg0yt Kai Pastor (dg0yt) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of work! 🚀

Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment on lines +139 to +142
if(("openvino" IN_LIST FEATURES) AND VCPKG_TARGET_IS_WINDOWS)
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/onnxruntime_providers_openvino.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/onnxruntime_providers_openvino.dll")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/onnxruntime_providers_openvino.dll" "${CURRENT_PACKAGES_DIR}/bin/onnxruntime_providers_openvino.dll")
endif()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming after install: Expected to break exported CMake config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installation was fixed in microsoft/onnxruntime#19966
Use the latest release to apply the patch

Comment on lines +146 to +148
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/bin")
endif()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these dirs empty? Or are there programs which need to be handled regardless of linkage?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there might some tool build based on features, but they are not defined in this port version.

Comment thread ports/onnxruntime/project-config-template.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/portfile.cmake Outdated
Comment thread ports/onnxruntime/project-config-template.cmake Outdated
@luncliff PARK DongHa (luncliff) changed the title [onnxruntime] create a new port with v1.17.0 [onnxruntime] create a new port with v1.17.3 Apr 20, 2024
@JoergAtGithub JoergAtGithub mentioned this pull request May 2, 2024
11 tasks
@luncliff

Copy link
Copy Markdown
Contributor Author

Hi, requesting a review and a tag for it

@abique

Copy link
Copy Markdown
Contributor

Almost there, you rock guys 💪

@JoergAtGithub

Copy link
Copy Markdown
Contributor

Billy O'Neal (@BillyONeal) I think the remaining build fail is unrelated to this PR

@BillyONeal Billy O'Neal (BillyONeal) added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Dec 3, 2025
@BillyONeal

Copy link
Copy Markdown
Member

I agree that looks like a baseline issue /cc Victor Romero (@vicroms)

@dg0yt

Copy link
Copy Markdown
Contributor
CMake Error at D:/installed/arm64-windows-static-md/share/opencv4/OpenCVModules.cmake:374 (set_target_properties):
  The link interface of target "opencv_wechat_qrcode" contains:

    Iconv::Iconv

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  D:/installed/arm64-windows-static-md/share/opencv4/OpenCVConfig.cmake:126 (include)
  D:/installed/arm64-windows-static-md/share/opencv/vcpkg-cmake-wrapper.cmake:3 (_find_package)
  D:/a/_work/1/s/scripts/buildsystems/vcpkg.cmake:862 (include)
  src/cmake/dependency_utils.cmake:370 (find_package)
  src/cmake/externalpackages.cmake:155 (checked_find_package)
  CMakeLists.txt:213 (include)

This is independent of this PR: Missing installation order control in wechat_qrcode in opencv4[contrib]. This could happen to any triplet which doesn't have icon in implicit link libs. I will turn off iconv in #48492, but I don't know when it will be ready.

@BillyONeal

Copy link
Copy Markdown
Member

Kai Pastor (@dg0yt) That seems correct to me. I'm pinging Victor Romero (@vicroms) though because as the most recent pusher I am unable to merge :(

@BillyONeal
Billy O'Neal (BillyONeal) merged commit 2c9fdb8 into microsoft:master Dec 5, 2025
15 of 17 checks passed
@luncliff
PARK DongHa (luncliff) deleted the port/onnxruntime branch December 5, 2025 03:32
@luncliff

Copy link
Copy Markdown
Contributor Author

Sorry for taking this long. There was a series of suffering in my life after opening this PR. Thankfully it didn't crush me.
I will monitor the build failure issues for a while.

@abique

Copy link
Copy Markdown
Contributor

Sorry for taking this long. There was a series of suffering in my life after opening this PR. Thankfully it didn't crush me. I will monitor the build failure issues for a while.

Thank you very much for your work! 👍

@patrikhuber

Patrik Huber (patrikhuber) commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

I've just tried to use the onnxruntime port, I'm on the latest vcpkg 12.12.2025 baseline.

When trying to load an onnx model, it throws an exception and prints a few hundred warnings like these onto the terminal:

Schema error: Trying to register schema with name Min (domain:  version: 8) from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 3909, but it is already registered from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 3909

Schema error: Trying to register schema with name Max (domain:  version: 8) from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 3907, but it is already registered from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 3907

Schema error: Trying to register schema with name Sum (domain:  version: 8) from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 1588, but it is already registered from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 1588

Schema error: Trying to register schema with name Mean (domain:  version: 8) from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 1598, but it is already registered from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 1598

Schema error: Trying to register schema with name MaxPool (domain:  version: 8) from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\nn\old.cc line 2492, but it is already registered from file C:\Users\Patrik\Projects\myproject\out\build\x64-debug\vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\nn\old.cc line 2492

A few remarks:

  1. The terminal output shows v1.19.0: vcpkg_installed\vcpkg\blds\onnx\src\v1.19.0-c251c1eccc.clean, but vcpkg clearly installed 1.23.2:
1> [CMake]     onnxruntime:x64-windows@1.23.2 -- git+https://github.com/microsoft/vcpkg@7391737791bbf21b648ab4e95521f31fdf502d59

(=> unrelated, this has been explained below)

  1. While building onnxruntime, it says:
image It seems that that could be the root of the issue - this flag could be missing when building the "onnx" package in vcpkg, which then results in those "already registered" errors?

But if you read the error closely, it actually lists the same filename twice, so if one is to believe the error message, the same file has registered the schema twice?

  1. I'm not clear whether I should use the onnxruntime-gpu package instead and how they differ. I am guessing onnxruntime-gpu might be deprecated in favour of onnxruntime, but I am not certain.
    (=> This has been explained below, but I'm already using the onnxruntime package, not the one with -gpu at the end.)

Any help, am I missing something?

@JoergAtGithub

Copy link
Copy Markdown
Contributor

These are two different packages:

  • ONNX is v1.19.0
  • ONNX-Runtime is v1.23.2

Don't use onnxruntime-gpu, this is just a wrapper for backward compatibility.

@patrikhuber

Copy link
Copy Markdown
Contributor

These are two different packages:

  • ONNX is v1.19.0
  • ONNX-Runtime is v1.23.2

Don't use onnxruntime-gpu, this is just a wrapper for backward compatibility.

You're right, that explains my remarks 1) and 3) - and I was already using the onnxruntime package, not the -gpu one.

However the root issue remains with the "schemes already registered" errors. Perhaps onnx is not built with ONNX_DISABLE_STATIC_REGISTRATION=ON?
Does nobody else have an issue with this port on Windows, does it work for others? My example is literally a simple hello-world and it results in those errors, as well as the port warning during build.

@vipcxj

vipcxj commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Patrik Huber (@patrikhuber) I encountered this issue a long time ago; please see my comment
#36850 (comment)_

@patrikhuber

Patrik Huber (patrikhuber) commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Patrik Huber (@patrikhuber) I encountered this issue a long time ago; please see my comment #36850 (comment)_

I saw this yesterday actually, but I was assuming this was long fixed before this PR was merged.

So are we essentially saying then that a non-functioning PR was merged because that issue was never fixed? It's an issue that only becomes apparent when one tries to run onnxruntime, so it wouldn't have been caught by vcpkg's CI checks, obviously.

As far as I can see, #38879 was a proposed solution, but it was not merged.

@vipcxj

vipcxj commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Patrik Huber (@patrikhuber) So I chose to use an overlay port, that way I have greater autonomy

@dg0yt

Kai Pastor (dg0yt) commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

AFAIU:

  • "Static registration" is a onnx capability which is expected with standalone onnx.
  • ONNX_DISABLE_STATIC_REGISTRATION is a setting takes away this capability, i.e. it is not additive.
    Thus it must not be modeled as a feature.
    Thus onnxruntime's manifest cannot express its dependency on this configuration.
  • An overlay port is not needed but overlay triplets might be.
    The suggested ONNX_DISABLE_STATIC_REGISTRATION can be injected from custom triplet files.
    (That's why it is printed.)
  • A permanent solution would be in the direction of [onnxruntime] new ports for microsoft/onnxruntime v1.23.2 #36850 (comment).

@patrikhuber

Patrik Huber (patrikhuber) commented Dec 17, 2025

Copy link
Copy Markdown
Contributor
  • An overlay port is not needed but overlay triplets might be.
    The suggested ONNX_DISABLE_STATIC_REGISTRATION can be injected from custom triplet files.
    (That's why it is printed.)

I was not able to inject ONNX_DISABLE_STATIC_REGISTRATION into the onnx build using an overlay triplet. I don't think this is possible - or how do you do it?

@dg0yt

Copy link
Copy Markdown
Contributor

https://learn.microsoft.com/en-us/vcpkg/users/triplets#per-port-customization +
https://learn.microsoft.com/en-us/vcpkg/users/triplets#vcpkg_cmake_configure_options

if(PORT STREQUAL "onnx")
    list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=1")
endif()

(Untested.)

@JoergAtGithub

Copy link
Copy Markdown
Contributor

Could it be that the real problem is thath onnxruntime tries to register the same stuff as onnx for some reason? Shouldn't the solution then that the types from onnx get removed from onnxruntime instead?

There is an unmerged PR for this since some years: microsoft/onnxruntime#12505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:new-port The issue is requesting a new library to be added; consider making a PR! info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ONNX Runtime] update to v1.17.0 [New Port Request] ONNX Runtime - ACL [New Port Request] ONNX Runtime