diff --git a/.github/workflows/linux_riscv_conan.yml b/.github/workflows/linux_riscv_conan.yml index e8a80b3bbd669e..5d9641f7946fce 100644 --- a/.github/workflows/linux_riscv_conan.yml +++ b/.github/workflows/linux_riscv_conan.yml @@ -157,6 +157,9 @@ jobs: git submodule update --init -- ${OPENVINO_REPO}/thirdparty/telemetry git submodule update --init -- ${OPENVINO_REPO}/src/plugins/intel_cpu git submodule update --init -- ${OPENVINO_REPO}/thirdparty/flatbuffers/flatbuffers + # ONNX is no longer consumed from Conan (Conan Center Index lacks onnx 1.22), + # so the bundled submodule is built instead and must be checked out here. + git submodule update --init -- ${OPENVINO_REPO}/thirdparty/onnx/onnx popd # @@ -185,6 +188,14 @@ 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} + # Append -latomic to CMAKE_CXX/C_STANDARD_LIBRARIES so it appears at the + # END of the linker command line, after abseil static archives that + # reference __atomic_* symbols (GCC processes libraries left-to-right). + 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 0eb92bae147782..8216553d5a8d3f 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/OpenVINODeveloperScriptsConfig.cmake b/cmake/developer_package/OpenVINODeveloperScriptsConfig.cmake index 0f013b7a385890..cfeacf800ac1f1 100644 --- a/cmake/developer_package/OpenVINODeveloperScriptsConfig.cmake +++ b/cmake/developer_package/OpenVINODeveloperScriptsConfig.cmake @@ -272,6 +272,7 @@ include(faster_build) include(whole_archive) include(linux_name) include(models) +include(patches) include(api_validator/api_validator) include(vs_version/vs_version) diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake index 06c3ad1b3e085b..da68c4ca21af25 100644 --- a/cmake/developer_package/frontends/frontends.cmake +++ b/cmake/developer_package/frontends/frontends.cmake @@ -223,7 +223,10 @@ macro(ov_add_frontend) $ PRIVATE $ - ${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} @@ -247,10 +250,69 @@ macro(ov_add_frontend) if(OV_FRONTEND_PROTOBUF_LITE) set(protobuf_target_name libprotobuf-lite) set(protobuf_install_name "protobuf_lite_installed") + set(protobuf_dependencies + absl::absl_check + absl::absl_log + absl::base + absl::bits + absl::core_headers + absl::debugging + absl::die_if_null + absl::dynamic_annotations + absl::endian + absl::fixed_array + absl::inlined_vector + absl::log_severity + absl::memory + absl::raw_logging_internal + absl::span + absl::strings + absl::synchronization + absl::type_traits + absl::utility + ) else() set(protobuf_target_name libprotobuf) set(protobuf_install_name "protobuf_installed") + set(protobuf_dependencies + absl::absl_check + absl::absl_log + absl::algorithm + absl::base + absl::bind_front + absl::bits + absl::btree + absl::cleanup + absl::cord + absl::core_headers + absl::debugging + absl::die_if_null + absl::dynamic_annotations + absl::flags + absl::flat_hash_map + absl::flat_hash_set + absl::function_ref + absl::hash + absl::layout + absl::log_initialize + absl::log_globals + absl::log_severity + absl::memory + absl::node_hash_map + absl::node_hash_set + absl::optional + absl::span + absl::status + absl::statusor + absl::strings + absl::synchronization + absl::time + absl::type_traits + absl::utility + absl::variant + ) endif() + if(ENABLE_SYSTEM_PROTOBUF) # use imported target name with namespace set(protobuf_target_name "protobuf::${protobuf_target_name}") @@ -258,6 +320,14 @@ macro(ov_add_frontend) ov_link_system_libraries(${TARGET_NAME} PRIVATE ${protobuf_target_name}) + # GCC emits -Warray-bounds / -Wstringop-overflow even from SYSTEM includes + # when instantiating header-only abseil code inside frontend translation units. + # With -Werror these become hard errors; downgrade to warnings here. + 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 $<$:-Wno-suggest-override>) @@ -269,7 +339,14 @@ 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}) + # Install protobuf and ALL of its non-imported transitive deps (including + # internal abseil targets like absl_log_internal_check_impl). A shallow + # ov_install_static_lib loop over the public protobuf_dependencies list is + # insufficient because each public absl target itself depends on many internal + # ones that must also be present in OpenVINOTargets for consumers to link. + set(_ov_protobuf_roots ${protobuf_target_name} ${protobuf_dependencies}) + 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 5cbd4afa31c44d..0a488a520709c4 100644 --- a/cmake/developer_package/packaging/debian/post_build.cmake +++ b/cmake/developer_package/packaging/debian/post_build.cmake @@ -22,7 +22,12 @@ 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}" + # absl stub/aggregation static libraries (e.g. libabsl_string_view.a) + # are intentionally code-free on modern platforms where the underlying + # types come from the C++ standard library. Suppress the false-positive. + --suppress-tags no-code-sections + ${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 26194e976a397c..cd52793b08e6ab 100644 --- a/cmake/developer_package/packaging/packaging.cmake +++ b/cmake/developer_package/packaging/packaging.cmake @@ -74,30 +74,195 @@ macro(ov_install_pdb target) endif() endmacro() +# +# _ov_collect_static_deps_impl() +# +# 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. +# A companion global property _OV_STATIC_DEP_VISITED prevents re-visiting. +# Generator expressions in the dep lists are silently skipped. +# +# Both property lists are traversed because, for fully-static builds, CMake +# may still namespace-qualify PRIVATE (LINK_LIBRARIES-only) deps of a static +# library target when generating the export file, making them appear as +# openvino::X in the exported INTERFACE_LINK_LIBRARIES even though X was +# linked privately. Every such target must therefore be in the export set. +# +function(_ov_collect_static_deps_impl target) + # Resolve ALIAS 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_visited GLOBAL PROPERTY _OV_STATIC_DEP_VISITED) + if("${_csd_real}" IN_LIST _csd_visited) + return() + endif() + set_property(GLOBAL APPEND PROPERTY _OV_STATIC_DEP_VISITED "${_csd_real}") + + # 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. + # INTERFACE_LINK_LIBRARIES: public/interface deps visible to consumers. + # LINK_LIBRARIES: all deps (public + private) that this target links. + # For fully-static builds we need both because CMake may reference private + # project targets in the exported interface with the openvino:: namespace. + 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 $ + if(_csd_dep MATCHES "^\\$<") + continue() + endif() + if(TARGET "${_csd_dep}") + _ov_collect_static_deps_impl("${_csd_dep}") + endif() + endforeach() +endfunction() + +# +# ov_install_static_deps( ) +# +# Installs every target named in and all of their +# non-imported transitive link dependencies (both INTERFACE and LINK_LIBRARIES) +# into the OpenVINO export set (OpenVINOTargets). Uses global CMake properties +# as scratch space so that the recursion can be arbitrarily deep. +# +# Both public (INTERFACE_LINK_LIBRARIES) and private (LINK_LIBRARIES) deps are +# traversed because, for fully-static builds, CMake may namespace-qualify even +# private project deps in the exported interface (e.g. openvino::utf8_validity), +# requiring them to be defined in OpenVINOTargets. +# +macro(ov_install_static_deps _ov_isd_targets_var _ov_isd_comp) + set_property(GLOBAL PROPERTY _OV_STATIC_DEP_VISITED "") + 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( ) +# +# Registers every target in 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. +# +# Used to satisfy CMake's install(EXPORT ...) validation for third-party export +# sets (e.g. ONNXTargets) in shared builds, where ov_install_static_lib's +# if(NOT BUILD_SHARED_LIBS) guard would otherwise leave the deps unregistered +# and CMake's generate-step export validation would fail with "not in any +# export set". +# +# NOTE: Do NOT call this for OpenVINOTargets in static builds — use +# ov_install_static_deps instead. Registering the same target in two export +# sets (one via ov_install_static_deps and one via this macro) causes CMake to +# error with "exported multiple times" when any other target depends on it. +# +macro(ov_register_static_deps_in_export _ov_rsde_targets_var _ov_rsde_export) + set_property(GLOBAL PROPERTY _OV_STATIC_DEP_VISITED "") + 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( ) # 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. + # Alias targets (e.g. absl::absl_check → absl_check) are resolved above; + # the underlying non-imported target must still be exported so that + # openvino::libprotobuf's INTERFACE_LINK_LIBRARIES can resolve at consumer time. + 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}) + # save all internal installed targets to filter them later in 'ov_generate_dev_package_config' + 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") + # install compile PDB file as well + ov_install_pdb(${install_target}) + + # export to local tree to build against static build tree + export(TARGETS ${install_target} NAMESPACE openvino:: + APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake") + endif() endif() endmacro() diff --git a/cmake/developer_package/patches.cmake b/cmake/developer_package/patches.cmake new file mode 100644 index 00000000000000..5f9d19ef49251f --- /dev/null +++ b/cmake/developer_package/patches.cmake @@ -0,0 +1,88 @@ +# Copyright (C) 2018-2026 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +# +# ov_apply_patch( +# PATCH +# [WORKING_DIRECTORY ] -- directory passed to 'git apply'; defaults to CMAKE_SOURCE_DIR +# ) +# +# Applies a local patch file via 'git apply' during the CMake configure phase. +# Idempotent: uses 'git apply --reverse --check' to detect whether the patch is +# already applied and skips the apply step if so. +# Relies on GIT_FOUND / GIT_EXECUTABLE, which are set by find_package(Git) in version.cmake. +# +function(ov_apply_patch) + cmake_parse_arguments(ARG "" "PATCH;WORKING_DIRECTORY" "" ${ARGN}) + + if(NOT DEFINED ARG_PATCH OR ARG_PATCH STREQUAL "") + message(FATAL_ERROR "ov_apply_patch: PATCH argument is required") + endif() + + if(NOT EXISTS "${ARG_PATCH}") + message(FATAL_ERROR "ov_apply_patch: patch file does not exist: ${ARG_PATCH}") + endif() + + if(NOT DEFINED ARG_WORKING_DIRECTORY OR ARG_WORKING_DIRECTORY STREQUAL "") + set(ARG_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") + endif() + + if(NOT IS_DIRECTORY "${ARG_WORKING_DIRECTORY}") + message(FATAL_ERROR "ov_apply_patch: working directory does not exist: ${ARG_WORKING_DIRECTORY}") + endif() + + # GIT_FOUND / GIT_EXECUTABLE are set by find_package(Git) in version.cmake, + # but may be absent (e.g. Git not on PATH at configure time on Windows). + # Re-run find_package locally as a fallback — it is cheap and cached by CMake. + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + if(NOT GIT_FOUND) + message(FATAL_ERROR + "ov_apply_patch: Git is required to apply patches but was not found.\n" + " Patch: ${ARG_PATCH}") + endif() + + get_filename_component(_patch_display "${ARG_PATCH}" NAME) + + # Check whether the patch is already applied by attempting a dry-run reverse. + # Exit code 0 → reverse applies cleanly → patch IS already applied → skip. + # Exit code ≠ 0 → reverse fails → patch is NOT yet applied → apply it. + execute_process( + COMMAND "${GIT_EXECUTABLE}" -c core.autocrlf=false apply + --reverse --check + --ignore-space-change + --ignore-whitespace + "${ARG_PATCH}" + WORKING_DIRECTORY "${ARG_WORKING_DIRECTORY}" + RESULT_VARIABLE _ov_reverse_rc + OUTPUT_QUIET + ERROR_QUIET + ) + + if(_ov_reverse_rc EQUAL 0) + return() + endif() + + # Patch not yet applied — apply it now. + # -c core.autocrlf=false: patch files on Windows may have CRLF line endings; + # disabling autocrlf makes git apply agnostic of the patch file's line endings. + execute_process( + COMMAND "${GIT_EXECUTABLE}" -c core.autocrlf=false apply + --ignore-space-change + --ignore-whitespace + "${ARG_PATCH}" + WORKING_DIRECTORY "${ARG_WORKING_DIRECTORY}" + RESULT_VARIABLE _ov_patch_rc + ERROR_VARIABLE _ov_patch_err + OUTPUT_QUIET + ) + + if(NOT _ov_patch_rc EQUAL 0) + message(FATAL_ERROR + "ov_apply_patch: failed to apply '${_patch_display}':\n${_ov_patch_err}") + endif() + + message(STATUS "Applied patch: ${_patch_display}") +endfunction() diff --git a/cmake/toolchains/riscv64.linux.toolchain.cmake b/cmake/toolchains/riscv64.linux.toolchain.cmake index 7b4caeea90fe1a..77c67a0485814c 100644 --- a/cmake/toolchains/riscv64.linux.toolchain.cmake +++ b/cmake/toolchains/riscv64.linux.toolchain.cmake @@ -14,3 +14,9 @@ set(CMAKE_CXX_COMPILER_TARGET riscv64-linux-gnu) set(CMAKE_C_COMPILER riscv64-linux-gnu-gcc) set(CMAKE_CXX_COMPILER riscv64-linux-gnu-g++) set(CMAKE_STRIP riscv64-linux-gnu-strip) + +# GCC on RISC-V emits calls to __atomic_* libcalls for certain atomic ops. +# These are resolved by libatomic which must appear at the END of the link +# command (after static libraries that reference the symbols). +set(CMAKE_CXX_STANDARD_LIBRARIES "-latomic" CACHE STRING "" FORCE) +set(CMAKE_C_STANDARD_LIBRARIES "-latomic" CACHE STRING "" FORCE) diff --git a/conan.lock b/conan.lock index 286daca8f4425b..1c6bd524448cdc 100644 --- a/conan.lock +++ b/conan.lock @@ -6,31 +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", - "onnx/1.18.0#89f0cea2a59cca9315f16445d4b3d1ed%1749836561.917", "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 c574b54ad9f67b..9c314c64adbfa7 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,21 +1,21 @@ [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] snappy/[>=1.1.7] -onnx/1.18.0 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] @@ -26,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 3c30736fb02b98..1b9debc86d4537 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>=6.33.0,<7.0.0 onnx==1.18.0 diff --git a/src/frontends/onnx/frontend/src/frontend.cpp b/src/frontends/onnx/frontend/src/frontend.cpp index ae30585528a19b..4364279b12777b 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 8e343943f9b3de..d351125aed1da3 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 aa96be00ade3a5..8f2d5cfb6ca784 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.18.0 +onnxruntime>=1.23.2 opencv-python>=4.5 paddlepaddle==3.3.0 -protobuf>=3.21.12,<7.0.0 +protobuf>=6.33.0,<7.0.0 py>=1.9.0 pytest>=5.0,<9.2 pytest-dependency==0.6.1 diff --git a/tests/requirements_onnx b/tests/requirements_onnx index fffedba2fa158c..c9e3cd61136ee8 100644 --- a/tests/requirements_onnx +++ b/tests/requirements_onnx @@ -1,3 +1,3 @@ -numpy>=1.16.6,<2.2.0 +numpy>=1.23.2,<2.2.0 onnx==1.18.0 -protobuf>=3.21.12,<7.0.0 +protobuf>=6.33.0,<7.0.0 diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake index 5e1073d8025f66..77219a258fb36b 100644 --- a/thirdparty/dependencies.cmake +++ b/thirdparty/dependencies.cmake @@ -376,9 +376,9 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND # try to find newer version first (major is changed) # see https://protobuf.dev/support/version-support/ and # https://github.com/protocolbuffers/protobuf/commit/d61f75ff6db36b4f9c0765f131f8edc2f86310fa - find_package(Protobuf 5.26.0 QUIET CONFIG) + find_package(Protobuf 6.33.0 QUIET CONFIG) if(NOT Protobuf_FOUND) - find_package(Protobuf 4.22.0 QUIET CONFIG) + find_package(Protobuf 4.25.1 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 4.25.1 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() # @@ -559,7 +550,7 @@ endif() # if(ENABLE_OV_ONNX_FRONTEND) - find_package(ONNX 1.16.2 QUIET COMPONENTS onnx onnx_proto NO_MODULE) + find_package(ONNX 1.18.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 9d1bd98224a2e8..c97650d318da6d 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 $ ) +# 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 8e95d1e490101e..d89521f7f7c070 100644 --- a/thirdparty/onnx/CMakeLists.txt +++ b/thirdparty/onnx/CMakeLists.txt @@ -54,16 +54,49 @@ 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. +# +# The CMake rule is: for a target T in export set A, each dependency of T must +# be in AT LEAST ONE export set (not necessarily A). However, in practice CMake +# generates the reference as the dep's own namespaced name only if the dep is in +# EXACTLY ONE set; if it is in multiple sets CMake cannot determine which +# namespace to use and errors. The safe path is to put libprotobuf in ONNXTargets +# so onnx's dep is satisfied LOCALLY (onnx → ONNX::libprotobuf-lite, no ambiguity). +# +# Static build (NOT BUILD_SHARED_LIBS): +# libprotobuf-lite is also added to OpenVINOTargets later by ov_install_static_deps +# (called from the ONNX frontend CMakeLists.txt via ov_add_frontend). Having it +# in BOTH ONNXTargets and OpenVINOTargets is allowed; CMake 3.24+ lifted the +# one-export-set restriction for the target itself. The "exported multiple times" +# error applies only to the DEPS of a target (absl etc.), not the target itself. +# +# Shared build (BUILD_SHARED_LIBS=ON): +# ov_install_static_lib's if(NOT BUILD_SHARED_LIBS) guard AND the absence of a +# protobuf-targets set (protobuf_INSTALL=OFF) mean libprotobuf is not in any +# export set. Use ov_register_static_deps_in_export to add libprotobuf AND all +# its transitive deps to ONNXTargets (bypassing the BUILD_SHARED_LIBS guard). +if(NOT ENABLE_SYSTEM_PROTOBUF) if(ONNX_USE_LITE_PROTO) - set(protobuf_target_name libprotobuf-lite) + set(_onnx_protobuf_root libprotobuf-lite) + else() + set(_onnx_protobuf_root libprotobuf) + endif() + + 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() - set(protobuf_target_name libprotobuf) + # Static build: add just libprotobuf to ONNXTargets (original WA). + # Its transitive deps (absl, utf8_validity, …) will be in OpenVINOTargets + # via ov_install_static_deps and will be referenced as openvino::* there. + install(TARGETS "${_onnx_protobuf_root}" EXPORT ONNXTargets + ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} + COMPONENT ${OV_CPACK_COMP_CORE} + ${OV_CPACK_COMP_CORE_EXCLUDE_ALL}) endif() - install(TARGETS ${protobuf_target_name} EXPORT ONNXTargets - ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE} - ${OV_CPACK_COMP_CORE_EXCLUDE_ALL}) + unset(_onnx_protobuf_root) endif() diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt index 5d73c6aef987b7..419b8578182bd1 100644 --- a/thirdparty/protobuf/CMakeLists.txt +++ b/thirdparty/protobuf/CMakeLists.txt @@ -15,8 +15,26 @@ 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) + # GCC may emit "non-constant condition for static assertion" in abseil's + # ascii.cc because static_cast(i) for i >= 128 is implementation- + # defined when char is signed, and older GCC constexpr evaluators reject + # it. -fpermissive downgrades it to a warning on GCC >= 12. + # -funsigned-char makes char unsigned so the cast is always in-range, + # fixing all GCC versions. + 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 @@ -28,6 +46,21 @@ 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. +# Keeping protobuf_INSTALL=ON would cause abseil-cpp.cmake to set +# ABSL_ENABLE_INSTALL=ON (plain local set, overrides any CACHE value), resulting +# in absl targets landing in both abslTargets and OpenVINOTargets — an error in +# CMake's export file generator. Setting it OFF here (before add_subdirectory) +# prevents option() in protobuf's CMakeLists from re-enabling it. +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. Force it OFF explicitly here so that +# utf8_range-targets.cmake is never generated, keeping utf8_validity in a +# single export set (OpenVINOTargets) and avoiding a CMake multi-export error +# when ONNXTargets also references libprotobuf → utf8_validity. +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 +86,42 @@ else() set(protobuf_dir protobuf/cmake) endif() +# Disable warning-as-error for the entire protobuf/abseil subtree. +# Abseil triggers -Warray-bounds on GCC 14 and -Wsign-conversion on +# Emscripten/Clang; these are false positives in third-party code that +# we cannot patch. +set(CMAKE_COMPILE_WARNING_AS_ERROR OFF) + +# Protobuf 6.30 unconditionally sets ABSL_MSVC_STATIC_RUNTIME=ON for static +# builds (protobuf_BUILD_SHARED_LIBS=OFF), ignoring protobuf_MSVC_STATIC_RUNTIME. +# This causes abseil to compile with /MT while protobuf uses /MD, resulting in +# LNK2038 "mismatch detected for RuntimeLibrary" on MSVC. Patch protobuf's +# CMakeLists.txt to propagate protobuf_MSVC_STATIC_RUNTIME to abseil. +ov_apply_patch( + PATCH "${CMAKE_CURRENT_SOURCE_DIR}/patches/0001-fix-absl-msvc-runtime.patch" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/protobuf") + 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) + +# protobuf's cmake/install.cmake normally replaces the bare-path +# INTERFACE_INCLUDE_DIRECTORIES with $/$. +# Since we set protobuf_INSTALL=OFF that file is never included, so we apply +# the same fix here to avoid a "source-directory path" export error. +foreach(_proto_lib IN ITEMS libprotobuf libprotobuf-lite) + if(TARGET "${_proto_lib}") + set_property(TARGET "${_proto_lib}" + PROPERTY INTERFACE_INCLUDE_DIRECTORIES + "$" + "$") + endif() +endforeach() +unset(_proto_lib) + # to hide libprotobuf warnings target_include_directories(libprotobuf-lite SYSTEM PRIVATE "${Protobuf_INCLUDE_DIRS}") @@ -69,12 +133,16 @@ 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() + # Disable thread sanitizer for all protobuf/abseil targets — protobuf + # is incompatible with -fsanitize=thread (especially under clang). + 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 +162,13 @@ if(NOT protobuf_BUILD_PROTOC_BINARIES) set(protoc_extra_flags "-fno-sanitize=thread") endif() + if(CMAKE_COMPILER_IS_GNUCXX) + # GCC < 9 may emit "overflow in constant expression" inside bundled + # abseil-cpp (ascii.cc static_assert) and treats it as a hard error. + # -fpermissive downgrades it to a warning, allowing the build to proceed. + set(protoc_extra_flags "${protoc_extra_flags} -fpermissive") + endif() + ov_native_compile_external_project( TARGET_NAME host_protoc NATIVE_INSTALL_DIR "${HOST_PROTOC_INSTALL_DIR}" diff --git a/thirdparty/protobuf/patches/0001-fix-absl-msvc-runtime.patch b/thirdparty/protobuf/patches/0001-fix-absl-msvc-runtime.patch new file mode 100644 index 00000000000000..3d0ebd5cd8524f --- /dev/null +++ b/thirdparty/protobuf/patches/0001-fix-absl-msvc-runtime.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae3c3246d..d2f4f0b29 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -203,7 +203,7 @@ if (protobuf_BUILD_SHARED_LIBS) + set(protobuf_SHARED_OR_STATIC "SHARED") + else (protobuf_BUILD_SHARED_LIBS) + set(protobuf_SHARED_OR_STATIC "STATIC") +- set(ABSL_MSVC_STATIC_RUNTIME ON) ++ set(ABSL_MSVC_STATIC_RUNTIME ${protobuf_MSVC_STATIC_RUNTIME}) + if (protobuf_MSVC_STATIC_RUNTIME) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) + else() diff --git a/thirdparty/protobuf/protobuf b/thirdparty/protobuf/protobuf index f0dc78d7e6e331..d295af5c3002c0 160000 --- a/thirdparty/protobuf/protobuf +++ b/thirdparty/protobuf/protobuf @@ -1 +1 @@ -Subproject commit f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c +Subproject commit d295af5c3002c08e1bfd9d7f9e175d0a4d015f1e diff --git a/vcpkg.json b/vcpkg.json index d43ddf7b97a78c..a1e6199d47f762 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -80,16 +80,16 @@ "dependencies": [ { "name": "onnx", - "version>=": "1.16.2" + "version>=": "1.18.0" }, { "name": "protobuf", - "version>=": "3.21.2" + "version>=": "6.30.0" }, { "name": "protobuf", "host": true, - "version>=": "3.21.2" + "version>=": "6.30.0" } ] },