From a2dbf339f1a35c21da01d0ad2e724ed5b345ad20 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 13 Feb 2026 23:37:08 +0100 Subject: 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 --- gnu/packages/machine-learning.scm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'gnu/packages/machine-learning.scm') 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. + ;; + "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 -- cgit v1.3