Build with system TBB (#11244)
* Build with system TBB * Fixes * Check whether system TBB is available * Try to fix ONNX Runtime build with system TBB * Test * Fixed compilation of threading.cpp * Fixed unset of cache dirs * Limit dearch paths of TBB * Try to enable pip packages with custom TBB * Fix for TBB 2021.2 * Install only needed TBB libraries * Install TBB from system to pip package * Reverted usage of TBBROOT * Fixed oneTBB case * Try to fix Android * Escape some paths * Added samples path * Fixed TBBBind usage for case of system TBB
This commit is contained in:
parent
d99104cf55
commit
3c724a1dee
@ -350,6 +350,7 @@ jobs:
|
|||||||
- script: |
|
- script: |
|
||||||
export PATH=$HOME/.local/bin:$PATH
|
export PATH=$HOME/.local/bin:$PATH
|
||||||
export IE_APP_PATH=$(INSTALL_DIR)/samples_bin
|
export IE_APP_PATH=$(INSTALL_DIR)/samples_bin
|
||||||
|
export LD_LIBRARY_PATH=$IE_APP_PATH:$LD_LIBRARY_PATH
|
||||||
export IE_APP_PYTHON_PATH=$(INSTALL_DIR)/samples/python/
|
export IE_APP_PYTHON_PATH=$(INSTALL_DIR)/samples/python/
|
||||||
export SHARE=$(INSTALL_DIR)/tests/smoke_tests/samples_smoke_tests_data/
|
export SHARE=$(INSTALL_DIR)/tests/smoke_tests/samples_smoke_tests_data/
|
||||||
export WORKSPACE=$(INSTALL_DIR)
|
export WORKSPACE=$(INSTALL_DIR)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
if(DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS)
|
if(DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS)
|
||||||
# 'target_link_libraries' does not work correctly when called from
|
# 'target_link_libraries' does not work correctly when called from
|
||||||
# different directly where 'add_library' is called: CMake generates
|
# different directory where 'add_library' is called: CMake generates
|
||||||
# incorrect OpenVINOConfig.cmake in this case
|
# incorrect OpenVINOConfig.cmake in this case
|
||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.17)
|
||||||
else()
|
else()
|
||||||
@ -17,8 +17,6 @@ if(NOT CMAKE_BUILD_TYPE)
|
|||||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build type" FORCE)
|
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build type" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(IE_MAIN_SOURCE_DIR ${OpenVINO_SOURCE_DIR}/inference-engine)
|
|
||||||
|
|
||||||
find_package(IEDevScripts REQUIRED
|
find_package(IEDevScripts REQUIRED
|
||||||
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
|
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
|
@ -23,9 +23,7 @@ message(STATUS "MODELS_PATH=" ${MODELS_PATH})
|
|||||||
|
|
||||||
fetch_models_and_validation_set()
|
fetch_models_and_validation_set()
|
||||||
|
|
||||||
if(COMMAND get_linux_name)
|
get_linux_name(LINUX_OS_NAME)
|
||||||
get_linux_name(LINUX_OS_NAME)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
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.*")
|
||||||
set(protoc_version "3.18.2")
|
set(protoc_version "3.18.2")
|
||||||
@ -93,7 +91,7 @@ if(THREADING STREQUAL "OMP")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
## TBB package
|
## TBB package
|
||||||
if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO" AND NOT ENABLE_SYSTEM_TBB)
|
||||||
reset_deps_cache(TBBROOT TBB_DIR)
|
reset_deps_cache(TBBROOT TBB_DIR)
|
||||||
|
|
||||||
if(DEFINED ENV{THIRDPARTY_SERVER_PATH})
|
if(DEFINED ENV{THIRDPARTY_SERVER_PATH})
|
||||||
@ -109,16 +107,6 @@ if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
|||||||
TARGET_PATH "${TEMP}/tbb"
|
TARGET_PATH "${TEMP}/tbb"
|
||||||
ENVIRONMENT "TBBROOT"
|
ENVIRONMENT "TBBROOT"
|
||||||
SHA256 "f1c9b9e2861efdaa01552bd25312ccbc5feeb45551e5f91ae61e29221c5c1479")
|
SHA256 "f1c9b9e2861efdaa01552bd25312ccbc5feeb45551e5f91ae61e29221c5c1479")
|
||||||
if(ENABLE_TBBBIND_2_5)
|
|
||||||
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
|
||||||
ARCHIVE_WIN "tbbbind_2_5_static_win_v1.zip"
|
|
||||||
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
|
||||||
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
|
||||||
SHA256 "a67afeea8cf194f97968c800dab5b5459972908295242e282045d6b8953573c1")
|
|
||||||
else()
|
|
||||||
message(WARNING "prebuilt TBBBIND_2_5 is not available.
|
|
||||||
Build oneTBB from sources and set TBBROOT environment var before OpenVINO cmake configure")
|
|
||||||
endif()
|
|
||||||
elseif(ANDROID) # Should be before LINUX due LINUX is detected as well
|
elseif(ANDROID) # Should be before LINUX due LINUX is detected as well
|
||||||
RESOLVE_DEPENDENCY(TBB
|
RESOLVE_DEPENDENCY(TBB
|
||||||
ARCHIVE_ANDROID "tbb2020_20200404_android.tgz"
|
ARCHIVE_ANDROID "tbb2020_20200404_android.tgz"
|
||||||
@ -131,16 +119,6 @@ if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
|||||||
TARGET_PATH "${TEMP}/tbb"
|
TARGET_PATH "${TEMP}/tbb"
|
||||||
ENVIRONMENT "TBBROOT"
|
ENVIRONMENT "TBBROOT"
|
||||||
SHA256 "95b2f3b0b70c7376a0c7de351a355c2c514b42c4966e77e3e34271a599501008")
|
SHA256 "95b2f3b0b70c7376a0c7de351a355c2c514b42c4966e77e3e34271a599501008")
|
||||||
if(ENABLE_TBBBIND_2_5)
|
|
||||||
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
|
||||||
ARCHIVE_LIN "tbbbind_2_5_static_lin_v2.tgz"
|
|
||||||
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
|
||||||
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
|
||||||
SHA256 "865e7894c58402233caf0d1b288056e0e6ab2bf7c9d00c9dc60561c484bc90f4")
|
|
||||||
else()
|
|
||||||
message(WARNING "prebuilt TBBBIND_2_5 is not available.
|
|
||||||
Build oneTBB from sources and set TBBROOT environment var before OpenVINO cmake configure")
|
|
||||||
endif()
|
|
||||||
elseif(LINUX AND AARCH64)
|
elseif(LINUX AND AARCH64)
|
||||||
RESOLVE_DEPENDENCY(TBB
|
RESOLVE_DEPENDENCY(TBB
|
||||||
ARCHIVE_LIN "keembay/tbb2020_38404_kmb_lic.tgz"
|
ARCHIVE_LIN "keembay/tbb2020_38404_kmb_lic.tgz"
|
||||||
@ -160,13 +138,54 @@ if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
|||||||
update_deps_cache(TBBROOT "${TBB}" "Path to TBB root folder")
|
update_deps_cache(TBBROOT "${TBB}" "Path to TBB root folder")
|
||||||
if(EXISTS "${TBBROOT}/lib/cmake/TBB/TBBConfig.cmake")
|
if(EXISTS "${TBBROOT}/lib/cmake/TBB/TBBConfig.cmake")
|
||||||
# oneTBB case
|
# oneTBB case
|
||||||
update_deps_cache(TBB_DIR "${TBB}/lib/cmake/TBB" "Path to TBB cmake folder")
|
update_deps_cache(TBB_DIR "${TBBROOT}/lib/cmake/TBB" "Path to TBB cmake folder")
|
||||||
|
elseif(EXISTS "${TBBROOT}/lib64/cmake/TBB/TBBConfig.cmake")
|
||||||
|
# 64-bits oneTBB case
|
||||||
|
update_deps_cache(TBB_DIR "${TBBROOT}/lib64/cmake/TBB" "Path to TBB cmake folder")
|
||||||
|
elseif(EXISTS "${TBBROOT}/cmake/TBBConfig.cmake")
|
||||||
|
# custom downloaded or user provided TBB
|
||||||
|
update_deps_cache(TBB_DIR "${TBBROOT}/cmake" "Path to TBB cmake folder")
|
||||||
else()
|
else()
|
||||||
update_deps_cache(TBB_DIR "${TBB}/cmake" "Path to TBB cmake folder")
|
message(FATAL_ERROR "Failed to find TBBConfig.cmake in ${TBBROOT} tree")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
update_deps_cache(TBBBIND_2_5_DIR "${TBBBIND_2_5}/cmake" "Path to TBBBIND_2_5 cmake folder")
|
update_deps_cache(TBBBIND_2_5_DIR "${TBBBIND_2_5}/cmake" "Path to TBBBIND_2_5 cmake folder")
|
||||||
|
|
||||||
debug_message(STATUS "tbb=" ${TBB})
|
debug_message(STATUS "tbb=" ${TBB})
|
||||||
|
debug_message(STATUS "tbb_dir=" ${TBB_DIR})
|
||||||
|
debug_message(STATUS "tbbroot=" ${TBBROOT})
|
||||||
|
|
||||||
|
if(DEFINED IE_PATH_TO_DEPS)
|
||||||
|
unset(IE_PATH_TO_DEPS)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
## TBBBind_2_5 package
|
||||||
|
if(ENABLE_TBBBIND_2_5)
|
||||||
|
if(DEFINED ENV{THIRDPARTY_SERVER_PATH})
|
||||||
|
set(IE_PATH_TO_DEPS "$ENV{THIRDPARTY_SERVER_PATH}")
|
||||||
|
elseif(DEFINED THIRDPARTY_SERVER_PATH)
|
||||||
|
set(IE_PATH_TO_DEPS "${THIRDPARTY_SERVER_PATH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32 AND X86_64)
|
||||||
|
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
||||||
|
ARCHIVE_WIN "tbbbind_2_5_static_win_v1.zip"
|
||||||
|
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
||||||
|
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
||||||
|
SHA256 "a67afeea8cf194f97968c800dab5b5459972908295242e282045d6b8953573c1")
|
||||||
|
elseif(LINUX AND X86_64)
|
||||||
|
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
||||||
|
ARCHIVE_LIN "tbbbind_2_5_static_lin_v2.tgz"
|
||||||
|
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
||||||
|
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
||||||
|
SHA256 "865e7894c58402233caf0d1b288056e0e6ab2bf7c9d00c9dc60561c484bc90f4")
|
||||||
|
else()
|
||||||
|
message(WARNING "prebuilt TBBBIND_2_5 is not available.
|
||||||
|
Build oneTBB from sources and set TBBROOT environment var before OpenVINO cmake configure")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
update_deps_cache(TBBBIND_2_5_DIR "${TBBBIND_2_5}/cmake" "Path to TBBBIND_2_5 cmake folder")
|
||||||
|
|
||||||
if(DEFINED IE_PATH_TO_DEPS)
|
if(DEFINED IE_PATH_TO_DEPS)
|
||||||
unset(IE_PATH_TO_DEPS)
|
unset(IE_PATH_TO_DEPS)
|
||||||
@ -265,8 +284,6 @@ else()
|
|||||||
reset_deps_cache(OpenCV_DIR)
|
reset_deps_cache(OpenCV_DIR)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(${OpenVINO_SOURCE_DIR}/src/cmake/ie_parallel.cmake)
|
|
||||||
|
|
||||||
if(ENABLE_INTEL_GNA)
|
if(ENABLE_INTEL_GNA)
|
||||||
reset_deps_cache(
|
reset_deps_cache(
|
||||||
GNA_EXT_DIR
|
GNA_EXT_DIR
|
||||||
|
@ -26,10 +26,7 @@ endif()
|
|||||||
find_package(TBB
|
find_package(TBB
|
||||||
CONFIG
|
CONFIG
|
||||||
PATHS ${TBBROOT}/cmake
|
PATHS ${TBBROOT}/cmake
|
||||||
${TBBROOT}/lib/cmake/TBB # oneTBB case
|
|
||||||
${IEDevScripts_DIR}/${IE_OWN_TBB_CONFIG}
|
${IEDevScripts_DIR}/${IE_OWN_TBB_CONFIG}
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
NO_DEFAULT_PATH)
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
find_package_handle_standard_args(TBB CONFIG_MODE)
|
find_package_handle_standard_args(TBB CONFIG_MODE)
|
||||||
|
@ -7,7 +7,7 @@ include(target_flags)
|
|||||||
|
|
||||||
# FIXME: there are compiler failures with LTO and Cross-Compile toolchains. Disabling for now, but
|
# FIXME: there are compiler failures with LTO and Cross-Compile toolchains. Disabling for now, but
|
||||||
# this must be addressed in a proper way
|
# this must be addressed in a proper way
|
||||||
ie_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF "LINUX;NOT CMAKE_CROSSCOMPILING; CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
|
ie_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF "LINUX;NOT CMAKE_CROSSCOMPILING;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
|
||||||
|
|
||||||
ie_option (OS_FOLDER "create OS dedicated folder in output" OFF)
|
ie_option (OS_FOLDER "create OS dedicated folder in output" OFF)
|
||||||
|
|
||||||
@ -79,6 +79,4 @@ if(ENABLE_AVX512F)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (VERBOSE_BUILD)
|
set(CMAKE_VERBOSE_MAKEFILE ${VERBOSE_BUILD} CACHE BOOL "" FORCE)
|
||||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "" FORCE)
|
|
||||||
endif()
|
|
||||||
|
@ -31,4 +31,8 @@ if (LINUX)
|
|||||||
set(${res_var} NOTFOUND PARENT_SCOPE)
|
set(${res_var} NOTFOUND PARENT_SCOPE)
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
else()
|
||||||
|
function(get_linux_name res_var)
|
||||||
|
set(${res_var} NOTFOUND PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -82,7 +82,7 @@ else()
|
|||||||
set(ENABLE_TBBBIND_2_5_DEFAULT OFF)
|
set(ENABLE_TBBBIND_2_5_DEFAULT OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ie_dependent_option (ENABLE_TBBBIND_2_5 "Enable TBBBind_2_5 static usage in OpenVINO runtime" ON "ENABLE_TBBBIND_2_5_DEFAULT" OFF)
|
ie_dependent_option (ENABLE_TBBBIND_2_5 "Enable TBBBind_2_5 static usage in OpenVINO runtime" ${ENABLE_TBBBIND_2_5_DEFAULT} "THREADING MATCHES TBB" OFF)
|
||||||
|
|
||||||
ie_dependent_option (ENABLE_INTEL_GNA "GNA support for inference engine" ON
|
ie_dependent_option (ENABLE_INTEL_GNA "GNA support for inference engine" ON
|
||||||
"NOT APPLE;NOT ANDROID;X86_64;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.4" OFF)
|
"NOT APPLE;NOT ANDROID;X86_64;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.4" OFF)
|
||||||
@ -136,6 +136,31 @@ ie_dependent_option(ENABLE_TBB_RELEASE_ONLY "Only Release TBB libraries are link
|
|||||||
|
|
||||||
ie_dependent_option (ENABLE_SYSTEM_PUGIXML "use the system copy of pugixml" OFF "BUILD_SHARED_LIBS" OFF)
|
ie_dependent_option (ENABLE_SYSTEM_PUGIXML "use the system copy of pugixml" OFF "BUILD_SHARED_LIBS" OFF)
|
||||||
|
|
||||||
|
get_linux_name(LINUX_OS_NAME)
|
||||||
|
if(LINUX_OS_NAME MATCHES "^Ubuntu [0-9]+\.[0-9]+$" AND NOT DEFINED ENV{TBBROOT})
|
||||||
|
# Debian packages are enabled on Ubuntu systems
|
||||||
|
set(ENABLE_SYSTEM_TBB_DEFAULT ON)
|
||||||
|
|
||||||
|
# check whether "default" (customly provided or system one) is available
|
||||||
|
find_package(TBB QUIET)
|
||||||
|
if(NOT TBB_FOUND)
|
||||||
|
message(WARNING "System TBB is not found, custom TBB version will be downloaded from shared drive")
|
||||||
|
# we still need to download prebuilt version of TBB
|
||||||
|
set(ENABLE_SYSTEM_TBB_DEFAULT OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# remove found TBB (or invalid TBB_DIR-NOTFOUND) from cache
|
||||||
|
unset(TBB_DIR CACHE)
|
||||||
|
unset(TBB_DIR)
|
||||||
|
unset(TBB_FOUND)
|
||||||
|
unset(TBB_IMPORTED_TARGETS)
|
||||||
|
unset(TBB_VERSION)
|
||||||
|
else()
|
||||||
|
set(ENABLE_SYSTEM_TBB_DEFAULT OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ie_dependent_option (ENABLE_SYSTEM_TBB "use the system version of TBB" ${ENABLE_SYSTEM_TBB_DEFAULT} "THREADING MATCHES TBB;LINUX" OFF)
|
||||||
|
|
||||||
ie_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" OFF)
|
ie_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" OFF)
|
||||||
|
|
||||||
ie_dependent_option (ENABLE_GPU_DEBUG_CAPS "enable GPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS" OFF)
|
ie_dependent_option (ENABLE_GPU_DEBUG_CAPS "enable GPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS" OFF)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# * `Runtime`: OpenVINO C++ and C Core & Inference Runtime, frontend common
|
# * `Runtime`: OpenVINO C++ and C Core & Inference Runtime, frontend common
|
||||||
# * `ONNX`: OpenVINO ONNX frontend
|
# * `ONNX`: OpenVINO ONNX frontend
|
||||||
# * `Paddle`: OpenVINO Paddle frontend
|
# * `Paddle`: OpenVINO Paddle frontend
|
||||||
# * `TF`: OpenVINO TensorFlow frontend
|
# * `TensorFlow`: OpenVINO TensorFlow frontend
|
||||||
#
|
#
|
||||||
# If no components are specified, `Runtime` component is provided:
|
# If no components are specified, `Runtime` component is provided:
|
||||||
#
|
#
|
||||||
@ -147,14 +147,29 @@ 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@")
|
||||||
|
if(NOT enable_system_tbb)
|
||||||
set_and_check(_tbb_dir "@PACKAGE_IE_TBB_DIR@")
|
set_and_check(_tbb_dir "@PACKAGE_IE_TBB_DIR@")
|
||||||
_ov_find_dependency(TBB
|
set(find_package_tbb_extra_args
|
||||||
COMPONENTS tbb tbbmalloc
|
|
||||||
CONFIG
|
CONFIG
|
||||||
PATHS ${TBBROOT}/cmake
|
PATHS
|
||||||
|
# oneTBB case exposed via export TBBROOT=<custom TBB root>
|
||||||
|
"$ENV{TBBROOT}/lib64/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}
|
${_tbb_dir}
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
NO_DEFAULT_PATH)
|
NO_DEFAULT_PATH)
|
||||||
|
unset(_tbb_dir)
|
||||||
|
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)
|
||||||
@ -165,6 +180,7 @@ if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND NOT TBB_FOUND
|
|||||||
NO_DEFAULT_PATH)
|
NO_DEFAULT_PATH)
|
||||||
set_target_properties(${TBBBIND_2_5_IMPORTED_TARGETS} PROPERTIES IMPORTED_GLOBAL ON)
|
set_target_properties(${TBBBIND_2_5_IMPORTED_TARGETS} PROPERTIES IMPORTED_GLOBAL ON)
|
||||||
endif()
|
endif()
|
||||||
|
unset(install_tbbbind)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
_ov_find_dependency(Threads)
|
_ov_find_dependency(Threads)
|
||||||
@ -176,7 +192,7 @@ if(ENABLE_INTEL_GNA AND NOT ENABLE_INTEL_GNA_SHARED AND NOT libGNA_FOUND)
|
|||||||
_ov_find_dependency(libGNA
|
_ov_find_dependency(libGNA
|
||||||
COMPONENTS KERNEL
|
COMPONENTS KERNEL
|
||||||
CONFIG
|
CONFIG
|
||||||
PATHS ${CMAKE_CURRENT_LIST_DIR}
|
PATHS "${CMAKE_CURRENT_LIST_DIR}"
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
NO_DEFAULT_PATH)
|
NO_DEFAULT_PATH)
|
||||||
endif()
|
endif()
|
||||||
|
@ -64,6 +64,7 @@ if [ -f /etc/lsb-release ]; then
|
|||||||
libgstreamer1.0-0 \
|
libgstreamer1.0-0 \
|
||||||
gstreamer1.0-plugins-base \
|
gstreamer1.0-plugins-base \
|
||||||
libusb-1.0-0-dev \
|
libusb-1.0-0-dev \
|
||||||
|
libtbb-dev \
|
||||||
libtinfo5 \
|
libtinfo5 \
|
||||||
libopenblas-dev
|
libopenblas-dev
|
||||||
if apt-cache search --names-only '^libjson-c2'| grep -q libjson-c2; then
|
if apt-cache search --names-only '^libjson-c2'| grep -q libjson-c2; then
|
||||||
|
@ -16,10 +16,10 @@ find_package(OpenCV COMPONENTS core imgproc imgcodecs QUIET)
|
|||||||
if(NOT OpenCV_FOUND)
|
if(NOT OpenCV_FOUND)
|
||||||
message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} is built without OPENCV support")
|
message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} is built without OPENCV support")
|
||||||
else()
|
else()
|
||||||
add_definitions(-DUSE_OPENCV)
|
target_compile_definitions(${TARGET_NAME} PRIVATE USE_OPENCV)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${TARGET_NAME} PUBLIC ${OpenCV_LIBRARIES})
|
target_link_libraries(${TARGET_NAME} PRIVATE ${OpenCV_LIBRARIES})
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
|
@ -167,12 +167,8 @@ This section provides step-by-step instructions on how to run the Benchmark Tool
|
|||||||
```sh
|
```sh
|
||||||
omz_downloader --name googlenet-v1 -o <models_dir>
|
omz_downloader --name googlenet-v1 -o <models_dir>
|
||||||
```
|
```
|
||||||
<<<<<<< HEAD
|
|
||||||
3. Convert the model to the OpenVINO IR format. Run the Model Optimizer using the `mo` command with the path to the model, model format and output directory to generate the IR files:
|
3. Convert the model to the OpenVINO IR format. Run the Model Optimizer using the `mo` command with the path to the model, model format and output directory to generate the IR files:
|
||||||
|
|
||||||
=======
|
|
||||||
2. Convert the model to the OpenVINO IR format. Run the Model Optimizer using the `mo` command with the path to the model, model format (which must be FP32 for CPU and FPG) and output directory to generate the IR files:
|
|
||||||
>>>>>>> cf8ccb590a... Removed obsolete code snippets (#11061)
|
|
||||||
```sh
|
```sh
|
||||||
mo --input_model <models_dir>/public/googlenet-v1/googlenet-v1.caffemodel --data_type FP32 --output_dir <ir_dir>
|
mo --input_model <models_dir>/public/googlenet-v1/googlenet-v1.caffemodel --data_type FP32 --output_dir <ir_dir>
|
||||||
```
|
```
|
||||||
|
@ -2,30 +2,26 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
function(set_ie_threading_interface_for TARGET_NAME)
|
macro(ov_find_tbb)
|
||||||
macro(ext_message TRACE_LEVEL)
|
if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO" AND NOT TBB_FOUND)
|
||||||
if (TRACE_LEVEL STREQUAL FATAL_ERROR)
|
find_package(TBB COMPONENTS tbb tbbmalloc)
|
||||||
if(InferenceEngine_FIND_REQUIRED)
|
|
||||||
message(FATAL_ERROR "${ARGN}")
|
|
||||||
elseif(NOT InferenceEngine_FIND_QUIETLY)
|
|
||||||
message(WARNING "${ARGN}")
|
|
||||||
endif()
|
|
||||||
return()
|
|
||||||
elseif(NOT InferenceEngine_FIND_QUIETLY)
|
|
||||||
message(${TRACE_LEVEL} "${ARGN}")
|
|
||||||
endif ()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
if (THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO" AND NOT TBB_FOUND)
|
# try to find TBB via custom scripts if have not found by default
|
||||||
if(IEDevScripts_DIR)
|
if(NOT TBB_FOUND AND IEDevScripts_DIR)
|
||||||
|
# remove invalid TBB_DIR=TBB_DIR-NOTFOUND from cache
|
||||||
|
unset(TBB_DIR CACHE)
|
||||||
|
unset(TBB_DIR)
|
||||||
|
|
||||||
|
# use our custom scripts for old TBB versions
|
||||||
|
# which are exposed via `export TBBROOT=<tbbroot>`
|
||||||
|
# see https://github.com/openvinotoolkit/openvino/pull/1288
|
||||||
find_package(TBB COMPONENTS tbb tbbmalloc
|
find_package(TBB COMPONENTS tbb tbbmalloc
|
||||||
PATHS IEDevScripts_DIR
|
PATHS ${IEDevScripts_DIR}
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
NO_DEFAULT_PATH)
|
NO_DEFAULT_PATH)
|
||||||
else()
|
|
||||||
find_dependency(TBB COMPONENTS tbb tbbmalloc)
|
|
||||||
endif()
|
endif()
|
||||||
# oneTBB does not define TBB_IMPORTED_TARGETS
|
|
||||||
|
# WA for oneTBB: it does not define TBB_IMPORTED_TARGETS
|
||||||
if(TBB_FOUND AND NOT TBB_IMPORTED_TARGETS)
|
if(TBB_FOUND AND NOT TBB_IMPORTED_TARGETS)
|
||||||
foreach(target TBB::tbb TBB::tbbmalloc)
|
foreach(target TBB::tbb TBB::tbbmalloc)
|
||||||
if(TARGET ${target})
|
if(TARGET ${target})
|
||||||
@ -33,15 +29,23 @@ function(set_ie_threading_interface_for TARGET_NAME)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# set variables to parent scope to prevent multiple invocations of find_package(TBB)
|
||||||
|
# at the same CMakeLists.txt; invocations in different directories are allowed
|
||||||
set(TBB_FOUND ${TBB_FOUND} PARENT_SCOPE)
|
set(TBB_FOUND ${TBB_FOUND} PARENT_SCOPE)
|
||||||
set(TBB_IMPORTED_TARGETS ${TBB_IMPORTED_TARGETS} PARENT_SCOPE)
|
set(TBB_IMPORTED_TARGETS ${TBB_IMPORTED_TARGETS} PARENT_SCOPE)
|
||||||
set(TBB_VERSION ${TBB_VERSION} PARENT_SCOPE)
|
set(TBB_VERSION ${TBB_VERSION} PARENT_SCOPE)
|
||||||
if (NOT TBB_FOUND)
|
if (NOT TBB_FOUND)
|
||||||
set(THREADING "SEQ" PARENT_SCOPE)
|
set(THREADING "SEQ" PARENT_SCOPE)
|
||||||
ext_message(WARNING "TBB was not found by the configured TBB_DIR/TBBROOT path.\
|
message(WARNING "TBB was not found by the configured TBB_DIR/TBBROOT path.\
|
||||||
SEQ method will be used.")
|
SEQ method will be used.")
|
||||||
endif ()
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
function(set_ie_threading_interface_for TARGET_NAME)
|
||||||
|
# find TBB
|
||||||
|
ov_find_tbb()
|
||||||
|
|
||||||
get_target_property(target_type ${TARGET_NAME} TYPE)
|
get_target_property(target_type ${TARGET_NAME} TYPE)
|
||||||
|
|
||||||
@ -59,32 +63,11 @@ function(set_ie_threading_interface_for TARGET_NAME)
|
|||||||
# TODO: why TBB propogates its headers to inference_engine?
|
# TODO: why TBB propogates its headers to inference_engine?
|
||||||
set(LINK_TYPE "PRIVATE")
|
set(LINK_TYPE "PRIVATE")
|
||||||
else()
|
else()
|
||||||
ext_message(WARNING "Unknown target type")
|
message(WARNING "Unknown target type")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(ie_target_link_libraries TARGET_NAME LINK_TYPE)
|
function(ie_target_link_libraries TARGET_NAME LINK_TYPE)
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.12.0")
|
|
||||||
if(NOT target_type STREQUAL "OBJECT_LIBRARY")
|
|
||||||
target_link_libraries(${TARGET_NAME} ${LINK_TYPE} ${ARGN})
|
target_link_libraries(${TARGET_NAME} ${LINK_TYPE} ${ARGN})
|
||||||
else()
|
|
||||||
# Object library may not link to anything.
|
|
||||||
# To add interface include definitions and compile options explicitly.
|
|
||||||
foreach(ITEM IN LISTS ARGN)
|
|
||||||
if(TARGET ${ITEM})
|
|
||||||
get_target_property(compile_options ${ITEM} INTERFACE_COMPILE_OPTIONS)
|
|
||||||
if (compile_options)
|
|
||||||
target_compile_options(${TARGET_NAME} ${LINK_TYPE} ${compile_options})
|
|
||||||
endif()
|
|
||||||
get_target_property(compile_definitions ${ITEM} INTERFACE_COMPILE_DEFINITIONS)
|
|
||||||
if (compile_definitions)
|
|
||||||
target_compile_definitions(${TARGET_NAME} ${LINK_TYPE} ${compile_definitions})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
target_link_libraries(${TARGET_NAME} ${LINK_TYPE} ${ARGN})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# include directories as SYSTEM
|
# include directories as SYSTEM
|
||||||
foreach(library IN LISTS ARGN)
|
foreach(library IN LISTS ARGN)
|
||||||
@ -92,8 +75,11 @@ function(set_ie_threading_interface_for TARGET_NAME)
|
|||||||
get_target_property(include_directories ${library} INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(include_directories ${library} INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
if(include_directories)
|
if(include_directories)
|
||||||
foreach(include_directory IN LISTS include_directories)
|
foreach(include_directory IN LISTS include_directories)
|
||||||
|
# cannot include /usr/include headers as SYSTEM
|
||||||
|
if(NOT "${include_directory}" MATCHES "^/usr.*$")
|
||||||
target_include_directories(${TARGET_NAME} SYSTEM BEFORE
|
target_include_directories(${TARGET_NAME} SYSTEM BEFORE
|
||||||
${LINK_TYPE} $<BUILD_INTERFACE:${include_directory}>)
|
${LINK_TYPE} $<BUILD_INTERFACE:${include_directory}>)
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -108,7 +94,7 @@ function(set_ie_threading_interface_for TARGET_NAME)
|
|||||||
ie_target_link_libraries(${TARGET_NAME} ${LINK_TYPE} ${TBB_IMPORTED_TARGETS})
|
ie_target_link_libraries(${TARGET_NAME} ${LINK_TYPE} ${TBB_IMPORTED_TARGETS})
|
||||||
else ()
|
else ()
|
||||||
set(THREADING "SEQ" PARENT_SCOPE)
|
set(THREADING "SEQ" PARENT_SCOPE)
|
||||||
ext_message(WARNING "TBB was not found by the configured TBB_DIR path.\
|
message(WARNING "TBB was not found by the configured TBB_DIR path.\
|
||||||
SEQ method will be used for ${TARGET_NAME}")
|
SEQ method will be used for ${TARGET_NAME}")
|
||||||
endif ()
|
endif ()
|
||||||
elseif (THREADING STREQUAL "OMP")
|
elseif (THREADING STREQUAL "OMP")
|
||||||
@ -133,19 +119,19 @@ function(set_ie_threading_interface_for TARGET_NAME)
|
|||||||
|
|
||||||
if (NOT OMP_LIBRARIES_RELEASE)
|
if (NOT OMP_LIBRARIES_RELEASE)
|
||||||
find_library(OMP_LIBRARIES_RELEASE ${omp_lib_name} ${lib_rel_path} NO_DEFAULT_PATH)
|
find_library(OMP_LIBRARIES_RELEASE ${omp_lib_name} ${lib_rel_path} NO_DEFAULT_PATH)
|
||||||
ext_message(STATUS "OMP Release lib: ${OMP_LIBRARIES_RELEASE}")
|
message(STATUS "OMP Release lib: ${OMP_LIBRARIES_RELEASE}")
|
||||||
if (NOT LINUX)
|
if (NOT LINUX)
|
||||||
find_library(OMP_LIBRARIES_DEBUG ${omp_lib_name} ${lib_dbg_path} NO_DEFAULT_PATH)
|
find_library(OMP_LIBRARIES_DEBUG ${omp_lib_name} ${lib_dbg_path} NO_DEFAULT_PATH)
|
||||||
if (OMP_LIBRARIES_DEBUG)
|
if (OMP_LIBRARIES_DEBUG)
|
||||||
ext_message(STATUS "OMP Debug lib: ${OMP_LIBRARIES_DEBUG}")
|
message(STATUS "OMP Debug lib: ${OMP_LIBRARIES_DEBUG}")
|
||||||
else ()
|
else ()
|
||||||
ext_message(WARNING "OMP Debug binaries are missed.")
|
message(WARNING "OMP Debug binaries are missed.")
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT OMP_LIBRARIES_RELEASE)
|
if (NOT OMP_LIBRARIES_RELEASE)
|
||||||
ext_message(WARNING "Intel OpenMP not found. Intel OpenMP support will be disabled. ${IE_THREAD_DEFINE} is defined")
|
message(WARNING "Intel OpenMP not found. Intel OpenMP support will be disabled. ${IE_THREAD_DEFINE} is defined")
|
||||||
set(THREADING "SEQ" PARENT_SCOPE)
|
set(THREADING "SEQ" PARENT_SCOPE)
|
||||||
else ()
|
else ()
|
||||||
set(IE_THREAD_DEFINE "IE_THREAD_OMP")
|
set(IE_THREAD_DEFINE "IE_THREAD_OMP")
|
||||||
@ -174,7 +160,6 @@ function(set_ie_threading_interface_for TARGET_NAME)
|
|||||||
ie_target_link_libraries(${TARGET_NAME} ${LINK_TYPE} ${OMP_LIBRARIES_RELEASE})
|
ie_target_link_libraries(${TARGET_NAME} ${LINK_TYPE} ${OMP_LIBRARIES_RELEASE})
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_compile_definitions(${TARGET_NAME} ${LINK_TYPE} -DIE_THREAD=${IE_THREAD_DEFINE})
|
target_compile_definitions(${TARGET_NAME} ${LINK_TYPE} -DIE_THREAD=${IE_THREAD_DEFINE})
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
|
include(cmake/ie_parallel.cmake)
|
||||||
|
|
||||||
|
# pre-find TBB: need to provide TBB_IMPORTED_TARGETS used for installation
|
||||||
|
ov_find_tbb()
|
||||||
|
|
||||||
if(ENABLE_TBBBIND_2_5)
|
if(ENABLE_TBBBIND_2_5)
|
||||||
# try to find prebuilt version of tbbbind_2_5
|
# try to find prebuilt version of tbbbind_2_5
|
||||||
find_package(TBBBIND_2_5 QUIET)
|
find_package(TBBBIND_2_5 QUIET)
|
||||||
@ -12,6 +17,8 @@ if(ENABLE_TBBBIND_2_5)
|
|||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
set(install_tbbbind ON)
|
set(install_tbbbind ON)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
message(WARNING "Static tbbbind_2_5 package is not found")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -28,22 +35,69 @@ if(install_tbbbind)
|
|||||||
list(APPEND PATH_VARS "IE_TBBBIND_DIR")
|
list(APPEND PATH_VARS "IE_TBBBIND_DIR")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# install only downloaded TBB, system one is not installed
|
# install only downloaded | custom TBB, system one is not installed
|
||||||
if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND TBBROOT MATCHES ${TEMP})
|
# - downloaded TBB should be a part of all packages
|
||||||
|
# - custom TBB provided by users, needs to be a part of wheel packages
|
||||||
|
# - TODO: system TBB also needs to be a part of wheel packages
|
||||||
|
if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND
|
||||||
|
(TBB MATCHES ${TEMP} OR DEFINED ENV{TBBROOT} OR ENABLE_SYSTEM_TBB))
|
||||||
ie_cpack_add_component(tbb REQUIRED)
|
ie_cpack_add_component(tbb REQUIRED)
|
||||||
ie_cpack_add_component(tbb_dev REQUIRED)
|
|
||||||
list(APPEND core_components tbb)
|
list(APPEND core_components tbb)
|
||||||
list(APPEND core_dev_components tbb_dev)
|
|
||||||
|
|
||||||
install(DIRECTORY "${TBB}/lib"
|
if(TBB MATCHES ${TEMP})
|
||||||
DESTINATION runtime/3rdparty/tbb
|
set(tbb_downloaded ON)
|
||||||
COMPONENT tbb)
|
elseif(DEFINED ENV{TBB})
|
||||||
# Windows only
|
set(tbb_custom ON)
|
||||||
if(EXISTS "${TBB}/bin")
|
endif()
|
||||||
|
|
||||||
|
if(tbb_custom OR ENABLE_SYSTEM_TBB)
|
||||||
|
# since the setup.py for pip installs tbb component
|
||||||
|
# explicitly, it's OK to put EXCLUDE_FROM_ALL to such component
|
||||||
|
# to ignore from IRC distribution
|
||||||
|
set(exclude_from_all EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_SYSTEM_TBB)
|
||||||
|
# need to take locations of actual libraries and install them
|
||||||
|
foreach(tbb_lib IN LISTS TBB_IMPORTED_TARGETS)
|
||||||
|
get_target_property(tbb_loc ${tbb_lib} IMPORTED_LOCATION_RELEASE)
|
||||||
|
# depending on the TBB, tbb_loc can be in form:
|
||||||
|
# - libtbb.so.x.y
|
||||||
|
# - libtbb.so.x
|
||||||
|
# - libtbb.so
|
||||||
|
# We need to install such files
|
||||||
|
get_filename_component(name_we "${tbb_loc}" NAME_WE)
|
||||||
|
get_filename_component(dir "${tbb_loc}" DIRECTORY)
|
||||||
|
file(GLOB tbb_files "${dir}/${name_we}.*")
|
||||||
|
foreach(tbb_file IN LISTS tbb_files)
|
||||||
|
if(tbb_file MATCHES "^.*\.${CMAKE_SHARED_LIBRARY_SUFFIX}(\.[0-9]+)*$")
|
||||||
|
install(FILES "${tbb_file}"
|
||||||
|
DESTINATION runtime/3rdparty/tbb/lib
|
||||||
|
COMPONENT tbb ${exclude_from_all})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
else()
|
||||||
|
if(WIN32)
|
||||||
install(DIRECTORY "${TBB}/bin"
|
install(DIRECTORY "${TBB}/bin"
|
||||||
DESTINATION runtime/3rdparty/tbb
|
DESTINATION runtime/3rdparty/tbb
|
||||||
COMPONENT tbb)
|
COMPONENT tbb ${exclude_from_all})
|
||||||
|
elseif(tbb_custom OR tbb_downloaded)
|
||||||
|
install(DIRECTORY "${TBB}/lib"
|
||||||
|
DESTINATION runtime/3rdparty/tbb
|
||||||
|
COMPONENT tbb ${exclude_from_all}
|
||||||
|
FILES_MATCHING
|
||||||
|
# install only versioned shared libraries
|
||||||
|
REGEX "^.*\.${CMAKE_SHARED_LIBRARY_SUFFIX}(\.[0-9]+)*$")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# development files are needed only for 'tbb_downloaded' case
|
||||||
|
# which we are going to distribute
|
||||||
|
if(tbb_downloaded)
|
||||||
|
ie_cpack_add_component(tbb_dev REQUIRED)
|
||||||
|
list(APPEND core_dev_components tbb_dev)
|
||||||
|
|
||||||
install(FILES "${TBB}/LICENSE"
|
install(FILES "${TBB}/LICENSE"
|
||||||
DESTINATION runtime/3rdparty/tbb
|
DESTINATION runtime/3rdparty/tbb
|
||||||
COMPONENT tbb)
|
COMPONENT tbb)
|
||||||
@ -56,6 +110,18 @@ if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND TBBROOT MATCHES ${TEMP})
|
|||||||
install(DIRECTORY "${TBB}/include"
|
install(DIRECTORY "${TBB}/include"
|
||||||
DESTINATION runtime/3rdparty/tbb
|
DESTINATION runtime/3rdparty/tbb
|
||||||
COMPONENT tbb_dev)
|
COMPONENT tbb_dev)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
# .lib files are needed only for Windows
|
||||||
|
install(DIRECTORY "${TBB}/lib"
|
||||||
|
DESTINATION runtime/3rdparty/tbb
|
||||||
|
COMPONENT tbb)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
unset(tbb_downloaded)
|
||||||
|
unset(tbb_custom)
|
||||||
|
unset(exclude_from_all)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# install tbbbind for static OpenVINO case
|
# install tbbbind for static OpenVINO case
|
||||||
|
@ -421,7 +421,7 @@ set(SRC
|
|||||||
|
|
||||||
# For type relaxed types
|
# For type relaxed types
|
||||||
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/threading.cpp
|
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/threading.cpp
|
||||||
PROPERTIES INCLUDE_DIRECTORIES $<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>)
|
PROPERTIES INCLUDE_DIRECTORIES $<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||||
|
|
||||||
if(SUGGEST_OVERRIDE_SUPPORTED)
|
if(SUGGEST_OVERRIDE_SUPPORTED)
|
||||||
set_source_files_properties(ov_tensor_test.cpp
|
set_source_files_properties(ov_tensor_test.cpp
|
||||||
|
@ -123,19 +123,24 @@ ie_faster_build(${TARGET_NAME}_obj
|
|||||||
UNITY PCH PRIVATE "src/precomp.hpp"
|
UNITY PCH PRIVATE "src/precomp.hpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(${TARGET_NAME}_obj PRIVATE IMPLEMENT_INFERENCE_ENGINE_API
|
target_compile_definitions(${TARGET_NAME}_obj PRIVATE
|
||||||
|
IMPLEMENT_INFERENCE_ENGINE_API
|
||||||
$<TARGET_PROPERTY:ngraph,INTERFACE_COMPILE_DEFINITIONS>
|
$<TARGET_PROPERTY:ngraph,INTERFACE_COMPILE_DEFINITIONS>
|
||||||
$<TARGET_PROPERTY:frontend_common::static,INTERFACE_COMPILE_DEFINITIONS>
|
$<TARGET_PROPERTY:frontend_common::static,INTERFACE_COMPILE_DEFINITIONS>
|
||||||
$<TARGET_PROPERTY:openvino_gapi_preproc,INTERFACE_COMPILE_DEFINITIONS>)
|
$<TARGET_PROPERTY:openvino_gapi_preproc,INTERFACE_COMPILE_DEFINITIONS>)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME}_obj SYSTEM PRIVATE $<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>
|
target_include_directories(${TARGET_NAME}_obj SYSTEM PRIVATE
|
||||||
|
$<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:pugixml::static,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:pugixml::static,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:frontend_common::static,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:frontend_common::static,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:xbyak,INTERFACE_INCLUDE_DIRECTORIES>)
|
$<TARGET_PROPERTY:xbyak,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME}_obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src"
|
target_include_directories(${TARGET_NAME}_obj PRIVATE
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}" # for static ie_plugins.hpp
|
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||||
$<$<TARGET_EXISTS:inference_engine_ir_v7_reader>:$<TARGET_PROPERTY:inference_engine_ir_v7_reader,SOURCE_DIR>> # for ie_ir_version.hpp
|
# for static ie_plugins.hpp
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
# for ie_ir_version.hpp
|
||||||
|
$<$<TARGET_EXISTS:inference_engine_ir_v7_reader>:$<TARGET_PROPERTY:inference_engine_ir_v7_reader,SOURCE_DIR>>
|
||||||
$<TARGET_PROPERTY:${TARGET_NAME}_legacy,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:${TARGET_NAME}_legacy,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:${TARGET_NAME}_transformations,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:${TARGET_NAME}_transformations,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:${TARGET_NAME}_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>)
|
$<TARGET_PROPERTY:${TARGET_NAME}_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||||
|
@ -70,12 +70,15 @@ if(BUILD_SHARED_LIBS)
|
|||||||
add_library(${TARGET_NAME}_obj OBJECT ${SOURCES} ${HEADERS})
|
add_library(${TARGET_NAME}_obj OBJECT ${SOURCES} ${HEADERS})
|
||||||
link_system_libraries(${TARGET_NAME}_obj PUBLIC mkldnn)
|
link_system_libraries(${TARGET_NAME}_obj PUBLIC mkldnn)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME}_obj PRIVATE $<TARGET_PROPERTY:openvino_gapi_preproc_s,INTERFACE_INCLUDE_DIRECTORIES>
|
target_include_directories(${TARGET_NAME}_obj
|
||||||
|
PRIVATE
|
||||||
|
$<TARGET_PROPERTY:openvino_gapi_preproc_s,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:openvino::itt,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:openvino::itt,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:ov_shape_inference,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:ov_shape_inference,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
$<TARGET_PROPERTY:inference_engine_snippets,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:inference_engine_snippets,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
|
PUBLIC
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
$<TARGET_PROPERTY:openvino::conditional_compilation,INTERFACE_INCLUDE_DIRECTORIES>)
|
$<TARGET_PROPERTY:openvino::conditional_compilation,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME}_obj SYSTEM PUBLIC $<TARGET_PROPERTY:mkldnn,INCLUDE_DIRECTORIES>)
|
target_include_directories(${TARGET_NAME}_obj SYSTEM PUBLIC $<TARGET_PROPERTY:mkldnn,INCLUDE_DIRECTORIES>)
|
||||||
@ -85,8 +88,7 @@ if(BUILD_SHARED_LIBS)
|
|||||||
target_compile_definitions(${TARGET_NAME}_obj PRIVATE
|
target_compile_definitions(${TARGET_NAME}_obj PRIVATE
|
||||||
USE_STATIC_IE IMPLEMENT_INFERENCE_ENGINE_PLUGIN IMPLEMENT_INFERENCE_EXTENSION_API
|
USE_STATIC_IE IMPLEMENT_INFERENCE_ENGINE_PLUGIN IMPLEMENT_INFERENCE_EXTENSION_API
|
||||||
$<TARGET_PROPERTY:ngraph,INTERFACE_COMPILE_DEFINITIONS>
|
$<TARGET_PROPERTY:ngraph,INTERFACE_COMPILE_DEFINITIONS>
|
||||||
$<TARGET_PROPERTY:inference_engine_plugin_api,INTERFACE_COMPILE_DEFINITIONS>
|
$<TARGET_PROPERTY:inference_engine_plugin_api,INTERFACE_COMPILE_DEFINITIONS>)
|
||||||
)
|
|
||||||
|
|
||||||
set_target_properties(${TARGET_NAME}_obj PROPERTIES EXCLUDE_FROM_ALL ON)
|
set_target_properties(${TARGET_NAME}_obj PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||||
|
|
||||||
|
@ -23,12 +23,13 @@ function(ie_add_mkldnn)
|
|||||||
set(DNNL_ENABLE_CONCURRENT_EXEC ON CACHE BOOL "" FORCE)
|
set(DNNL_ENABLE_CONCURRENT_EXEC ON CACHE BOOL "" FORCE)
|
||||||
set(DNNL_ENABLE_PRIMITIVE_CACHE OFF CACHE BOOL "" FORCE) ## TODO: try it later
|
set(DNNL_ENABLE_PRIMITIVE_CACHE OFF CACHE BOOL "" FORCE) ## TODO: try it later
|
||||||
set(DNNL_ENABLE_MAX_CPU_ISA ON CACHE BOOL "" FORCE)
|
set(DNNL_ENABLE_MAX_CPU_ISA ON CACHE BOOL "" FORCE)
|
||||||
set(DNNL_LIBRARY_TYPE STATIC CACHE BOOL "" FORCE)
|
set(DNNL_LIBRARY_TYPE "STATIC" CACHE STRING "" FORCE)
|
||||||
set(DNNL_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
set(DNNL_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
set(DNNL_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
set(DNNL_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
set(DNNL_CPU_RUNTIME "${THREADING}" CACHE STRING "" FORCE)
|
set(DNNL_CPU_RUNTIME "${THREADING}" CACHE STRING "" FORCE)
|
||||||
set(DNNL_GPU_RUNTIME "NONE" CACHE STRING "" FORCE)
|
set(DNNL_GPU_RUNTIME "NONE" CACHE STRING "" FORCE)
|
||||||
set(DNNL_BLAS_VENDOR "NONE" CACHE STRING "" FORCE)
|
set(DNNL_BLAS_VENDOR "NONE" CACHE STRING "" FORCE)
|
||||||
|
set(DNNL_VERBOSE "OFF" CACHE STRING "" FORCE)
|
||||||
set(SDL_cmake_included ON) ## to skip internal SDL flags. SDL flags are already set on IE level
|
set(SDL_cmake_included ON) ## to skip internal SDL flags. SDL flags are already set on IE level
|
||||||
if (ANDROID OR ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND NOT (THREADING STREQUAL "OMP")))
|
if (ANDROID OR ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND NOT (THREADING STREQUAL "OMP")))
|
||||||
set(OpenMP_cmake_included ON) ## to skip "omp simd" inside a code. Lead to some crashes inside NDK LLVM..
|
set(OpenMP_cmake_included ON) ## to skip "omp simd" inside a code. Lead to some crashes inside NDK LLVM..
|
||||||
|
@ -79,7 +79,7 @@ foreach(gna_lib IN LISTS gna_libraries)
|
|||||||
# and don't install global symlink libgna.so. Exceptions:
|
# and don't install global symlink libgna.so. Exceptions:
|
||||||
# 1. On Windows we don't have libraries versioning and need to install all .dlls
|
# 1. On Windows we don't have libraries versioning and need to install all .dlls
|
||||||
# 2. For case of static libraries we also need to install .so since it's required for linkage with final application
|
# 2. For case of static libraries we also need to install .so since it's required for linkage with final application
|
||||||
if(gna_lib MATCHES "^.*${CMAKE_SHARED_LIBRARY_SUFFIX}(\.[0-9]+)+$" OR
|
if(gna_lib MATCHES "^.*\.${CMAKE_SHARED_LIBRARY_SUFFIX}(\.[0-9]+)+$" OR
|
||||||
WIN32 OR NOT BUILD_SHARED_LIBS)
|
WIN32 OR NOT BUILD_SHARED_LIBS)
|
||||||
install(FILES ${gna_lib}
|
install(FILES ${gna_lib}
|
||||||
DESTINATION ${IE_CPACK_RUNTIME_PATH}
|
DESTINATION ${IE_CPACK_RUNTIME_PATH}
|
||||||
|
@ -282,7 +282,13 @@ ie_headers_compilation_with_custom_flags(TEST_SUFFIX PluginApiCxx17
|
|||||||
CXX_STANDARD 17 PLUGIN_API)
|
CXX_STANDARD 17 PLUGIN_API)
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
|
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
|
||||||
|
if(TBB_VERSION VERSION_EQUAL 2021.2)
|
||||||
|
# TBB 2021.2 has a bug in headers with CXX_STANDARD 20
|
||||||
|
# see https://github.com/oneapi-src/oneTBB/issues/379
|
||||||
|
set(skip_headers_list HEADERS_TO_SKIP "threading/ie_thread_local.hpp")
|
||||||
|
endif()
|
||||||
ie_headers_compilation_with_custom_flags(TEST_SUFFIX PluginApiCxx20
|
ie_headers_compilation_with_custom_flags(TEST_SUFFIX PluginApiCxx20
|
||||||
|
${skip_headers_list}
|
||||||
CXX_STANDARD 20 PLUGIN_API)
|
CXX_STANDARD 20 PLUGIN_API)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ file (GLOB HELPERS_INCLUDES
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
|
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
## Enable Models multiple search pathes
|
## Enable Models multiple search paths
|
||||||
message("configuring file: ${CMAKE_CURRENT_BINARY_DIR}/test_model_repo.h")
|
message("configuring file: ${CMAKE_CURRENT_BINARY_DIR}/test_model_repo.h")
|
||||||
|
|
||||||
function(add_helpers target_name)
|
function(add_helpers target_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user