public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Alexander F. Lent <lx@xanderlent.com>
To: git-commits@fedoraproject.org
Subject: [rpms/openvino] origin/pr/7/head: Enable ONNX Frontend
Date: Wed, 10 Jun 2026 16:59:18 GMT	[thread overview]
Message-ID: <178111075821.1.6721050555560443813.rpms-openvino-bc9d3f256406@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/openvino
            Branch : origin/pr/7/head
            Commit : bc9d3f256406ae5607d7209d208c60a60772da17
            Author : Alexander F. Lent <lx@xanderlent.com>
            Date   : 2025-03-03T12:01:58+00:00
            Stats  : +72/-2 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/openvino/c/bc9d3f256406ae5607d7209d208c60a60772da17?branch=origin/pr/7/head

            Log:
            Enable ONNX Frontend

This introduces a new subpackage, libopenvino-onnx-frontend, which
contains the ONNX frontend for OpenVINO.

The new patch contains some tweaks to make it build against the
system-provided protobuf and ONNX libraries.
(I think with ONNX we are supposed to include its CMake files
somehow, but I'm not a CMake expert, so I manually set the vars.)

Signed-off-by: Alexander F. Lent <lx@xanderlent.com>

---
diff --git a/onnx-frontend-enable.patch b/onnx-frontend-enable.patch
new file mode 100644
index 0000000..3d8ea0d
--- /dev/null
+++ b/onnx-frontend-enable.patch
@@ -0,0 +1,53 @@
+diff -ur a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake
+--- a/cmake/developer_package/frontends/frontends.cmake	2024-11-09 01:14:37.000000000 -0500
++++ b/cmake/developer_package/frontends/frontends.cmake	2024-11-09 01:14:37.000000000 -0500
+@@ -246,7 +246,7 @@
+             set(protobuf_target_name libprotobuf-lite)
+             set(protobuf_install_name "protobuf_lite_installed")
+         else()
+-            set(protobuf_target_name libprotobuf)
++            set(protobuf_target_name protobuf)
+             set(protobuf_install_name "protobuf_installed")
+         endif()
+         if(ENABLE_SYSTEM_PROTOBUF)
+diff -ur a/src/frontends/common/CMakeLists.txt b/src/frontends/common/CMakeLists.txt
+--- a/src/frontends/common/CMakeLists.txt	2024-11-09 01:14:37.000000000 -0500
++++ b/src/frontends/common/CMakeLists.txt	2024-11-09 01:14:37.000000000 -0500
+@@ -83,6 +83,6 @@
+         ${OV_CPACK_COMP_CORE_DEV_EXCLUDE_ALL})
+ 
+ # Shutdown protobuf library
+-if(Protobuf_IN_FRONTEND AND BUILD_SHARED_LIBS)
++if(BUILD_SHARED_LIBS)
+     add_subdirectory(shutdown_protobuf)
+ endif()
+diff -ur a/src/frontends/common/shutdown_protobuf/CMakeLists.txt b/src/frontends/common/shutdown_protobuf/CMakeLists.txt
+--- a/src/frontends/common/shutdown_protobuf/CMakeLists.txt	2024-11-09 01:14:37.000000000 -0500
++++ b/src/frontends/common/shutdown_protobuf/CMakeLists.txt	2024-11-09 01:14:37.000000000 -0500
+@@ -9,7 +9,7 @@
+ add_library(openvino::protobuf_shutdown ALIAS ${TARGET_NAME})
+ set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME protobuf_shutdown)
+ 
+-target_include_directories(${TARGET_NAME} SYSTEM PRIVATE
+-    $<BUILD_INTERFACE:$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>>)
+-set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
+-target_compile_features(${TARGET_NAME} PRIVATE $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_COMPILE_FEATURES>)
++#target_include_directories(${TARGET_NAME} SYSTEM PRIVATE
++#    $<BUILD_INTERFACE:$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>>)
++#set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
++#target_compile_features(${TARGET_NAME} PRIVATE $<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_COMPILE_FEATURES>)
+diff -ur a/src/frontends/onnx/CMakeLists.txt b/src/frontends/onnx/CMakeLists.txt
+--- a/src/frontends/onnx/CMakeLists.txt	2024-11-09 01:14:37.000000000 -0500
++++ b/src/frontends/onnx/CMakeLists.txt	2024-11-09 01:14:37.000000000 -0500
+@@ -2,6 +2,11 @@
+ # SPDX-License-Identifier: Apache-2.0
+ #
+ 
++# TODO: Replace these with including the defs from ONNX's CMake files
++add_definitions(-DONNX_NAMESPACE=onnx -DONNX_ML=1)
++# TODO: The ONNX frontend uses functions only available in -std=c++17
++add_compile_options(-std=c++17)
++
+ add_subdirectory(onnx_common)
+ add_subdirectory(frontend)
+ 

