commit: 7dbd6abfbdbf98ad197bfa24f195627302f6697f Author: Pavel Sobolev <contact <AT> paveloom <DOT> dev> AuthorDate: Sun Dec 7 10:32:10 2025 +0000 Commit: Haelwenn Monnier <contact <AT> hacktivis <DOT> me> CommitDate: Wed Dec 10 16:14:12 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7dbd6abf
sci-libs/onnxruntime: add 1.23.2, drop 1.22.2 Signed-off-by: Pavel Sobolev <contact <AT> paveloom.dev> sci-libs/onnxruntime/Manifest | 2 +- ...e-1.22.2-add-a-missing-include-of-cstdint.patch | 15 ------ ...onnxruntime-1.23.2-fix-compilation-errors.patch | 58 ++++++++++++++++++++++ ... onnxruntime-1.23.2-use-system-libraries.patch} | 55 +++++++++++--------- ...ime-1.22.2.ebuild => onnxruntime-1.23.2.ebuild} | 8 +-- 5 files changed, 95 insertions(+), 43 deletions(-) diff --git a/sci-libs/onnxruntime/Manifest b/sci-libs/onnxruntime/Manifest index 89747bca66..22ebb55cbe 100644 --- a/sci-libs/onnxruntime/Manifest +++ b/sci-libs/onnxruntime/Manifest @@ -1,2 +1,2 @@ DIST eigen-3.4.0_p20250216.tar.bz2 2272941 BLAKE2B c86764a5c31b978d09f9f8f458a982fb16c2cdfd053e0c7a371fbe5b9c64bead42c25fb7d4cb795eb5ee7ff1800bb51fac6783ad0881dd69dee5d463ccd213e3 SHA512 3c9fab41bde1ee4b8f5ba21c991a75cc73e104cdb48f3377b5fc51afae8cbb5e891c39e4fd998c5263178a8962b09d9d907b9d125dfddc50bc2ec5171917d6b8 -DIST onnxruntime-1.22.2.tar.gz 241423673 BLAKE2B 831728ace1daed40793076703ac35260b0143d5ff3041eef57c08feb32d520ff363e4fc351551dbf713c62f30990f7dec24fee380d3aa36ec6d7303318f2f198 SHA512 af123f6374f522715caab28c8147882a7f1787e6616cb7226efd2fb02fd5935a7263c523d694e5dd1ea7971cdb2e71f939218231c2d18a8baba3e97171c3ef0b +DIST onnxruntime-1.23.2.tar.gz 283165408 BLAKE2B 33cee273820e8656dac567768672d1001bf2e3b095b9f4372407354388b36dfd01693055288885f706997eb51cc101482ba372412557c43d3bdd83b502ecc45c SHA512 373c51575ada457b8aead5d195a5f3eba62fb747b6370a2a9889fff875c40ea30af8fd49104d58cc86f79247410e829086b0979f37ca8635c6dd34960e9cc424 diff --git a/sci-libs/onnxruntime/files/onnxruntime-1.22.2-add-a-missing-include-of-cstdint.patch b/sci-libs/onnxruntime/files/onnxruntime-1.22.2-add-a-missing-include-of-cstdint.patch deleted file mode 100644 index f18a79de9e..0000000000 --- a/sci-libs/onnxruntime/files/onnxruntime-1.22.2-add-a-missing-include-of-cstdint.patch +++ /dev/null @@ -1,15 +0,0 @@ -From: Pavel Sobolev <[email protected]> -Subject: [PATCH] Add a missing include of `cstdint`. - -Signed-off-by: Pavel Sobolev <[email protected]> - ---- a/onnxruntime/core/optimizer/transpose_optimization/optimizer_api.h -+++ b/onnxruntime/core/optimizer/transpose_optimization/optimizer_api.h -@@ -10,6 +10,7 @@ - #include <string_view> - #include <unordered_map> - #include <unordered_set> -+#include <cstdint> - #include <vector> - - namespace onnx_transpose_optimization { diff --git a/sci-libs/onnxruntime/files/onnxruntime-1.23.2-fix-compilation-errors.patch b/sci-libs/onnxruntime/files/onnxruntime-1.23.2-fix-compilation-errors.patch new file mode 100644 index 0000000000..8b9a430fdf --- /dev/null +++ b/sci-libs/onnxruntime/files/onnxruntime-1.23.2-fix-compilation-errors.patch @@ -0,0 +1,58 @@ +From: Pavel Sobolev <[email protected]> +Subject: [PATCH] Fix compilation errors. + +Signed-off-by: Pavel Sobolev <[email protected]> + +--- a/onnxruntime/core/common/semver.h ++++ b/onnxruntime/core/common/semver.h +@@ -3,6 +3,7 @@ + + #pragma once + ++#include <cstdint> + #include <optional> + #include <string_view> + +--- a/onnxruntime/core/optimizer/transformer_memcpy.cc ++++ b/onnxruntime/core/optimizer/transformer_memcpy.cc +@@ -16,7 +16,7 @@ namespace onnxruntime { + static ProviderTypeToProviderMap GetProvidersByType( + const InlinedVector<gsl::not_null<const IExecutionProvider*>>& providers) { + ProviderTypeToProviderMap providers_by_type{}; +- for (const auto provider : providers) { ++ for (const auto& provider : providers) { + providers_by_type.emplace(provider->Type(), provider); + } + return providers_by_type; +@@ -100,7 +100,7 @@ static const onnx::TensorProto* GetInitializer(const Graph& graph, const std::st + // and mainly provides the subgraph recursion functionality + Status MemcpyTransformer::ApplyImpl(Graph& graph, bool& modified, int graph_level, + const logging::Logger& logger) const { +- for (const auto provider : providers_) { ++ for (const auto& provider : providers_) { + const auto& provider_type = provider->Type(); + if (!utils::ProviderIsCpuBased(*provider)) { + TransformerMemcpyImpl copy_impl(graph, *provider, providers_by_type_); +--- a/onnxruntime/test/contrib_ops/gather_block_quantized_op_test.cc ++++ b/onnxruntime/test/contrib_ops/gather_block_quantized_op_test.cc +@@ -82,7 +82,7 @@ void CheckDataAndShape(const std::vector<T>& data, const std::vector<int64_t>& s + + ORT_ENFORCE(static_cast<int64_t>(data.size()) == total_elements, "Data size does not match the shape", + "Data size: ", data.size(), ", Expected size: ", total_elements, +- ", Shape: ", VectorToString(shape), " Name:", name, " Type:", typeid(T).name()); ++ ", Shape: ", VectorToString(shape), " Name:", name); + } + + // Combinations: types, gather_axis, quantize_axis, block_size, indices, scale shape vs data shape +--- a/onnxruntime/test/onnx/pb_helper.h ++++ b/onnxruntime/test/onnx/pb_helper.h +@@ -41,7 +41,7 @@ + #include <google/protobuf/message_lite.h> + #include <google/protobuf/io/coded_stream.h> + #include <google/protobuf/io/zero_copy_stream_impl.h> +-#include <onnx/onnx-data_pb.h> ++#include <onnx/onnx-data.pb.h> + #include "tml.pb.h" + #ifdef __GNUC__ + #pragma GCC diagnostic pop + diff --git a/sci-libs/onnxruntime/files/onnxruntime-1.22.2-use-system-libraries.patch b/sci-libs/onnxruntime/files/onnxruntime-1.23.2-use-system-libraries.patch similarity index 84% rename from sci-libs/onnxruntime/files/onnxruntime-1.22.2-use-system-libraries.patch rename to sci-libs/onnxruntime/files/onnxruntime-1.23.2-use-system-libraries.patch index e5eeee3af4..cbc687bb39 100644 --- a/sci-libs/onnxruntime/files/onnxruntime-1.22.2-use-system-libraries.patch +++ b/sci-libs/onnxruntime/files/onnxruntime-1.23.2-use-system-libraries.patch @@ -7,18 +7,18 @@ Signed-off-by: Pavel Sobolev <[email protected]> --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake -@@ -28,7 +28,7 @@ onnxruntime_fetchcontent_declare( +@@ -36,7 +36,7 @@ onnxruntime_fetchcontent_declare( URL_HASH SHA1=${DEP_SHA1_abseil_cpp} EXCLUDE_FROM_ALL PATCH_COMMAND ${ABSL_PATCH_COMMAND} -- FIND_PACKAGE_ARGS 20240722 NAMES absl +- FIND_PACKAGE_ARGS 20250512 NAMES absl + FIND_PACKAGE_ARGS NAMES absl REQUIRED ) onnxruntime_fetchcontent_makeavailable(abseil_cpp) --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake -@@ -40,7 +40,7 @@ onnxruntime_fetchcontent_declare( +@@ -43,7 +43,7 @@ onnxruntime_fetchcontent_declare( URL ${DEP_URL_re2} URL_HASH SHA1=${DEP_SHA1_re2} EXCLUDE_FROM_ALL @@ -27,7 +27,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) onnxruntime_fetchcontent_makeavailable(re2) -@@ -68,7 +68,7 @@ if (onnxruntime_BUILD_UNIT_TESTS) +@@ -71,7 +71,7 @@ if (onnxruntime_BUILD_UNIT_TESTS) URL ${DEP_URL_googletest} URL_HASH SHA1=${DEP_SHA1_googletest} EXCLUDE_FROM_ALL @@ -36,7 +36,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) FetchContent_MakeAvailable(googletest) endif() -@@ -84,7 +84,7 @@ if (onnxruntime_BUILD_BENCHMARKS) +@@ -87,7 +87,7 @@ if (onnxruntime_BUILD_BENCHMARKS) URL ${DEP_URL_google_benchmark} URL_HASH SHA1=${DEP_SHA1_google_benchmark} EXCLUDE_FROM_ALL @@ -45,7 +45,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) onnxruntime_fetchcontent_makeavailable(google_benchmark) endif() -@@ -102,7 +102,7 @@ if(onnxruntime_USE_MIMALLOC) +@@ -105,7 +105,7 @@ if(onnxruntime_USE_MIMALLOC) URL ${DEP_URL_mimalloc} URL_HASH SHA1=${DEP_SHA1_mimalloc} EXCLUDE_FROM_ALL @@ -54,7 +54,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) FetchContent_MakeAvailable(mimalloc) endif() -@@ -191,7 +191,7 @@ onnxruntime_fetchcontent_declare( +@@ -198,7 +198,7 @@ onnxruntime_fetchcontent_declare( URL_HASH SHA1=${DEP_SHA1_protobuf} PATCH_COMMAND ${ONNXRUNTIME_PROTOBUF_PATCH_COMMAND} EXCLUDE_FROM_ALL @@ -63,7 +63,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE) -@@ -271,7 +271,7 @@ onnxruntime_fetchcontent_declare( +@@ -278,7 +278,7 @@ onnxruntime_fetchcontent_declare( URL ${DEP_URL_date} URL_HASH SHA1=${DEP_SHA1_date} EXCLUDE_FROM_ALL @@ -72,16 +72,23 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) onnxruntime_fetchcontent_makeavailable(date) -@@ -285,7 +285,7 @@ if(NOT TARGET Boost::mp11) +@@ -292,12 +292,11 @@ if(NOT TARGET Boost::mp11) mp11 URL ${DEP_URL_mp11} EXCLUDE_FROM_ALL - FIND_PACKAGE_ARGS NAMES Boost + FIND_PACKAGE_ARGS NAMES Boost REQUIRED ) - onnxruntime_fetchcontent_makeavailable(mp11) +- FetchContent_Populate(mp11) ++ onnxruntime_fetchcontent_makeavailable(mp11) if(NOT TARGET Boost::mp11) -@@ -302,7 +302,7 @@ onnxruntime_fetchcontent_declare( +- add_library(Boost::mp11 IMPORTED INTERFACE) +- target_include_directories(Boost::mp11 INTERFACE $<BUILD_INTERFACE:${mp11_SOURCE_DIR}/include>) ++ add_library(Boost::mp11 ALIAS Boost::headers) + endif() + endif() + endif() +@@ -310,7 +310,7 @@ onnxruntime_fetchcontent_declare( URL ${DEP_URL_json} URL_HASH SHA1=${DEP_SHA1_json} EXCLUDE_FROM_ALL @@ -90,7 +97,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) onnxruntime_fetchcontent_makeavailable(nlohmann_json) -@@ -366,7 +366,7 @@ if (CPUINFO_SUPPORTED) +@@ -380,7 +380,7 @@ if (CPUINFO_SUPPORTED) URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo} EXCLUDE_FROM_ALL PATCH_COMMAND ${Patch_EXECUTABLE} -p1 < ${PROJECT_SOURCE_DIR}/patches/cpuinfo/9bb12d342fd9479679d505d93a478a6f9cd50a47.patch @@ -99,7 +106,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) else() onnxruntime_fetchcontent_declare( -@@ -374,7 +374,7 @@ if (CPUINFO_SUPPORTED) +@@ -388,7 +388,7 @@ if (CPUINFO_SUPPORTED) URL ${DEP_URL_pytorch_cpuinfo} URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo} EXCLUDE_FROM_ALL @@ -108,7 +115,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) endif() set(ONNXRUNTIME_CPUINFO_PROJ pytorch_cpuinfo) -@@ -392,7 +392,7 @@ if(onnxruntime_USE_CUDA) +@@ -406,7 +406,7 @@ if(onnxruntime_USE_CUDA) URL_HASH SHA1=${DEP_SHA1_microsoft_gsl} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/gsl/1064.patch EXCLUDE_FROM_ALL @@ -117,7 +124,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) else() onnxruntime_fetchcontent_declare( -@@ -400,14 +400,14 @@ else() +@@ -414,7 +414,7 @@ else() URL ${DEP_URL_microsoft_gsl} URL_HASH SHA1=${DEP_SHA1_microsoft_gsl} EXCLUDE_FROM_ALL @@ -126,15 +133,16 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) endif() set(GSL_TARGET "Microsoft.GSL::GSL") - set(GSL_INCLUDE_DIR "$<TARGET_PROPERTY:${GSL_TARGET},INTERFACE_INCLUDE_DIRECTORIES>") - onnxruntime_fetchcontent_makeavailable(GSL) +@@ -428,7 +428,7 @@ if (NOT GSL_FOUND AND NOT onnxruntime_BUILD_SHARED_LIB) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() -find_path(safeint_SOURCE_DIR NAMES "SafeInt.hpp") +find_path(safeint_SOURCE_DIR NAMES "SafeInt.hpp" REQUIRED) if(NOT safeint_SOURCE_DIR) unset(safeint_SOURCE_DIR) onnxruntime_fetchcontent_declare( -@@ -449,10 +449,14 @@ onnxruntime_fetchcontent_declare( +@@ -470,10 +470,14 @@ onnxruntime_fetchcontent_declare( URL_HASH SHA1=${DEP_SHA1_flatbuffers} PATCH_COMMAND ${ONNXRUNTIME_FLATBUFFERS_PATCH_COMMAND} EXCLUDE_FROM_ALL @@ -150,16 +158,16 @@ Signed-off-by: Pavel Sobolev <[email protected]> if(NOT flatbuffers_FOUND) if(NOT TARGET flatbuffers::flatbuffers) add_library(flatbuffers::flatbuffers ALIAS flatbuffers) -@@ -514,7 +514,7 @@ onnxruntime_fetchcontent_declare( +@@ -535,7 +539,7 @@ onnxruntime_fetchcontent_declare( URL_HASH SHA1=${DEP_SHA1_onnx} PATCH_COMMAND ${ONNXRUNTIME_ONNX_PATCH_COMMAND} EXCLUDE_FROM_ALL - FIND_PACKAGE_ARGS NAMES ONNX onnx + FIND_PACKAGE_ARGS NAMES ONNX onnx REQUIRED ) - if (NOT onnxruntime_MINIMAL_BUILD) - onnxruntime_fetchcontent_makeavailable(onnx) -@@ -597,7 +597,7 @@ if(onnxruntime_ENABLE_DLPACK) + + onnxruntime_fetchcontent_makeavailable(onnx) +@@ -611,7 +615,7 @@ if(onnxruntime_ENABLE_DLPACK) URL ${DEP_URL_dlpack} URL_HASH SHA1=${DEP_SHA1_dlpack} EXCLUDE_FROM_ALL @@ -168,7 +176,7 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) onnxruntime_fetchcontent_makeavailable(dlpack) endif() -@@ -610,7 +610,7 @@ if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxrunt +@@ -624,7 +628,7 @@ if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxrunt URL ${DEP_URL_cxxopts} URL_HASH SHA1=${DEP_SHA1_cxxopts} EXCLUDE_FROM_ALL @@ -224,3 +232,4 @@ Signed-off-by: Pavel Sobolev <[email protected]> ) onnxruntime_fetchcontent_makeavailable(googlexnnpack) set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) + diff --git a/sci-libs/onnxruntime/onnxruntime-1.22.2.ebuild b/sci-libs/onnxruntime/onnxruntime-1.23.2.ebuild similarity index 92% rename from sci-libs/onnxruntime/onnxruntime-1.22.2.ebuild rename to sci-libs/onnxruntime/onnxruntime-1.23.2.ebuild index 3dab9ab6c8..7e7cb72da9 100644 --- a/sci-libs/onnxruntime/onnxruntime-1.22.2.ebuild +++ b/sci-libs/onnxruntime/onnxruntime-1.23.2.ebuild @@ -32,7 +32,7 @@ RDEPEND=" dev-libs/cpuinfo dev-libs/protobuf:= dev-libs/re2:= - <sci-ml/onnx-1.18[disableStaticReg] + sci-ml/onnx[disableStaticReg] python? ( ${PYTHON_DEPS} @@ -69,10 +69,10 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}/${PN}-1.22.2-add-a-missing-include-of-cstdint.patch" "${FILESDIR}/${PN}-1.22.2-relax-the-dependency-on-flatbuffers.patch" "${FILESDIR}/${PN}-1.22.2-remove-the-absl-low_level_hash-target.patch" - "${FILESDIR}/${PN}-1.22.2-use-system-libraries.patch" + "${FILESDIR}/${PN}-1.23.2-fix-compilation-errors.patch" + "${FILESDIR}/${PN}-1.23.2-use-system-libraries.patch" ) CMAKE_USE_DIR="${S}/cmake" @@ -111,7 +111,7 @@ python_test() { } src_test() { - export GTEST_FILTER="*:-ActivationOpNoInfTest.Softsign" + export GTEST_FILTER="*:-ActivationOpNoInfTest.Softsign:LayoutTransformationPotentiallyAddedOpsTests.OpsHaveLatestVersions" cmake_src_test if use python ; then
