diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-02-13 23:37:08 +0100 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-03-07 03:09:48 +0100 |
| commit | a2dbf339f1a35c21da01d0ad2e724ed5b345ad20 (patch) | |
| tree | ed9c209447445cf6f7c0959808b55239f783566a /gnu/packages/machine-learning.scm | |
| parent | 0148e0a20393de1090b23eb9b358fab39dcd5212 (diff) | |
gnu: onnxruntime: Fix integration into projects.
* gnu/packages/patches/onnxruntime-1.22.0-splittosequence-bool.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/machine-learning.scm (onnxruntime)[source]: Use patch.
[arguments]<#:configure-flags>: Enable onnxruntime_USE_FULL_PROTOBUF,
Protobuf_USE_STATIC_LIBS=ON.
[inputs]: Replace onnx by onnx-for-onnxruntime.
Replace protobuf by protobuf-static-for-onnxruntime.
Change-Id: I20d8172b9c4e81ce351cf40102be7db388387a0d
Diffstat (limited to 'gnu/packages/machine-learning.scm')
| -rw-r--r-- | gnu/packages/machine-learning.scm | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 005fca18ab8..74084019b64 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -2203,7 +2203,14 @@ with a single function call.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0z2s79l4wdilssw9lmj319ypyyqi2y0dx0fpwr2yhq8bax3ci50n")))) + (base32 "0z2s79l4wdilssw9lmj319ypyyqi2y0dx0fpwr2yhq8bax3ci50n")) + (patches + (search-patches + ;; SplitToSequence operator was missing bool type support, despite + ;; the ONNX spec allowing it in models. Fixed upstream in 1.23+, + ;; but we cannot upgrade because ROCm support was removed in 1.23. + ;; <https://github.com/microsoft/onnxruntime/pull/24929> + "onnxruntime-1.22.0-splittosequence-bool.patch")))) (build-system cmake-build-system) (arguments (list @@ -2217,7 +2224,12 @@ with a single function call.") "-Donnxruntime_BUILD_SHARED_LIB=ON" "-Donnxruntime_ENABLE_LTO=ON" "-Donnxruntime_ENABLE_PYTHON=ON" - "-Donnxruntime_USE_FULL_PROTOBUF=OFF" + "-Donnxruntime_USE_FULL_PROTOBUF=ON" + ;; Link static protobuf, matching upstream's vcpkg approach. + ;; This keeps the protobuf descriptor pool inside + ;; onnxruntime_pybind11_state.so separate from the shared + ;; libprotobuf.so used by the regular onnx Python package. + "-DProtobuf_USE_STATIC_LIBS=ON" ;; XXX: Fixes build with gcc@14. "-DCMAKE_CXX_FLAGS=-Wl,-z,noexecstack") #:phases @@ -2296,8 +2308,8 @@ with a single function call.") flatbuffers-23.5 googletest nlohmann-json - onnx - protobuf + onnx-for-onnxruntime + protobuf-static-for-onnxruntime pybind11-2 re2-next safeint |