diff --git a/openvino.spec b/openvino.spec
index 4d93b0b..3f803b4 100644
--- a/openvino.spec
+++ b/openvino.spec
@@ -50,6 +50,7 @@ Patch0:		openvino-fedora.patch
 # Support numpy 2.2.0
 Patch1:		https://github.com/openvinotoolkit/openvino/pull/28039.patch
 Patch2:		npu-level-zero.patch
+Patch3:		onnx-frontend-enable.patch
 
 ExclusiveArch:	x86_64
 
@@ -69,12 +70,15 @@ BuildRequires:	zlib-ng-compat-devel
 BuildRequires:	xbyak-devel
 BuildRequires:	yaml-cpp-devel
 BuildRequires:	tbb-devel
+BuildRequires:	onnx-devel
+BuildRequires:	protobuf-devel
 # forked version of OpenVINO oneDNN does not have a proper version
 Provides:	bundled(onednn)
 # MLAS upstream does not have any release
 Provides:	bundled(mlas)
 Requires:	lib%{name}-ir-frontend = %{version}
 Requires:	lib%{name}-pytorch-frontend = %{version}
+Requires:	lib%{name}-onnx-frontend = %{version}
 Requires:	numpy
 Recommends:	%{name}-plugins = %{version}
 
@@ -114,6 +118,14 @@ The PyTorch Frontend is a C++ based OpenVINO Frontend component that is
 responsible for reading and converting a PyTorch model to an ov::Model object
 that can be further serialized into the Intermediate Representation (IR) format
 
+%package -n lib%{name}-onnx-frontend
+Summary:	OpenVINO ONNX Frontend
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+
+%description -n lib%{name}-onnx-frontend
+The main responsibility of the ONNX Frontend is to import ONNX models and
+convert them into the ov::Model representation.
+
 %package -n python3-%{name}
 Summary:	OpenVINO Python API
 Requires:	%{name}%{?_isa} = %{version}-%{release}
@@ -195,7 +207,7 @@ sed -i '/#include <vector>.*/a#include <cstdint>' src/plugins/intel_npu/src/plug
 	-DENABLE_MULTI=ON \
 	-DENABLE_PROXY=ON \
 	-DENABLE_TEMPLATE=ON \
-	-DENABLE_OV_ONNX_FRONTEND=OFF \
+	-DENABLE_OV_ONNX_FRONTEND=ON \
 	-DENABLE_OV_PADDLE_FRONTEND=OFF \
 	-DENABLE_OV_IR_FRONTEND=ON \
 	-DENABLE_OV_PYTORCH_FRONTEND=ON \
@@ -216,7 +228,7 @@ sed -i '/#include <vector>.*/a#include <cstdint>' src/plugins/intel_npu/src/plug
 	-DENABLE_TBB_RELEASE_ONLY=ON \
 	-DENABLE_SAMPLES=OFF \
 	-DENABLE_TESTS=OFF \
-	-DBUILD_SHARED_LIBS=ON
+	-DBUILD_SHARED_LIBS=ON \
 %cmake_build
 
 %install
@@ -244,6 +256,7 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%
 %{_libdir}/lib%{name}.so
 %{_libdir}/lib%{name}_c.so
 %{_libdir}/lib%{name}_pytorch_frontend.so
+%{_libdir}/lib%{name}_onnx_frontend.so
 %{_libdir}/cmake/openvino-%{version}
 %{_libdir}/pkgconfig/%{name}.pc
 
@@ -264,6 +277,10 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%
 %{_libdir}/lib%{name}_pytorch_frontend.so.%{version}
 %{_libdir}/lib%{name}_pytorch_frontend.so.%{so_ver}
 
+%files -n lib%{name}-onnx-frontend
+%{_libdir}/lib%{name}_onnx_frontend.so.%{version}
+%{_libdir}/lib%{name}_onnx_frontend.so.%{so_ver}
+
 %files -n python3-%{name}
 %{python3_sitearch}/%{name}
 %{python3_sitearch}/%{name}-%{version}.dist-info

                 reply	other threads:[~2026-06-10 16:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178111075821.1.6721050555560443813.rpms-openvino-bc9d3f256406@fedoraproject.org \
    --to=lx@xanderlent.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox