Updated ia32 toolchain with system / processor (#12784)
* Updated ia32 toolchain with system / processor * Allow pkg-config during cross-compilation * added error message * Search TBB using tbb.pc as well * WA * Fix for yocto * Added print * Use tbb.pc only when system libs are enabled * Improved OpenVINOConfig.cmake * Don't find pkg-config as required
This commit is contained in:
parent
6c4cc81465
commit
e19df6f85f
|
|
@ -25,7 +25,11 @@ fetch_models_and_validation_set()
|
||||||
|
|
||||||
get_linux_name(LINUX_OS_NAME)
|
get_linux_name(LINUX_OS_NAME)
|
||||||
|
|
||||||
if(CMAKE_CROSSCOMPILING AND CMAKE_HOST_SYSTEM_NAME MATCHES Linux AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
|
if(CMAKE_CROSSCOMPILING AND CMAKE_HOST_SYSTEM_NAME MATCHES Linux AND
|
||||||
|
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" AND
|
||||||
|
# for x86 we have to install libc6-amd64 to enable binary compiled for x86_64
|
||||||
|
# to run with proper loader; more safer just to disable system protoc on x86
|
||||||
|
NOT X86)
|
||||||
set(protoc_version "3.18.2")
|
set(protoc_version "3.18.2")
|
||||||
|
|
||||||
RESOLVE_DEPENDENCY(SYSTEM_PROTOC_ROOT
|
RESOLVE_DEPENDENCY(SYSTEM_PROTOC_ROOT
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ set_ci_build_number()
|
||||||
|
|
||||||
include(target_flags)
|
include(target_flags)
|
||||||
|
|
||||||
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} ARCH_FOLDER)
|
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_FOLDER)
|
||||||
if(X86_64)
|
if(X86_64)
|
||||||
set(ARCH_FOLDER intel64)
|
set(ARCH_FOLDER intel64)
|
||||||
elseif(X86)
|
elseif(X86)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
set(FRONTEND_INSTALL_INCLUDE "${OV_CPACK_INCLUDEDIR}/")
|
set(FRONTEND_INSTALL_INCLUDE "${OV_CPACK_INCLUDEDIR}")
|
||||||
set(FRONTEND_NAME_PREFIX "openvino_")
|
set(FRONTEND_NAME_PREFIX "openvino_")
|
||||||
set(FRONTEND_NAME_SUFFIX "_frontend")
|
set(FRONTEND_NAME_SUFFIX "_frontend")
|
||||||
|
|
||||||
|
|
@ -261,7 +261,7 @@ macro(ov_add_frontend)
|
||||||
if(OV_FRONTEND_LINKABLE_FRONTEND)
|
if(OV_FRONTEND_LINKABLE_FRONTEND)
|
||||||
# install library development files
|
# install library development files
|
||||||
install(DIRECTORY ${${TARGET_NAME}_INCLUDE_DIR}/openvino
|
install(DIRECTORY ${${TARGET_NAME}_INCLUDE_DIR}/openvino
|
||||||
DESTINATION ${FRONTEND_INSTALL_INCLUDE}/
|
DESTINATION ${FRONTEND_INSTALL_INCLUDE}
|
||||||
COMPONENT ${dev_component}
|
COMPONENT ${dev_component}
|
||||||
FILES_MATCHING PATTERN "*.hpp")
|
FILES_MATCHING PATTERN "*.hpp")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,6 @@ macro(ov_debian_specific_settings)
|
||||||
# with current WA automatic deps detection via dpkg-shlibdeps for "our libraries"
|
# with current WA automatic deps detection via dpkg-shlibdeps for "our libraries"
|
||||||
# is ignored; but dependencies between our components are here because of
|
# is ignored; but dependencies between our components are here because of
|
||||||
# CPACK_COMPONENT_<UCOMP>_DEPENDS variables
|
# CPACK_COMPONENT_<UCOMP>_DEPENDS variables
|
||||||
# More proper WA is try to enable INSTALL_RPATH
|
|
||||||
|
|
||||||
if(DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
if(DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
||||||
|
|
|
||||||
|
|
@ -147,39 +147,72 @@ set(_ov_package_prefix_dir "${PACKAGE_PREFIX_DIR}")
|
||||||
|
|
||||||
set(THREADING "@THREADING@")
|
set(THREADING "@THREADING@")
|
||||||
if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND NOT TBB_FOUND)
|
if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND NOT TBB_FOUND)
|
||||||
set(enable_system_tbb "@ENABLE_SYSTEM_TBB@")
|
set(enable_pkgconfig_tbb "@tbb_FOUND@")
|
||||||
if(NOT enable_system_tbb)
|
|
||||||
set_and_check(_tbb_dir "@PACKAGE_IE_TBB_DIR@")
|
|
||||||
|
|
||||||
# see https://stackoverflow.com/questions/28070810/cmake-generate-error-on-windows-as-it-uses-as-escape-seq
|
# try tbb.pc
|
||||||
if(DEFINED ENV{TBBROOT})
|
if(enable_pkgconfig_tbb AND NOT ANDROID)
|
||||||
file(TO_CMAKE_PATH $ENV{TBBROOT} ENV_TBBROOT)
|
_ov_find_dependency(PkgConfig)
|
||||||
endif()
|
if(PkgConfig_FOUND)
|
||||||
if(DEFINED ENV{TBB_DIR})
|
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
|
||||||
file(TO_CMAKE_PATH $ENV{TBB_DIR} ENV_TBB_DIR)
|
set(pkg_config_quiet_arg QUIET)
|
||||||
endif()
|
endif()
|
||||||
|
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
|
||||||
|
set(pkg_config_required_arg REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(find_package_tbb_extra_args
|
pkg_search_module(tbb
|
||||||
CONFIG
|
${pkg_config_quiet_arg}
|
||||||
PATHS
|
${pkg_config_required_arg}
|
||||||
# oneTBB case exposed via export TBBROOT=<custom TBB root>
|
IMPORTED_TARGET GLOBAL
|
||||||
"${ENV_TBBROOT}/lib64/cmake/TBB"
|
tbb)
|
||||||
"${ENV_TBBROOT}/lib/cmake/TBB"
|
unset(pkg_config_quiet_arg)
|
||||||
"${ENV_TBBROOT}/lib/cmake/tbb"
|
unset(pkg_config_required_arg)
|
||||||
"${ENV_TBB_DIR}"
|
|
||||||
# for custom TBB exposed via cmake -DTBBROOT=<custom TBB root>
|
if(tbb_FOUND)
|
||||||
"${TBBROOT}/cmake"
|
add_library(TBB::tbb ALIAS PkgConfig::tbb)
|
||||||
# _tbb_dir points to TBB_DIR (custom | temp | system) used to build OpenVINO
|
set(TBB_VERSION ${tbb_VERSION})
|
||||||
${_tbb_dir}
|
set(TBB_FOUND ${tbb_FOUND})
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
set(TBB_IMPORTED_TARGETS TBB::tbb)
|
||||||
NO_DEFAULT_PATH)
|
message(STATUS "tbb (${tbb_VERSION}) is found at ${tbb_PREFIX}")
|
||||||
unset(_tbb_dir)
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# try cmake TBB interface
|
||||||
|
|
||||||
|
set(enable_system_tbb "@ENABLE_SYSTEM_TBB@")
|
||||||
|
if(NOT enable_system_tbb)
|
||||||
|
set_and_check(_tbb_dir "@PACKAGE_IE_TBB_DIR@")
|
||||||
|
|
||||||
|
# see https://stackoverflow.com/questions/28070810/cmake-generate-error-on-windows-as-it-uses-as-escape-seq
|
||||||
|
if(DEFINED ENV{TBBROOT})
|
||||||
|
file(TO_CMAKE_PATH $ENV{TBBROOT} ENV_TBBROOT)
|
||||||
|
endif()
|
||||||
|
if(DEFINED ENV{TBB_DIR})
|
||||||
|
file(TO_CMAKE_PATH $ENV{TBB_DIR} ENV_TBB_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(find_package_tbb_extra_args
|
||||||
|
CONFIG
|
||||||
|
PATHS
|
||||||
|
# oneTBB case exposed via export TBBROOT=<custom TBB root>
|
||||||
|
"${ENV_TBBROOT}/lib64/cmake/TBB"
|
||||||
|
"${ENV_TBBROOT}/lib/cmake/TBB"
|
||||||
|
"${ENV_TBBROOT}/lib/cmake/tbb"
|
||||||
|
"${ENV_TBB_DIR}"
|
||||||
|
# for custom TBB exposed via cmake -DTBBROOT=<custom TBB root>
|
||||||
|
"${TBBROOT}/cmake"
|
||||||
|
# _tbb_dir points to TBB_DIR (custom | temp | system) used to build OpenVINO
|
||||||
|
${_tbb_dir}
|
||||||
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
unset(_tbb_dir)
|
||||||
|
endif()
|
||||||
|
unset(enable_system_tbb)
|
||||||
|
|
||||||
|
_ov_find_dependency(TBB
|
||||||
|
COMPONENTS tbb tbbmalloc
|
||||||
|
${find_package_tbb_extra_args})
|
||||||
endif()
|
endif()
|
||||||
unset(enable_system_tbb)
|
|
||||||
|
|
||||||
_ov_find_dependency(TBB
|
|
||||||
COMPONENTS tbb tbbmalloc
|
|
||||||
${find_package_tbb_extra_args})
|
|
||||||
|
|
||||||
set(install_tbbbind "@install_tbbbind@")
|
set(install_tbbbind "@install_tbbbind@")
|
||||||
if(install_tbbbind)
|
if(install_tbbbind)
|
||||||
|
|
@ -213,10 +246,23 @@ set(_OV_ENABLE_INTEL_MYRIAD "@ENABLE_INTEL_MYRIAD@")
|
||||||
if(_OV_ENABLE_INTEL_MYRIAD AND NOT _OV_ENABLE_OPENVINO_BUILD_SHARED)
|
if(_OV_ENABLE_INTEL_MYRIAD AND NOT _OV_ENABLE_OPENVINO_BUILD_SHARED)
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
if(PkgConfig_FOUND AND NOT ANDROID)
|
if(PkgConfig_FOUND AND NOT ANDROID)
|
||||||
pkg_search_module(libusb REQUIRED
|
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
|
||||||
|
set(pkg_config_quiet_arg QUIET)
|
||||||
|
endif()
|
||||||
|
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
|
||||||
|
set(pkg_config_required_arg REQUIRED)
|
||||||
|
endif()
|
||||||
|
pkg_search_module(libusb
|
||||||
|
${pkg_config_quiet_arg}
|
||||||
|
${pkg_config_required_arg}
|
||||||
IMPORTED_TARGET GLOBAL
|
IMPORTED_TARGET GLOBAL
|
||||||
libusb-1.0)
|
libusb-1.0)
|
||||||
message(STATUS "libusb-1.0 (${libusb_VERSION}) is found at ${libusb_PREFIX}")
|
unset(pkg_config_quiet_arg)
|
||||||
|
unset(pkg_config_required_arg)
|
||||||
|
|
||||||
|
if(libusb_FOUND)
|
||||||
|
message(STATUS "libusb-1.0 (${libusb_VERSION}) is found at ${libusb_PREFIX}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
unset(_OV_ENABLE_INTEL_MYRIAD)
|
unset(_OV_ENABLE_INTEL_MYRIAD)
|
||||||
|
|
@ -229,8 +275,12 @@ if(NOT TARGET openvino)
|
||||||
# WA for cmake version < 3.16 which does not export
|
# WA for cmake version < 3.16 which does not export
|
||||||
# IMPORTED_LINK_DEPENDENT_LIBRARIES_** properties if no PUBLIC dependencies for the library
|
# IMPORTED_LINK_DEPENDENT_LIBRARIES_** properties if no PUBLIC dependencies for the library
|
||||||
if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND TBB_FOUND)
|
if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND TBB_FOUND)
|
||||||
foreach (type RELEASE DEBUG RELWITHDEBINFO MINSIZEREL)
|
foreach(type RELEASE DEBUG RELWITHDEBINFO MINSIZEREL)
|
||||||
set_property(TARGET openvino::runtime APPEND PROPERTY IMPORTED_LINK_DEPENDENT_LIBRARIES_${type} "TBB::tbb;TBB::tbbmalloc")
|
foreach(tbb_target TBB::tbb TBB::tbbmalloc)
|
||||||
|
if(TARGET ${tbb_target})
|
||||||
|
set_property(TARGET openvino::runtime APPEND PROPERTY IMPORTED_LINK_DEPENDENT_LIBRARIES_${type} "${tbb_target}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,11 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_NAME Linux)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR i386)
|
||||||
|
|
||||||
|
set(PKG_CONFIG_EXECUTABLE i686-linux-gnu-pkg-config CACHE PATH "Path to 32-bits pkg-config")
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_INIT "-m32")
|
set(CMAKE_CXX_FLAGS_INIT "-m32")
|
||||||
set(CMAKE_C_FLAGS_INIT "-m32")
|
set(CMAKE_C_FLAGS_INIT "-m32")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,13 @@ if (NOT (OpenCL_FOUND AND OpenCL_HEADERS))
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# try to find VA libraries
|
# try to find VA libraries
|
||||||
if(NOT CMAKE_CROSSCOMPILING)
|
if(NOT ANDROID)
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
if(PkgConfig_FOUND)
|
if(PkgConfig_FOUND)
|
||||||
pkg_search_module(libva QUIET IMPORTED_TARGET libva)
|
pkg_search_module(libva QUIET IMPORTED_TARGET libva)
|
||||||
|
if(libva_FOUND)
|
||||||
|
message(STATUS "${PKG_CONFIG_EXECUTABLE}: libva (${libva_VERSION}) is found at ${libva_PREFIX}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ if(NOT TARGET gflags)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT TARGET zlib::zlib)
|
if(NOT TARGET zlib::zlib)
|
||||||
if(NOT CMAKE_CROSSCOMPILING)
|
if(NOT ANDROID)
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
if(PkgConfig_FOUND)
|
if(PkgConfig_FOUND)
|
||||||
pkg_search_module(zlib QUIET
|
pkg_search_module(zlib QUIET
|
||||||
|
|
@ -135,7 +135,7 @@ if(NOT TARGET zlib::zlib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(zlib_FOUND)
|
if(zlib_FOUND)
|
||||||
message(STATUS "zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}")
|
message(STATUS "${PKG_CONFIG_EXECUTABLE}: zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}")
|
||||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib")
|
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib")
|
||||||
add_subdirectory(thirdparty/zlib EXCLUDE_FROM_ALL)
|
add_subdirectory(thirdparty/zlib EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ include(cmake/install_tbb.cmake)
|
||||||
|
|
||||||
# CC library should be registered before other cc targets
|
# CC library should be registered before other cc targets
|
||||||
add_subdirectory(common)
|
add_subdirectory(common)
|
||||||
# TODO: Fix Wall for core, frontends, tests and c binding
|
# TODO: Fix Wall for core, frontends and tests
|
||||||
add_subdirectory(core)
|
add_subdirectory(core)
|
||||||
add_subdirectory(frontends)
|
add_subdirectory(frontends)
|
||||||
# TODO: remove ngraph/ngraph.hpp usage
|
# TODO: remove ngraph/ngraph.hpp usage
|
||||||
|
|
|
||||||
|
|
@ -14,28 +14,46 @@ macro(ov_find_package_tbb)
|
||||||
${_find_package_no_args})
|
${_find_package_no_args})
|
||||||
|
|
||||||
if(NOT TBB_FOUND)
|
if(NOT TBB_FOUND)
|
||||||
# system TBB failed to be found
|
|
||||||
set(ENABLE_SYSTEM_TBB OFF)
|
|
||||||
|
|
||||||
# remove invalid TBB_DIR=TBB_DIR-NOTFOUND from cache
|
# remove invalid TBB_DIR=TBB_DIR-NOTFOUND from cache
|
||||||
unset(TBB_DIR CACHE)
|
unset(TBB_DIR CACHE)
|
||||||
unset(TBB_DIR)
|
unset(TBB_DIR)
|
||||||
|
|
||||||
# TBB on system is not found, download prebuilt one
|
# try tbb.pc from system
|
||||||
# if TBBROOT env variable is not defined
|
if(NOT ANDROID AND ENABLE_SYSTEM_TBB)
|
||||||
ov_download_tbb()
|
find_package(PkgConfig QUIET)
|
||||||
|
if(PkgConfig_FOUND)
|
||||||
# fallback variant for TBB 2018 and older where TBB have not had cmake interface
|
pkg_search_module(tbb QUIET
|
||||||
if(DEFINED TBBROOT OR DEFINED ENV{TBBROOT})
|
IMPORTED_TARGET GLOBAL
|
||||||
set(_tbb_paths PATHS ${IEDevScripts_DIR})
|
tbb)
|
||||||
|
if(tbb_FOUND)
|
||||||
|
add_library(TBB::tbb ALIAS PkgConfig::tbb)
|
||||||
|
set(TBB_VERSION ${tbb_VERSION})
|
||||||
|
set(TBB_FOUND ${tbb_FOUND})
|
||||||
|
message(STATUS "${PKG_CONFIG_EXECUTABLE}: tbb (${tbb_VERSION}) is found at ${tbb_PREFIX}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# try to find one more time
|
if(NOT TBB_FOUND)
|
||||||
find_package(TBB QUIET COMPONENTS tbb tbbmalloc
|
# system TBB failed to be found
|
||||||
# can be provided by ov_download_tbb
|
set(ENABLE_SYSTEM_TBB OFF)
|
||||||
HINTS ${TBB_DIR}
|
|
||||||
${_tbb_paths}
|
# TBB on system is not found, download prebuilt one
|
||||||
${_find_package_no_args})
|
# if TBBROOT env variable is not defined
|
||||||
|
ov_download_tbb()
|
||||||
|
|
||||||
|
# fallback variant for TBB 2018 and older where TBB have not had cmake interface
|
||||||
|
if(DEFINED TBBROOT OR DEFINED ENV{TBBROOT})
|
||||||
|
set(_tbb_paths PATHS ${IEDevScripts_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# try to find one more time
|
||||||
|
find_package(TBB QUIET COMPONENTS tbb tbbmalloc
|
||||||
|
# can be provided by ov_download_tbb
|
||||||
|
HINTS ${TBB_DIR}
|
||||||
|
${_tbb_paths}
|
||||||
|
${_find_package_no_args})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# WA for oneTBB: it does not define TBB_IMPORTED_TARGETS
|
# WA for oneTBB: it does not define TBB_IMPORTED_TARGETS
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,30 @@ include(cmake/ie_parallel.cmake)
|
||||||
# pre-find TBB: need to provide TBB_IMPORTED_TARGETS used for installation
|
# pre-find TBB: need to provide TBB_IMPORTED_TARGETS used for installation
|
||||||
ov_find_package_tbb()
|
ov_find_package_tbb()
|
||||||
|
|
||||||
|
function(_ov_get_tbb_library_path tbb_lib tbb_libs_dir)
|
||||||
|
if(NOT TBB_FOUND)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# i.e. yocto case
|
||||||
|
get_target_property(_tbb_lib_location ${tbb_lib} INTERFACE_LINK_LIBRARIES)
|
||||||
|
if(_tbb_lib_location)
|
||||||
|
get_filename_component(_tbb_libs_dir "${_tbb_lib_location}" DIRECTORY)
|
||||||
|
set(${tbb_libs_dir} "${_tbb_libs_dir}" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# usual imported library
|
||||||
|
get_target_property(_tbb_lib_location ${tbb_lib} IMPORTED_LOCATION_RELEASE)
|
||||||
|
if(_tbb_lib_location)
|
||||||
|
get_filename_component(_tbb_libs_dir "${_tbb_lib_location}" DIRECTORY)
|
||||||
|
set(${tbb_libs_dir} "${_tbb_libs_dir}" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(FATAL_ERROR "Failed to detect TBB library location")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# check whether TBB has TBBBind 2.5 with hwloc 2.5 or higher which is required
|
# check whether TBB has TBBBind 2.5 with hwloc 2.5 or higher which is required
|
||||||
# to detect hybrid cores
|
# to detect hybrid cores
|
||||||
function(_ov_detect_dynamic_tbbbind_2_5 var)
|
function(_ov_detect_dynamic_tbbbind_2_5 var)
|
||||||
|
|
@ -15,8 +39,7 @@ function(_ov_detect_dynamic_tbbbind_2_5 var)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# try to select proper library directory
|
# try to select proper library directory
|
||||||
get_target_property(_tbb_lib_location TBB::tbb IMPORTED_LOCATION_RELEASE)
|
_ov_get_tbb_library_path(TBB::tbb _tbb_libs_dir)
|
||||||
get_filename_component(_tbb_libs_dir "${_tbb_lib_location}" DIRECTORY)
|
|
||||||
|
|
||||||
# unset for cases if user specified different TBB_DIR / TBBROOT
|
# unset for cases if user specified different TBB_DIR / TBBROOT
|
||||||
unset(_ov_tbbbind_2_5 CACHE)
|
unset(_ov_tbbbind_2_5 CACHE)
|
||||||
|
|
@ -103,7 +126,7 @@ if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND
|
||||||
# for system libraries we still need to install TBB libraries
|
# for system libraries we still need to install TBB libraries
|
||||||
# so, need to take locations of actual libraries and install them
|
# so, need to take locations of actual libraries and install them
|
||||||
foreach(tbb_lib IN LISTS TBB_IMPORTED_TARGETS)
|
foreach(tbb_lib IN LISTS TBB_IMPORTED_TARGETS)
|
||||||
get_target_property(tbb_loc ${tbb_lib} IMPORTED_LOCATION_RELEASE)
|
_ov_get_tbb_library_path(${tbb_lib} tbb_loc)
|
||||||
# depending on the TBB, tbb_loc can be in form:
|
# depending on the TBB, tbb_loc can be in form:
|
||||||
# - libtbb.so.x.y
|
# - libtbb.so.x.y
|
||||||
# - libtbb.so.x
|
# - libtbb.so.x
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@ function(ie_add_onednn)
|
||||||
|
|
||||||
# WA for old TBBConfig.cmake like tbb2019_20180718oss
|
# WA for old TBBConfig.cmake like tbb2019_20180718oss
|
||||||
# they don't check that imported target is already created
|
# they don't check that imported target is already created
|
||||||
if(TBB_FOUND AND TBB_VERSION VERSION_GREATER_EQUAL 2018 AND TBB_VERSION VERSION_LESS_EQUAL 2019.4)
|
if(TBB_FOUND)
|
||||||
set(Threading_cmake_included ON)
|
set(TBB_cmake_included ON)
|
||||||
set(DNNL_CPU_THREADING_RUNTIME "${THREADING}")
|
set(DNNL_CPU_THREADING_RUNTIME "${THREADING}")
|
||||||
function(find_package_tbb)
|
function(find_package_tbb)
|
||||||
# dummy
|
# dummy
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ addIeTargetTest(
|
||||||
)
|
)
|
||||||
|
|
||||||
# try to find VA libraries
|
# try to find VA libraries
|
||||||
if(NOT CMAKE_CROSSCOMPILING)
|
if(NOT ANDROID)
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
if(PkgConfig_FOUND)
|
if(PkgConfig_FOUND)
|
||||||
pkg_search_module(libva QUIET IMPORTED_TARGET libva)
|
pkg_search_module(libva QUIET IMPORTED_TARGET libva)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ if(NOT ANDROID)
|
||||||
zlib)
|
zlib)
|
||||||
if(zlib_FOUND)
|
if(zlib_FOUND)
|
||||||
add_library(zlib::zlib ALIAS PkgConfig::zlib)
|
add_library(zlib::zlib ALIAS PkgConfig::zlib)
|
||||||
message(STATUS "zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}")
|
message(STATUS "${PKG_CONFIG_EXECUTABLE}: zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -33,15 +33,22 @@ if(NOT DEFINED protobuf_MSVC_STATIC_RUNTIME)
|
||||||
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link protobuf to static runtime libraries" FORCE)
|
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link protobuf to static runtime libraries" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CROSSCOMPILING)
|
# WA: see CVS-90227 about X86
|
||||||
|
if(CMAKE_CROSSCOMPILING AND NOT X86)
|
||||||
find_host_program(SYSTEM_PROTOC protoc PATHS ENV PATH)
|
find_host_program(SYSTEM_PROTOC protoc PATHS ENV PATH)
|
||||||
|
|
||||||
if(SYSTEM_PROTOC)
|
if(SYSTEM_PROTOC)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${SYSTEM_PROTOC} --version
|
COMMAND ${SYSTEM_PROTOC} --version
|
||||||
OUTPUT_VARIABLE PROTOC_VERSION
|
OUTPUT_VARIABLE PROTOC_VERSION
|
||||||
|
ERROR_VARIABLE error_message
|
||||||
|
RESULT_VARIABLE exit_code
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
if(NOT exit_code EQUAL 0)
|
||||||
|
message(FATAL_ERROR "Internal error: failed to get ${SYSTEM_PROTOC} version ${error_message}")
|
||||||
|
endif()
|
||||||
|
|
||||||
string(REPLACE " " ";" PROTOC_VERSION ${PROTOC_VERSION})
|
string(REPLACE " " ";" PROTOC_VERSION ${PROTOC_VERSION})
|
||||||
list(GET PROTOC_VERSION -1 PROTOC_VERSION)
|
list(GET PROTOC_VERSION -1 PROTOC_VERSION)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue