Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Update Protobuf to 5.26.0 (#37229)

Szymon Gutajfffd1fa927e3
diff --git a/.github/workflows/linux_riscv_conan.yml b/.github/workflows/linux_riscv_conan.yml
index dccce181eef..7fbd802de62 100644
--- a/.github/workflows/linux_riscv_conan.yml
+++ b/.github/workflows/linux_riscv_conan.yml
@@ -189,6 +189,11 @@ jobs:
echo "[buildenv]" >> ${CONAN_LINUX_RISCV64_PROFILE}
echo "CC=riscv64-linux-gnu-gcc" >> ${CONAN_LINUX_RISCV64_PROFILE}
echo "CXX=riscv64-linux-gnu-g++" >> ${CONAN_LINUX_RISCV64_PROFILE}
+ echo "LDFLAGS=-latomic" >> ${CONAN_LINUX_RISCV64_PROFILE}
+ echo "[conf]" >> ${CONAN_LINUX_RISCV64_PROFILE}
+ echo "tools.build:exelinkflags=[\"-latomic\"]" >> ${CONAN_LINUX_RISCV64_PROFILE}
+ echo "tools.build:sharedlinkflags=[\"-latomic\"]" >> ${CONAN_LINUX_RISCV64_PROFILE}
+ echo 'tools.cmake.cmaketoolchain:extra_variables={"CMAKE_CXX_STANDARD_LIBRARIES": "-latomic", "CMAKE_C_STANDARD_LIBRARIES": "-latomic"}' >> ${CONAN_LINUX_RISCV64_PROFILE}
# install OpenVINO dependencies
conan install ${OPENVINO_REPO}/conanfile.txt \
-pr:h ${CONAN_LINUX_RISCV64_PROFILE} \
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0eb92bae147..8216553d5a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,14 @@ if(POLICY CMP0177)
cmake_policy(SET CMP0177 NEW)
endif()
+if(POLICY CMP0194)
+ # NOTE: Keeping the policy "OLD" in order to retain custom assembler search (icpx/icx/icx.exe)
+ # Making it "NEW" would result in (incorrect) usage of cl64.exe in certain contexts on Windows
+ set(CMAKE_POLICY_DEFAULT_CMP0194 OLD)
+ # NOTE: Some CMake versions have a typo in the policy number, so we set both to be safe
+ set(CMAKE_POLICY_DEFAULT_CMP194 OLD)
+endif()
+
# set CMAKE_POLICY_VERSION_MINIMUM to avoid errors from 3rd party dependencies
# after cmake is updated to 4.0
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
diff --git a/cmake/developer_package/api_validator/api_validator.cmake b/cmake/developer_package/api_validator/api_validator.cmake
index 1554d2aab90..0dbdc1739cd 100644
--- a/cmake/developer_package/api_validator/api_validator.cmake
+++ b/cmake/developer_package/api_validator/api_validator.cmake
@@ -86,6 +86,8 @@ function(_ov_add_api_validator_post_build_step_recursive)
endforeach()
set(API_VALIDATOR_TARGETS ${API_VALIDATOR_TARGETS} PARENT_SCOPE)
+ # Propagate targets visited for dependency graph introspection upwards
+ set(checked_targets "${checked_targets}" PARENT_SCOPE)
endfunction()
set(VALIDATED_TARGETS "" CACHE INTERNAL "")
diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake
index 06c3ad1b3e0..b7fb3bded63 100644
--- a/cmake/developer_package/frontends/frontends.cmake
+++ b/cmake/developer_package/frontends/frontends.cmake
@@ -223,7 +223,10 @@ macro(ov_add_frontend)
$<BUILD_INTERFACE:${${TARGET_NAME}_INCLUDE_DIR}>
PRIVATE
$<TARGET_PROPERTY:openvino::frontend::common,INTERFACE_INCLUDE_DIRECTORIES>
- ${frontend_root_dir}/src
+ ${frontend_root_dir}/src)
+
+ # Add binary dir as SYSTEM so generated protobuf headers don't trigger warnings
+ target_include_directories(${TARGET_NAME} SYSTEM PRIVATE
${CMAKE_CURRENT_BINARY_DIR})
ov_add_vs_version_file(NAME ${TARGET_NAME}
@@ -251,6 +254,7 @@ macro(ov_add_frontend)
set(protobuf_target_name libprotobuf)
set(protobuf_install_name "protobuf_installed")
endif()
+
if(ENABLE_SYSTEM_PROTOBUF)
# use imported target name with namespace
set(protobuf_target_name "protobuf::${protobuf_target_name}")
@@ -258,6 +262,14 @@ macro(ov_add_frontend)
ov_link_system_libraries(${TARGET_NAME} PRIVATE ${protobuf_target_name})
+ # GCC emits warnings even from SYSTEM includes of header-only libraries
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ target_compile_options(${TARGET_NAME} PRIVATE
+ -Wno-error=array-bounds
+ -Wno-error=stringop-overflow
+ )
+ endif()
+
# protobuf generated code emits -Wsuggest-override error
if(SUGGEST_OVERRIDE_SUPPORTED)
target_compile_options(${TARGET_NAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-suggest-override>)
@@ -269,7 +281,10 @@ macro(ov_add_frontend)
# we have to add find_package(Protobuf) to the OpenVINOConfig.cmake for static build
# no needs to install protobuf
else()
- ov_install_static_lib(${protobuf_target_name} ${OV_CPACK_COMP_CORE})
+ # Installs protobuf plus its transitive dependencies
+ set(_ov_protobuf_roots ${protobuf_target_name})
+ ov_install_static_deps(_ov_protobuf_roots ${OV_CPACK_COMP_CORE})
+ unset(_ov_protobuf_roots)
set("${protobuf_install_name}" ON CACHE INTERNAL "" FORCE)
endif()
endif()
diff --git a/cmake/developer_package/packaging/debian/post_build.cmake b/cmake/developer_package/packaging/debian/post_build.cmake
index 5cbd4afa31c..42de381dfb3 100644
--- a/cmake/developer_package/packaging/debian/post_build.cmake
+++ b/cmake/developer_package/packaging/debian/post_build.cmake
@@ -22,7 +22,9 @@ endif()
set(lintian_passed ON)
foreach(deb_file IN LISTS CPACK_PACKAGE_FILES)
- execute_process(COMMAND "${lintian_PROGRAM}" ${deb_file}
+ execute_process(COMMAND "${lintian_PROGRAM}"
+ --suppress-tags no-code-sections # Accept modern, code-free libs
+ ${deb_file}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
RESULT_VARIABLE lintian_exit_code
OUTPUT_VARIABLE lintian_output)
diff --git a/cmake/developer_package/packaging/packaging.cmake b/cmake/developer_package/packaging/packaging.cmake
index 26194e976a3..e1683fe4796 100644
--- a/cmake/developer_package/packaging/packaging.cmake
+++ b/cmake/developer_package/packaging/packaging.cmake
@@ -74,30 +74,172 @@ macro(ov_install_pdb target)
endif()
endmacro()
+# Increments the global visited-epoch used by _ov_collect_static_deps_impl so
+# that per-target _OV_SDEP_SEEN_EPOCH flags from previous traversals are
+# implicitly invalidated without having to clear them.
+function(_ov_static_deps_new_epoch)
+ get_property(_ov_sde_epoch GLOBAL PROPERTY _OV_STATIC_DEP_EPOCH)
+ if(NOT _ov_sde_epoch)
+ set(_ov_sde_epoch 0)
+ endif()
+ math(EXPR _ov_sde_epoch "${_ov_sde_epoch} + 1")
+ set_property(GLOBAL PROPERTY _OV_STATIC_DEP_EPOCH "${_ov_sde_epoch}")
+endfunction()
+
+#
+# _ov_collect_static_deps_impl(<target>)
+#
+# Internal recursive helper: walks both INTERFACE_LINK_LIBRARIES and
+# LINK_LIBRARIES depth-first and accumulates all non-imported project targets
+# (resolved through ALIAS) into the global property _OV_STATIC_DEP_RESULT.
+#
+function(_ov_collect_static_deps_impl target)
+ get_target_property(_csd_alias "${target}" ALIASED_TARGET)
+ if(_csd_alias)
+ set(_csd_real "${_csd_alias}")
+ else()
+ set(_csd_real "${target}")
+ endif()
+
+ if(NOT TARGET "${_csd_real}")
+ return()
+ endif()
+
+ # Guard: skip already-visited targets
+ get_property(_csd_epoch GLOBAL PROPERTY _OV_STATIC_DEP_EPOCH)
+ get_property(_csd_seen TARGET "${_csd_real}" PROPERTY _OV_SDEP_SEEN_EPOCH)
+ if(_csd_seen STREQUAL "${_csd_epoch}")
+ return()
+ endif()
+ set_property(TARGET "${_csd_real}" PROPERTY _OV_SDEP_SEEN_EPOCH "${_csd_epoch}")
+
+ # Skip IMPORTED targets — they belong to external packages (e.g. system TBB)
+ get_target_property(_csd_imp "${_csd_real}" IMPORTED)
+ if(_csd_imp)
+ return()
+ endif()
+
+ set_property(GLOBAL APPEND PROPERTY _OV_STATIC_DEP_RESULT "${_csd_real}")
+
+ # Collect both interface and private link deps
+ set(_csd_all_deps "")
+ foreach(_csd_prop IN ITEMS INTERFACE_LINK_LIBRARIES LINK_LIBRARIES)
+ get_target_property(_csd_prop_deps "${_csd_real}" "${_csd_prop}")
+ if(_csd_prop_deps)
+ list(APPEND _csd_all_deps ${_csd_prop_deps})
+ endif()
+ endforeach()
+
+ foreach(_csd_dep IN LISTS _csd_all_deps)
+ # Skip generator expressions such as $<LINK_ONLY:...>
+ if(_csd_dep MATCHES "^\\$<")
+ continue()
+ endif()
+ if(TARGET "${_csd_dep}")
+ _ov_collect_static_deps_impl("${_csd_dep}")
+ endif()
+ endforeach()
+endfunction()
+
+#
+# ov_install_static_deps(<targets-list-variable> <comp>)
+#
+# Installs every target named in <targets-list-variable> and all of their
+# non-imported transitive link dependencies (both INTERFACE and LINK_LIBRARIES)
+# into the OpenVINO export set (OpenVINOTargets)
+#
+macro(ov_install_static_deps _ov_isd_targets_var _ov_isd_comp)
+ _ov_static_deps_new_epoch()
+ set_property(GLOBAL PROPERTY _OV_STATIC_DEP_RESULT "")
+ foreach(_ov_isd_root IN LISTS ${_ov_isd_targets_var})
+ if(TARGET "${_ov_isd_root}")
+ _ov_collect_static_deps_impl("${_ov_isd_root}")
+ endif()
+ endforeach()
+ get_property(_ov_isd_all GLOBAL PROPERTY _OV_STATIC_DEP_RESULT)
+ foreach(_ov_isd_dep IN LISTS _ov_isd_all)
+ ov_install_static_lib("${_ov_isd_dep}" "${_ov_isd_comp}")
+ endforeach()
+ unset(_ov_isd_targets_var)
+ unset(_ov_isd_root)
+ unset(_ov_isd_dep)
+ unset(_ov_isd_all)
+endmacro()
+
+#
+# ov_register_static_deps_in_export(<targets-list-variable> <export-set-name>)
+#
+# Registers every target in <targets-list-variable> and all of their
+# non-imported transitive link dependencies into a NAMED export set without
+# the BUILD_SHARED_LIBS guard that ov_install_static_deps has.
+#
+macro(ov_register_static_deps_in_export _ov_rsde_targets_var _ov_rsde_export)
+ _ov_static_deps_new_epoch()
+ set_property(GLOBAL PROPERTY _OV_STATIC_DEP_RESULT "")
+ foreach(_ov_rsde_root IN LISTS ${_ov_rsde_targets_var})
+ if(TARGET "${_ov_rsde_root}")
+ _ov_collect_static_deps_impl("${_ov_rsde_root}")
+ endif()
+ endforeach()
+ get_property(_ov_rsde_all GLOBAL PROPERTY _OV_STATIC_DEP_RESULT)
+ foreach(_ov_rsde_dep IN LISTS _ov_rsde_all)
+ get_target_property(_ov_rsde_alias "${_ov_rsde_dep}" ALIASED_TARGET)
+ if(_ov_rsde_alias)
+ set(_ov_rsde_real "${_ov_rsde_alias}")
+ else()
+ set(_ov_rsde_real "${_ov_rsde_dep}")
+ endif()
+ get_target_property(_ov_rsde_imp "${_ov_rsde_real}" IMPORTED)
+ if(NOT _ov_rsde_imp)
+ install(TARGETS "${_ov_rsde_real}"
+ EXPORT "${_ov_rsde_export}"
+ ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR}
+ COMPONENT ${OV_CPACK_COMP_CORE}
+ ${OV_CPACK_COMP_CORE_EXCLUDE_ALL})
+ endif()
+ endforeach()
+ unset(_ov_rsde_root)
+ unset(_ov_rsde_dep)
+ unset(_ov_rsde_real)
+ unset(_ov_rsde_alias)
+ unset(_ov_rsde_imp)
+ unset(_ov_rsde_all)
+endmacro()
+
#
# ov_install_static_lib(<target> <comp>)
#
macro(ov_install_static_lib target comp)
if(NOT BUILD_SHARED_LIBS)
- get_target_property(target_type ${target} TYPE)
- if(target_type STREQUAL "STATIC_LIBRARY")
- set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL OFF)
+ # Resolve alias targets — install(TARGETS) does not accept aliases
+ get_target_property(aliased_target ${target} ALIASED_TARGET)
+ if(aliased_target)
+ set(install_target ${aliased_target})
+ else()
+ set(install_target ${target})
endif()
- # save all internal installed targets to filter them later in 'ov_generate_dev_package_config'
- list(APPEND openvino_installed_targets ${target})
- set(openvino_installed_targets "${openvino_installed_targets}" CACHE INTERNAL
- "A list of OpenVINO internal targets" FORCE)
+ # Skip imported targets — they are owned by their own package config
+ # and are not installed as part of OpenVINO.
+ get_target_property(is_imported ${install_target} IMPORTED)
+ if(NOT is_imported)
+ get_target_property(target_type ${install_target} TYPE)
+ if(target_type STREQUAL "STATIC_LIBRARY")
+ set_target_properties(${install_target} PROPERTIES EXCLUDE_FROM_ALL OFF)
+ endif()
- install(TARGETS ${target} EXPORT OpenVINOTargets
- ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${comp} ${ARGN})
+ list(APPEND openvino_installed_targets ${install_target})
+ set(openvino_installed_targets "${openvino_installed_targets}" CACHE INTERNAL
+ "A list of OpenVINO internal targets" FORCE)
- # install compile PDB file as well
- ov_install_pdb(${target})
+ install(TARGETS ${install_target} EXPORT OpenVINOTargets
+ ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${comp} ${ARGN})
- # export to local tree to build against static build tree
- export(TARGETS ${target} NAMESPACE openvino::
- APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
+ ov_install_pdb(${install_target})
+
+ export(TARGETS ${install_target} NAMESPACE openvino::
+ APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
+ endif()
endif()
endmacro()
diff --git a/cmake/developer_package/plugins/plugins.cmake b/cmake/developer_package/plugins/plugins.cmake
index 71279b5a560..c5af52cf7e4 100644
--- a/cmake/developer_package/plugins/plugins.cmake
+++ b/cmake/developer_package/plugins/plugins.cmake
@@ -272,6 +272,13 @@ function(ov_target_link_plugins TARGET_NAME)
# link plugin to ${TARGET_NAME} static version
list(GET name 1 plugin_name)
+ # Skip MODULE libraries
+ if(TARGET ${plugin_name})
+ get_target_property(plugin_type ${plugin_name} TYPE)
+ if(plugin_type STREQUAL "MODULE_LIBRARY")
+ continue()
+ endif()
+ endif()
target_link_libraries(${TARGET_NAME} PRIVATE ${plugin_name})
endforeach()
endfunction()
diff --git a/conan.lock b/conan.lock
index 2ef91cfee2e..1c6bd524448 100644
--- a/conan.lock
+++ b/conan.lock
@@ -6,30 +6,33 @@
"rapidjson/cci.20220822#8ca51918340f3a21127822258e95ec0f%1663194355.698",
"pybind11/3.0.1#81ed7e3cc5c945080013ca4c5c3abbbb%1756292333.72",
"pugixml/1.13#f615c1fcec55122b2e177d17061276e7%1691917296.869",
- "protobuf/3.21.12#d9f5f4e3b86552552dda4c0a2e928eeb%1685218275.69",
+ "protobuf/6.33.5#ff253ead763bd8d9904a52979cd21e81%1778763145.334",
"opencl-icd-loader/2023.04.17#5f73dd9f0c023d416a7f162e320b9c77%1692732261.088",
"opencl-headers/2023.04.17#3d98f2d12a67c2400de6f11d5335b5a6%1683936272.16",
"opencl-clhpp-headers/2023.04.17#7c62fcc7ac2559d4839150d2ebaac5c8%1685450803.672",
"onetbb/2021.10.0#cbb2fc43088070b48f6e4339bc8fa0e1%1693812561.235",
- "ittapi/3.24.0#9246125f13e7686dee2b0c992b71db94%1682969872.743",
+ "ittapi/3.25.5#0a69ebab18bd8cfa17094fa7cc88203a%1768396972.499",
"hwloc/2.9.2#1c63e2eccac57048ae226e6c946ebf0e%1688677682.002",
- "flatbuffers/23.5.26#b153646f6546daab4c7326970b6cd89c%1685838458.449"
+ "flatbuffers/23.5.26#b153646f6546daab4c7326970b6cd89c%1685838458.449",
+ "abseil/20260107.1#883e95a7be2b767999f64669ac642e5d%1773137897.755"
],
"build_requires": [
"zlib/1.2.13#97d5730b529b4224045fe7090592d4c1%1692672717.049",
- "protobuf/3.21.12#d9f5f4e3b86552552dda4c0a2e928eeb%1685218275.69",
+ "protobuf/6.33.5#ff253ead763bd8d9904a52979cd21e81%1778763145.334",
"pkgconf/1.9.5#743ca0d41d35a84b1f89af337ddaa1a0%1688570267.802",
"patchelf/0.13#0eaada8970834919c3ce14355afe7fac%1680534241.341",
"ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21%1684431244.21",
+ "msys2/cci.latest#d22fe7b2808f5fd34d0a7923ace9c54f%1770657326.649",
"meson/1.0.0#15586c0ac6f682805875ef903dbe7ee2%1673885561.647",
"m4/1.4.19#c1c4b1ee919e34630bb9b50046253d3c%1676610086.39",
"libtool/2.4.6#9ee8efc04c2e106e7fba13bb1e477617%1677509454.345",
"gnu-config/cci.20210814#15c3bf7dfdb743977b84d0321534ad90%1681250000.747",
"flatbuffers/23.5.26#b153646f6546daab4c7326970b6cd89c%1685838458.449",
- "cmake/3.27.4#a7e78418b024dccacccc887f049f47ed%1693515860.005",
+ "cmake/4.3.3#840cf00ea09777e05c2050a50a82c722%1781521538.233",
"automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50%1688481772.751",
- "autoconf/2.71#53be95d228b2dcb30dc199cb84262d8f%1693395343.513"
+ "autoconf/2.71#53be95d228b2dcb30dc199cb84262d8f%1693395343.513",
+ "abseil/20260107.1#883e95a7be2b767999f64669ac642e5d%1773137897.755"
],
"python_requires": [],
"config_requires": []
-}
\ No newline at end of file
+}
diff --git a/conanfile.txt b/conanfile.txt
index ae93885ce4e..9c314c64adb 100644
--- a/conanfile.txt
+++ b/conanfile.txt
@@ -1,8 +1,9 @@
[requires]
+abseil/20260107.1
onetbb/[>=2021.2.1]
pugixml/[>=1.10]
-protobuf/3.21.12
-ittapi/[>=3.23.0]
+protobuf/6.33.5
+ittapi/[>=3.25.5]
opencl-icd-loader/[>=2023.04.17]
rapidjson/[>=1.1.0]
xbyak/[>=6.62]
@@ -11,10 +12,10 @@ pybind11/[>=3.0.1]
flatbuffers/[>=22.9.24]
[tool_requires]
-cmake/[>=3.20]
+cmake/[>=4.2.3]
pkgconf/1.9.5
patchelf/[>=0.12]
-protobuf/3.21.12
+protobuf/6.33.5
flatbuffers/[>=22.9.24]
[options]
@@ -25,4 +26,4 @@ flatbuffers/*:header_only=True
[generators]
CMakeDeps
-CMakeToolchain
\ No newline at end of file
+CMakeToolchain
diff --git a/src/bindings/python/constraints.txt b/src/bindings/python/constraints.txt
index 456aa4afef2..9daf47b8dfd 100644
--- a/src/bindings/python/constraints.txt
+++ b/src/bindings/python/constraints.txt
@@ -1,5 +1,5 @@
# used in multiple components
-numpy>=1.16.6,<2.6.0 # Python bindings, frontends
+numpy>=1.23.2,<2.6.0 # Python bindings, frontends
# pytest
pytest>=5.0,<9.2
@@ -21,5 +21,5 @@ h5py>=3.1.0,<3.17.0
docopt~=0.6.2
paddlepaddle==3.0.0
tensorflow>=1.15.5,<2.21.0
-protobuf>=3.21.12,<7.0.0
+protobuf>=5.26.0,<7.0.0
onnx==1.22.0
diff --git a/src/frontends/onnx/frontend/src/frontend.cpp b/src/frontends/onnx/frontend/src/frontend.cpp
index ae30585528a..4364279b127 100644
--- a/src/frontends/onnx/frontend/src/frontend.cpp
+++ b/src/frontends/onnx/frontend/src/frontend.cpp
@@ -161,7 +161,7 @@ ONNX_FRONTEND_C_API void* get_front_end_data() {
#ifndef OPENVINO_DEBUG_ENABLE
// disable protobuf logging
# ifdef OV_PROTOBUF_ABSL_IS_USED
- absl::SetGlobalVLogLevel(0);
+ absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfinity);
# else
google::protobuf::SetLogHandler(nullptr);
# endif
diff --git a/src/frontends/paddle/src/frontend.cpp b/src/frontends/paddle/src/frontend.cpp
index 8e343943f9b..d351125aed1 100644
--- a/src/frontends/paddle/src/frontend.cpp
+++ b/src/frontends/paddle/src/frontend.cpp
@@ -579,7 +579,7 @@ PADDLE_FRONTEND_C_API void* get_front_end_data() {
#ifndef OPENVINO_DEBUG_ENABLE
// disable protobuf logging
# ifdef OV_PROTOBUF_ABSL_IS_USED
- absl::SetGlobalVLogLevel(0);
+ absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfinity);
# else
google::protobuf::SetLogHandler(nullptr);
# endif
diff --git a/tests/constraints.txt b/tests/constraints.txt
index aa96be00ade..ca67b801d36 100644
--- a/tests/constraints.txt
+++ b/tests/constraints.txt
@@ -1,4 +1,4 @@
-numpy>=1.16.6,<2.6.0
+numpy>=1.23.2,<2.6.0 # Python bindings, frontends
attrs==26.1.0
distro==1.9.0
h5py>=3.1.0,<3.17.0
@@ -12,9 +12,11 @@ wheel>=0.38.1
defusedxml>=0.7.1
tensorflow>=2.5,<2.21.0
requests>=2.33.0
+onnx>=1.22.0
+onnxruntime>=1.23.2
opencv-python>=4.5
paddlepaddle==3.3.0
-protobuf>=3.21.12,<7.0.0
+protobuf>=5.26.0,<7.0.0
py>=1.9.0
pytest>=5.0,<9.2
pytest-dependency==0.6.1
diff --git a/tests/layer_tests/requirements.txt b/tests/layer_tests/requirements.txt
index 576509f34b7..0b5a2049b36 100644
--- a/tests/layer_tests/requirements.txt
+++ b/tests/layer_tests/requirements.txt
@@ -1,8 +1,7 @@
-c ../constraints.txt
# paddlepaddle # ticket 95904
numpy
-onnxruntime>=1.18.0,<=1.19.2; python_version <= '3.9'
-onnxruntime>=1.18.0; python_version >= '3.10'
+onnxruntime
requests
torch
torchvision; platform_machine == 'arm64' and python_version >= '3.9'
diff --git a/tests/requirements_onnx b/tests/requirements_onnx
index 9ffe34d187e..b846a7f7200 100644
--- a/tests/requirements_onnx
+++ b/tests/requirements_onnx
@@ -1,4 +1,4 @@
-numpy>=1.16.6,<2.2.0
+numpy>=1.23.2,<2.2.0
onnx==1.22.0
ml_dtypes==0.5.4
-protobuf>=3.21.12,<7.0.0
+protobuf>=5.26.0,<7.0.0
diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake
index 6c580d9abb9..457f9300d20 100644
--- a/thirdparty/dependencies.cmake
+++ b/thirdparty/dependencies.cmake
@@ -378,7 +378,7 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND
# https://github.com/protocolbuffers/protobuf/commit/d61f75ff6db36b4f9c0765f131f8edc2f86310fa
find_package(Protobuf 5.26.0 QUIET CONFIG)
if(NOT Protobuf_FOUND)
- find_package(Protobuf 4.22.0 QUIET CONFIG)
+ find_package(Protobuf 5.26.0 QUIET CONFIG)
endif()
if(Protobuf_FOUND)
# protobuf was found via CONFIG mode, let's save it for later usage in OpenVINOConfig.cmake static build
@@ -388,7 +388,7 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND
set(protobuf_config CONFIG)
endif()
# otherwise, fallback to existing default
- find_package(Protobuf 3.20.3 REQUIRED ${protobuf_config})
+ find_package(Protobuf 5.26.0 REQUIRED ${protobuf_config})
endif()
# with newer protobuf versions (4.22 and newer), we use CONFIG first
@@ -401,15 +401,6 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND
endif()
else()
add_subdirectory(thirdparty/protobuf EXCLUDE_FROM_ALL)
- # protobuf fails to build with -fsanitize=thread by clang
- if(ENABLE_THREAD_SANITIZER AND OV_COMPILER_IS_CLANG)
- foreach(proto_target protoc libprotobuf libprotobuf-lite)
- if(TARGET ${proto_target})
- target_compile_options(${proto_target} PRIVATE -fno-sanitize=thread)
- target_link_options(${proto_target} PRIVATE -fno-sanitize=thread)
- endif()
- endforeach()
- endif()
endif()
# forward additional variables used in the other places
@@ -417,24 +408,24 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND
# set public / interface compile options
function(_ov_fix_protobuf_warnings target_name)
- set(link_type PUBLIC)
- if(ENABLE_SYSTEM_PROTOBUF)
- set(link_type INTERFACE)
- endif()
- if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))
- get_target_property(original_name ${target_name} ALIASED_TARGET)
- if(TARGET ${original_name})
- # during build protobuf's cmake creates aliased targets
- set(target_name ${original_name})
+ if(TARGET ${target_name})
+ set(link_type PUBLIC)
+ if(ENABLE_SYSTEM_PROTOBUF)
+ set(link_type INTERFACE)
+ endif()
+ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))
+ get_target_property(original_name ${target_name} ALIASED_TARGET)
+ if(TARGET ${original_name})
+ # during build protobuf's cmake creates aliased targets
+ set(target_name ${original_name})
+ endif()
+ target_compile_options(${target_name} ${link_type} -Wno-undef)
endif()
- target_compile_options(${target_name} ${link_type} -Wno-undef)
endif()
endfunction()
_ov_fix_protobuf_warnings(protobuf::libprotobuf)
- if(TARGET protobuf::libprotobuf-lite)
- _ov_fix_protobuf_warnings(protobuf::libprotobuf-lite)
- endif()
+ _ov_fix_protobuf_warnings(protobuf::libprotobuf-lite)
endif()
#
@@ -571,7 +562,7 @@ endif()
#
if(ENABLE_OV_ONNX_FRONTEND)
- find_package(ONNX 1.16.2 QUIET COMPONENTS onnx onnx_proto NO_MODULE)
+ find_package(ONNX 1.22.0 QUIET COMPONENTS onnx onnx_proto NO_MODULE)
if(ONNX_FOUND)
# conan and vcpkg create imported targets 'onnx' and 'onnx_proto'
diff --git a/thirdparty/level_zero/CMakeLists.txt b/thirdparty/level_zero/CMakeLists.txt
index 9d1bd98224a..c97650d318d 100644
--- a/thirdparty/level_zero/CMakeLists.txt
+++ b/thirdparty/level_zero/CMakeLists.txt
@@ -49,5 +49,12 @@ set_property(TARGET ze_loader APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${ZE_INCLUDE_DIR}/level_zero>
)
+# Install Level Zero loader next to the GPU plugin on all supported platforms.
+install(TARGETS ze_loader
+ LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR}
+ RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR}
+ ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR}
+ COMPONENT gpu)
+
# This VERSION file created by L0 may cause compilation issue of oneTBB headers, so remove it
file(REMOVE "${CMAKE_BINARY_DIR}/VERSION")
diff --git a/thirdparty/onnx/CMakeLists.txt b/thirdparty/onnx/CMakeLists.txt
index bb3e1ed662f..8250c65246e 100644
--- a/thirdparty/onnx/CMakeLists.txt
+++ b/thirdparty/onnx/CMakeLists.txt
@@ -100,16 +100,27 @@ ov_disable_all_warnings(onnx onnx_proto)
ov_install_static_lib(onnx ${OV_CPACK_COMP_CORE})
ov_install_static_lib(onnx_proto ${OV_CPACK_COMP_CORE})
-# WA for ONNX: protobuf must be in the same export set of ONNX targets
-# in case of protobuf::libprotobuf-lite / protobuf::libprotobuf are imported targets
-if(NOT ENABLE_SYSTEM_PROTOBUF AND NOT BUILD_SHARED_LIBS)
+# WA for ONNX: protobuf must be findable via an export set when CMake validates
+# install(EXPORT ONNXTargets ...) at configure time.
+if(NOT ENABLE_SYSTEM_PROTOBUF)
if(ONNX_USE_LITE_PROTO)
- set(protobuf_target_name libprotobuf-lite)
+ set(_onnx_protobuf_root libprotobuf-lite)
else()
- set(protobuf_target_name libprotobuf)
+ set(_onnx_protobuf_root libprotobuf)
endif()
- install(TARGETS ${protobuf_target_name} EXPORT ONNXTargets
- ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE}
- ${OV_CPACK_COMP_CORE_EXCLUDE_ALL})
+ if(BUILD_SHARED_LIBS)
+ # Shared build: register libprotobuf and ALL transitive deps in ONNXTargets.
+ set(_onnx_pb_roots "${_onnx_protobuf_root}")
+ ov_register_static_deps_in_export(_onnx_pb_roots ONNXTargets)
+ unset(_onnx_pb_roots)
+ else()
+ # Static build: add just libprotobuf to ONNXTargets (original WA).
+ install(TARGETS "${_onnx_protobuf_root}" EXPORT ONNXTargets
+ ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR}
+ COMPONENT ${OV_CPACK_COMP_CORE}
+ ${OV_CPACK_COMP_CORE_EXCLUDE_ALL})
+ endif()
+
+ unset(_onnx_protobuf_root)
endif()
diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt
index 11e4fdb6523..ebe472e7823 100644
--- a/thirdparty/protobuf/CMakeLists.txt
+++ b/thirdparty/protobuf/CMakeLists.txt
@@ -15,11 +15,22 @@ set(BUILD_SHARED_LIBS OFF)
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))
ov_add_compiler_flags(-Wno-all)
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ ov_add_compiler_flags(-fpermissive)
+ ov_add_compiler_flags(-funsigned-char)
+ endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND CMAKE_COMPILER_IS_GNUCXX)
ov_add_compiler_flags(-Wno-stringop-overflow)
+ ov_add_compiler_flags(-Wno-ignored-qualifiers)
+ ov_add_compiler_flags(-Wno-deprecated-declarations)
+ ov_add_compiler_flags(-Wno-attributes)
+ ov_add_compiler_flags(-Wno-sign-conversion)
+ ov_add_compiler_flags(-Wno-array-bounds)
+ endif()
+ if(OV_COMPILER_IS_CLANG)
+ ov_add_compiler_flags(-Wno-sign-conversion)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- # protobuf\src\google\protobuf\descriptor.cc(822) : error C4703: potentially uninitialized local pointer variable 'to_use' used
ov_add_compiler_flags(/wd4703)
endif()
@@ -28,6 +39,12 @@ set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE)
set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
set(protobuf_WITH_ZLIB OFF CACHE BOOL "Build with zlib support" FORCE)
set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "Abseil protogate CXX standard to dependent targets" FORCE)
+# Disable protobuf's own install/export rules. OpenVINO installs and exports
+# libprotobuf/libprotobuf-lite via ov_install_static_lib → OpenVINOTargets.
+set(protobuf_INSTALL OFF CACHE BOOL "Disable protobuf self-install (managed by OpenVINO)" FORCE)
+# utf8_range.cmake sets utf8_range_ENABLE_INSTALL from protobuf_INSTALL but
+# without FORCE, so a stale ON value in the cache survives even when protobuf_INSTALL=OFF
+set(utf8_range_ENABLE_INSTALL OFF CACHE BOOL "Disable utf8_range self-install (managed by OpenVINO)" FORCE)
# some projects define HAVE_ZLIB, which affects protobuf. Let's explicitly unset it
unset(HAVE_ZLIB CACHE)
@@ -53,11 +70,26 @@ else()
set(protobuf_dir protobuf/cmake)
endif()
+set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)
+
add_subdirectory(${protobuf_dir} EXCLUDE_FROM_ALL)
get_directory_property(protobuf_VERSION DIRECTORY ${protobuf_dir} DEFINITION protobuf_VERSION)
set(Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/src)
+include(GNUInstallDirs)
+
+# Mimic protobuf's cmake/install.cmake
+foreach(_proto_lib IN ITEMS libprotobuf libprotobuf-lite)
+ if(TARGET "${_proto_lib}")
+ set_property(TARGET "${_proto_lib}"
+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+ "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/protobuf/src>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+ endif()
+endforeach()
+unset(_proto_lib)
+
# to hide libprotobuf warnings
target_include_directories(libprotobuf-lite SYSTEM PRIVATE "${Protobuf_INCLUDE_DIRS}")
@@ -69,12 +101,15 @@ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM
C_VISIBILITY_PRESET default
VISIBILITY_INLINES_HIDDEN OFF
INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
- if(ENABLE_THREAD_SANITIZER)
- foreach(_lib ${_protoc_libs})
+ endif()
+ # protobuf is incompatible with thread sanitizers
+ if(ENABLE_THREAD_SANITIZER)
+ foreach(_lib protoc libprotoc libprotobuf libprotobuf-lite)
+ if(TARGET ${_lib})
target_compile_options(${_lib} PRIVATE -fno-sanitize=thread)
- endforeach()
- target_link_options(protoc PRIVATE -fno-sanitize=thread)
- endif()
+ target_link_options(${_lib} PRIVATE -fno-sanitize=thread)
+ endif()
+ endforeach()
endif()
ov_disable_all_warnings(${_protoc_libs} libprotobuf-lite)
set_target_properties(libprotobuf-lite PROPERTIES
@@ -94,6 +129,10 @@ if(NOT protobuf_BUILD_PROTOC_BINARIES)
set(protoc_extra_flags "-fno-sanitize=thread")
endif()
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ set(protoc_extra_flags "${protoc_extra_flags} -fpermissive")
+ endif()
+
set(PROTOC_EXECUTABLE "${HOST_PROTOC_INSTALL_DIR}/bin/protoc")
ov_native_compile_external_project(
diff --git a/thirdparty/protobuf/protobuf b/thirdparty/protobuf/protobuf
index f0dc78d7e6e..d6511091a0c 160000
--- a/thirdparty/protobuf/protobuf
+++ b/thirdparty/protobuf/protobuf
@@ -1 +1 @@
-Subproject commit f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c
+Subproject commit d6511091a0cab1ad13f676a02676ad2a0e5eb9ae
diff --git a/vcpkg.json b/vcpkg.json
index d43ddf7b97a..79cd629d4bf 100644
--- a/vcpkg.json
+++ b/vcpkg.json
@@ -80,16 +80,16 @@
"dependencies": [
{
"name": "onnx",
- "version>=": "1.16.2"
+ "version>=": "1.22.0"
},
{
"name": "protobuf",
- "version>=": "3.21.2"
+ "version>=": "5.26.0"
},
{
"name": "protobuf",
"host": true,
- "version>=": "3.21.2"
+ "version>=": "5.26.0"
}
]
},