## START: Set by rpmautospec ## (rpmautospec version 0.8.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %if 0%{?fedora} && ! 0%{?flatpak} %ifarch x86_64 %bcond migraphx 1 %else %bcond migraphx 0 %endif %else %bcond migraphx 0 %endif %bcond test 1 # $backend will be evaluated below %global backends cpu %if %{with migraphx} %global backends %backends migraphx %endif Summary: A cross-platform inferencing and training accelerator Name: onnxruntime Version: 1.26.0 Release: %autorelease # onnxruntime and SafeInt are MIT # onnx is Apache License 2.0 # optional-lite is Boost Software License 1.0 # some protobuf helper files files are BSD (protobuf_function.cmake, pb_helper.*) License: MIT AND Apache-2.0 AND BSL-1.0 AND BSD-3-Clause URL: https://github.com/microsoft/onnxruntime Source0: https://github.com/microsoft/onnxruntime/archive/v%{version}/%{name}-%{version}.tar.gz # Disable downloading dependencies Patch: 0000-Disable-download-deps.patch # Use the system date and boost Patch: 0001-System-date-and-mp11.patch # Use the system safeint Patch: 0002-System-safeint.patch # Use the system eigen3 Patch: 0003-System-eigen3.patch # Use the system flatbuffers Patch: 0004-System-flatbuffers.patch # Disable gcc -Werrors with false positives Patch: 0005-GCC-false-positives.patch # Trigger onnx fix for onnxruntime_providers_shared Patch: 0006-Fix-onnx-static-registration.patch # migraphx Patch: 0007-migraphx-Fix-C-20-deprecated-this-capture.patch # armv7hl: https://bugzilla.redhat.com/show_bug.cgi?id=2235328 # i686: https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: s390x %{arm} %{ix86} Obsoletes: onnxruntime-rocm < %version-%release Provides: onnxruntime-rocm = %version-%release BuildRequires: cmake >= 3.13 BuildRequires: make BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: onnx-devel = 1.21.0 BuildRequires: abseil-cpp-devel BuildRequires: boost-devel >= 1.66 BuildRequires: bzip2 %ifnarch ppc64le BuildRequires: cpuinfo-devel %endif BuildRequires: date-devel BuildRequires: flatbuffers-compiler BuildRequires: flatbuffers-devel >= 23.5.26 BuildRequires: gmock-devel BuildRequires: gsl-devel BuildRequires: gtest-devel BuildRequires: guidelines-support-library-devel BuildRequires: json-devel BuildRequires: protobuf-devel >= 4 BuildRequires: python3-devel BuildRequires: python3-numpy BuildRequires: python3-setuptools BuildRequires: python3-wheel BuildRequires: python3-pip BuildRequires: re2-devel >= 20211101 BuildRequires: safeint-devel BuildRequires: zlib-devel Buildrequires: eigen3-devel >= 1.34 BuildRequires: pybind11-devel %if %{with migraphx} BuildRequires: migraphx-devel BuildRequires: miopen-devel BuildRequires: rocblas-devel %endif %description %{name} is a cross-platform inferencing and training accelerator compatible with many popular ML/DNN frameworks, including PyTorch, TensorFlow/Keras, scikit-learn, and more. %package devel Summary: The development part of the %{name} package Requires: %{name}%{_isa} = %{version}-%{release} Obsoletes: onnxruntime-rocm-devel < %version-%release Provides: onnxruntime-rocm-devel = %version-%release %description devel The development part of the %{name} package %package -n python3-onnxruntime Summary: %{summary} Requires: %{name}%{_isa} = %{version}-%{release} %description -n python3-onnxruntime Python bindings for the %{name} package %if %{with migraphx} %package -n python3-onnxruntime-migraphx Summary: %{summary} Requires: %{name}%{_isa} = %{version}-%{release} Conflicts: python3-onnxruntime Provides: python3-onnxruntime = %{version}-%{release} RemovePathPostfixes: .migraphx:.migraphx.pyc %description -n python3-onnxruntime-migraphx Python bindings for the %{name} package using the migraphx provider %endif %package doc Summary: Documentation files for the %{name} package %description doc Documentation files for the %{name} package %if %{with test} %package tests Summary: The tests binaries of the %{name} package Requires: %{name}%{_isa} = %{version}-%{release} %description tests The tests of the %{name} package %endif %prep %autosetup -p1 # Downstream-only: do not pin the version of abseil-cpp; use what we have. sed -r -i 's/(FIND_PACKAGE_ARGS[[:blank:]]+)[0-9]{8}/\1/' \ cmake/external/abseil-cpp.cmake # Remove unnecesary folders rm -rf onnxruntime/cmake/external/{onnx,libprotobuf-mutator,emsdk} %build # Re-compile flatbuffers schemas with the system flatc %{python3} onnxruntime/core/flatbuffers/schema/compile_schema.py --flatc /usr/bin/flatc %{python3} onnxruntime/lora/adapter_format/compile_schema.py --flatc /usr/bin/flatc %cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -Donnxruntime_BUILD_BENCHMARKS=OFF \ -Donnxruntime_BUILD_SHARED_LIB=ON \ -Donnxruntime_BUILD_UNIT_TESTS=ON \ -Donnxruntime_ENABLE_PYTHON=ON \ -DPYTHON_VERSION=%{python3_version} \ -Donnxruntime_ENABLE_ABSEIL=ON \ -Donnxruntime_ENABLE_DLPACK=OFF \ -Donnxruntime_USE_FULL_PROTOBUF=ON \ -Donnxruntime_USE_NEURAL_SPEED=OFF \ -Donnxruntime_USE_PREINSTALLED_EIGEN=ON \ -Deigen_SOURCE_PATH=/usr/include/eigen3 \ -DCMAKE_INSTALL_LIBDIR=%{_lib} \ -DCMAKE_INSTALL_INCLUDEDIR=include \ %ifarch ppc64le -Donnxruntime_ENABLE_CPUINFO=OFF \ %else -Donnxruntime_ENABLE_CPUINFO=ON \ %endif %if %{with test} -Donnxruntime_INSTALL_UNIT_TESTS=ON \ %else -Donnxruntime_INSTALL_UNIT_TESTS=OFF \ %endif %if %{with migraphx} -Donnxruntime_USE_MIGRAPHX=ON \ %endif -S cmake %cmake_build # Build python libs cp -R ./%{__cmake_builddir}/onnxruntime/* ./onnxruntime cp ./%{__cmake_builddir}/requirements.txt ./requirements.txt for backend in %backends; do if [ "${backend}" == "cpu" ]; then %pyproject_wheel elif [ "${backend}" == "migraphx" ]; then %pyproject_wheel -C--global-option=--use_migraphx fi mkdir -p dist_onnxruntime_${backend} mv %{_pyproject_wheeldir}/*.whl dist_onnxruntime_${backend}/ done %install %cmake_install mkdir -p "%{buildroot}/%{_docdir}/" cp --preserve=timestamps -r "./docs/" "%{buildroot}/%{_docdir}/%{name}" rm -rf %{buildroot}/usr/lib/debug/ mkdir -p %{_builddir}/sitearch_acumulator for backend in %backends; do rm -rf %{_pyproject_wheeldir}/* cp dist_onnxruntime_${backend}/*.whl %{_pyproject_wheeldir}/ rm -f %{_pyproject_record} rm -rf %{buildroot}%{python3_sitearch} mkdir -p %{buildroot}%{python3_sitearch} %pyproject_install if [ "${backend}" = "cpu" ]; then %pyproject_save_files onnxruntime cp %{pyproject_files} %{_builddir}/files_${backend} else %pyproject_save_files onnxruntime 'onnxruntime*' cp %{pyproject_files} %{_builddir}/files_${backend} sed -i '/^%dir/! { /\.dist-info/! s/$/.'"${backend}"'/}' %{_builddir}/files_${backend} sed -i 's/.pyc.'"${backend}"'$/.pyc.'"${backend}"'.pyc/' %{_builddir}/files_${backend} find %{buildroot}%{python3_sitearch}/onnxruntime/ -type f -exec bash -c 'mv "${0}" "${0}.'"${backend}"'"' {} \; find %{buildroot}%{python3_sitearch}/onnxruntime/ -type f -iname "*.pyc.${backend}" -exec bash -c 'mv "${0}" "${0}.pyc"' {} \; fi cp -a %{buildroot}%{python3_sitearch}/* %{_builddir}/sitearch_acumulator/ done mkdir -p %{buildroot}%{python3_sitearch}/ cp -a %{_builddir}/sitearch_acumulator/* %{buildroot}%{python3_sitearch}/ rm -rf %{_builddir}/sitearch_acumulator %if %{with test} %check %endif %files %license LICENSE %doc ThirdPartyNotices.txt %{_libdir}/libonnxruntime.so %{_libdir}/libonnxruntime_providers_shared.so %if %{with migraphx} %{_libdir}/libonnxruntime_providers_migraphx.so %endif %files devel %dir %{_includedir}/onnxruntime/ %{_includedir}/onnxruntime/* %{_libdir}/libonnxruntime.so.* %{_libdir}/pkgconfig/libonnxruntime.pc %{_libdir}/cmake/onnxruntime/* %files -n python3-onnxruntime -f %{_builddir}/files_cpu %if %{with migraphx} %files -n python3-onnxruntime-migraphx -f %{_builddir}/files_migraphx %endif %files doc %{_docdir}/%{name} %if %{with test} %files tests %{_bindir}/onnx_test_runner %{_bindir}/onnxruntime_test %endif %changelog ## START: Generated by rpmautospec * Thu Jun 04 2026 Diego Herrera - 1.26.0-1 - Release 1.26.0 * Tue May 19 2026 Miroslav Suchý - 1.22.2-4 - Use protobuf3 instead of protobuf * Wed Apr 15 2026 Diego Herrera - 1.22.2-3 - Rebuild for cpuinfo 25.11.14 * Wed Jan 28 2026 Benjamin A. Beasley - 1.22.2-2 - Rebuilt for abseil-cpp 20260107.0 * Wed Jan 21 2026 Diego Herrera - 1.22.2-1 - Release 1.22.2 * Wed Jan 21 2026 Tom Rix - 1.20.1-28 - ROCm does not support CUBLAS_GEMM_DEFAULT_TENSOR_OP * Fri Jan 16 2026 Fedora Release Engineering - 1.20.1-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild * Mon Dec 01 2025 Miroslav Suchý - 1.20.1-26 - Migrate to SPDX license * Wed Oct 22 2025 Yaakov Selkowitz - 1.20.1-25 - Disable rocm for flatpak builds * Fri Oct 03 2025 Tom Rix - 1.20.1-24 - Changes for ROCm 7 * Fri Sep 19 2025 Python Maint - 1.20.1-23 - Rebuilt for Python 3.14.0rc3 bytecode * Sat Aug 30 2025 Benjamin A. Beasley - 1.20.1-22 - Fix compatibility with abseil-cpp 20250814 * Fri Aug 15 2025 Python Maint - 1.20.1-21 - Rebuilt for Python 3.14.0rc2 bytecode * Thu Jul 24 2025 Fedora Release Engineering - 1.20.1-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild * Mon Jun 23 2025 Alejandro Alvarez Ayllon - 1.20.1-19 - Rebuild for protobuf and protobuf * Tue Jun 03 2025 Python Maint - 1.20.1-18 - Rebuilt for Python 3.14 * Mon May 26 2025 Benjamin A. Beasley - 1.20.1-17 - Rebuilt for abseil-cpp 20250512.0 * Fri Mar 21 2025 Diego Herrera - 1.20.1-16 - Move rocm provider library to base library package * Thu Mar 20 2025 Tom Rix - 1.20.1-15 - Split ROCm out as a subpackage. * Wed Mar 19 2025 Tom Rix - 1.20.1-14 - Add ROCm support * Sat Mar 08 2025 Tom Rix - 1.20.1-13 - convert gsl::byte to std::byte * Tue Feb 25 2025 Benjamin A. Beasley - 1.20.1-12 - Rebuilt for abseil-cpp-20250127.0 * Tue Feb 18 2025 Benjamin A. Beasley - 1.20.1-11 - Re-compile flatbuffers schemas in %%build rather than in %%prep * Tue Feb 18 2025 Benjamin A. Beasley - 1.20.1-10 - Do not pin the version of abseil-cpp * Tue Feb 18 2025 Benjamin A. Beasley - 1.20.1-9 - Rebuilt for flatbuffers 25.2.10 * Sat Feb 08 2025 Benjamin A. Beasley - 1.20.1-8 - Rebuilt for flatbuffers 25.1.24 * Wed Jan 29 2025 Diego Herrera - 1.20.1-7 - Add -Wno-error flag * Wed Jan 29 2025 Diego Herrera - 1.20.1-6 - Fix errors associated with c++15 deprecations * Sat Jan 25 2025 Benjamin A. Beasley - 1.20.1-5 - Build without -Werror; fixes RHBZ#2342082 * Fri Jan 17 2025 Fedora Release Engineering - 1.20.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Tue Jan 07 2025 Diego Herrera - 1.20.1-3 - Generate flatbuffers headers propperly using flatc * Sat Jan 04 2025 Benjamin A. Beasley - 1.20.1-2 - Rebuilt for flatbuffers 24.12.24 * Mon Dec 30 2024 Diego Herrera - 1.20.1-1 - Release 1.20.1 * Mon Dec 23 2024 Orion Poplawski - 1.17.3-7 - Rebuild with numpy 2.x (rhbz#2333780) * Fri Nov 01 2024 Alejandro Alvarez Ayllon - 1.17.3-6 - Rebuild for cpuinfo 24.09.26 * Sun Aug 25 2024 Benjamin A. Beasley - 1.17.3-5 - Rebuilt for abseil-cpp-20240722.0 * Thu Aug 15 2024 Denis Arnaud - 1.17.3-4 - Migrated RPM spec file to autorelease and autochangelog * Thu Jul 18 2024 Fedora Release Engineering - 1.17.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sat Jun 08 2024 Python Maint - 1.17.3-2 - Rebuilt for Python 3.13 * Wed May 15 2024 Diego Herrera - 1.17.3-1 - Release 1.17.3 * Tue May 07 2024 Alejandro Alvarez Ayllon - 1.16.3-5 - Fix libonnxruntime.pc include path. Fix onnxruntime import. * Fri Apr 05 2024 Benjamin A. Beasley - 1.16.3-4 - Rebuilt for flatbuffers 24.3.25 * Tue Mar 26 2024 Benjamin A. Beasley - 1.16.3-3 - Rebuilt for flatbuffers 24.3.7 * Wed Mar 20 2024 Alejandro Alvarez Ayllon - 1.16.3-2 - Rebuild for cpuinfo 23.11.04 * Mon Feb 26 2024 Diego Herrera - 1.16.3-1 - Release 1.16.3 * Sat Feb 24 2024 Paul Wouters - 1.15.1-12 - Rebuilt for libre2.so.11 bump * Sun Feb 04 2024 Benjamin A. Beasley - 1.15.1-11 - Rebuilt for abseil-cpp-20240116.0 * Wed Jan 24 2024 Alejandro Alvarez Ayllon - 1.15.1-10 - Build using protobuf-devel * Sun Jan 21 2024 Fedora Release Engineering - 1.15.1-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Wed Sep 20 2023 Diego Herrera - 1.15.1-8 - Disable static registration on runtime * Thu Aug 31 2023 Diego Herrera - 1.15.1-7 - Fix python package build dependencies * Wed Aug 30 2023 Diego Herrera - 1.15.1-6 - Add python library * Mon Aug 28 2023 Alejandro Alvarez Ayllon - 1.15.1-5 - Create bugs for ExcludeArch * Fri Aug 18 2023 Alejandro Alvarez Ayllon - 1.15.1-4 - Conditionally use cpuinfo * Fri Aug 18 2023 Alejandro Alvarez Ayllon - 1.15.1-3 - Need to disable a test in aarch64 * Thu Aug 17 2023 Alejandro Alvarez Ayllon - 1.15.1-2 - Enable build on aarch64 * Wed Aug 16 2023 Alejandro Alvarez Ayllon - 1.15.1-1 - Initial import (fedora#2021459). ## END: Generated by rpmautospec