From e39764d5646cef05a2ed05a91bc830cae267e14c Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 13 Sep 2023 20:01:59 +0800 Subject: [PATCH 1/4] Fixed GPU plugin static build with oneDNN --- cmake/developer_package/plugins/plugins.cmake | 4 ++ cmake/features.cmake | 2 +- cmake/templates/OpenVINOConfig.cmake.in | 60 +++++++++++++++---- src/cmake/openvino.cmake | 6 +- .../intel_cpu/thirdparty/CMakeLists.txt | 6 +- .../intel_gpu/thirdparty/CMakeLists.txt | 28 ++++++--- src/plugins/template/src/CMakeLists.txt | 4 +- 7 files changed, 83 insertions(+), 27 deletions(-) diff --git a/cmake/developer_package/plugins/plugins.cmake b/cmake/developer_package/plugins/plugins.cmake index 436685355a8125..ea187411d17476 100644 --- a/cmake/developer_package/plugins/plugins.cmake +++ b/cmake/developer_package/plugins/plugins.cmake @@ -117,6 +117,10 @@ function(ov_add_plugin) # install rules if(NOT OV_PLUGIN_SKIP_INSTALL OR NOT BUILD_SHARED_LIBS) string(TOLOWER "${OV_PLUGIN_DEVICE_NAME}" install_component) + if(NOT BUILD_SHARED_LIBS) + # in case of static libs everything is installed to 'core' + set(install_component ${OV_CPACK_COMP_CORE}) + endif() if(OV_PLUGIN_PSEUDO_DEVICE) set(plugin_hidden HIDDEN) diff --git a/cmake/features.cmake b/cmake/features.cmake index f842ba724f7a20..7b46e96ae3b0a6 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -23,7 +23,7 @@ endif() ie_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT APPLE;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF) -if (ANDROID OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) OR NOT BUILD_SHARED_LIBS) +if (ANDROID OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) OR (NOT BUILD_SHARED_LIBS AND ENABLE_INTEL_CPU)) # oneDNN doesn't support old compilers and android builds for now, so we'll build GPU plugin without oneDNN # also, in case of static build CPU's and GPU's oneDNNs will conflict, so we are disabling GPU's one in this case set(ENABLE_ONEDNN_FOR_GPU_DEFAULT OFF) diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in index 9eb1cfdd35837b..b344b02e7b2834 100644 --- a/cmake/templates/OpenVINOConfig.cmake.in +++ b/cmake/templates/OpenVINOConfig.cmake.in @@ -223,6 +223,10 @@ macro(_ov_find_tbb) PATHS ${_tbb_bind_dir} NO_CMAKE_FIND_ROOT_PATH NO_DEFAULT_PATH) + if(TARGET TBBbind::tbbbind_2_5) + # To solve https://cmake.org/cmake/help/latest/policy/CMP0111.html warnings + set_property(TARGET TBBbind::tbbbind_2_5 PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG) + endif() unset(_tbb_bind_dir) endif() unset(install_tbbbind) @@ -343,11 +347,12 @@ endmacro() macro(_ov_find_intel_cpu_dependencies) set(_OV_ENABLE_CPU_ACL "@DNNL_USE_ACL@") if(_OV_ENABLE_CPU_ACL) - set(_ov_in_install_tree "@PACKAGE_ARM_COMPUTE_LIB_DIR@") + set(_ov_in_install_tree "@PACKAGE_OPENVINO_LIB_DIR@") if(_ov_in_install_tree) - set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_ARM_COMPUTE_LIB_DIR@") + set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_OPENVINO_LIB_DIR@") set(ACL_DIR "${CMAKE_CURRENT_LIST_DIR}") else() + set_and_check(ARM_COMPUTE_LIB_DIR "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@") set_and_check(ACL_DIR "@PACKAGE_FIND_ACL_PATH@") endif() @@ -363,16 +368,50 @@ macro(_ov_find_intel_gpu_dependencies) set(_OV_ENABLE_INTEL_GPU "@ENABLE_INTEL_GPU@") set(_OV_ENABLE_SYSTEM_OPENCL "@ENABLE_SYSTEM_OPENCL@") if(_OV_ENABLE_INTEL_GPU AND _OV_ENABLE_SYSTEM_OPENCL) - set(_OV_OpenCLICDLoader_FOUND "@OpenCLICDLoader_FOUND@") - if(_OV_OpenCLICDLoader_FOUND) - _ov_find_dependency(OpenCLICDLoader) - else() - _ov_find_dependency(OpenCL) - endif() - unset(_OV_OpenCLICDLoader_FOUND) + _ov_find_dependency(OpenCL) endif() unset(_OV_ENABLE_INTEL_GPU) unset(_OV_ENABLE_SYSTEM_OPENCL) + + set(_OV_ENABLE_ONEDNN_FOR_GPU "@ENABLE_ONEDNN_FOR_GPU@") + if(_OV_ENABLE_ONEDNN_FOR_GPU AND NOT TARGET onednn_gpu_tgt) + set(_OV_DNNL_GPU_LIBRARY_NAME "@DNNL_GPU_LIBRARY_NAME@") + + set(_ov_in_install_tree "@PACKAGE_OPENVINO_LIB_DIR@") + if(_ov_in_install_tree) + set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${_OV_DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set_and_check(onednn_gpu_lib_root "@PACKAGE_OPENVINO_LIB_DIR@") + if(WIN32) + if(OV_GENERATOR_MULTI_CONFIG) + set(extra_args PATH_SUFFIXES ${CMAKE_CONFIGURATION_TYPES}) + else() + set(extra_args PATH_SUFFIXES ${CMAKE_BUILD_TYPE}) + endif() + endif() + + find_library(onednn_gpu_lib_path + NAMES ${_OV_DNNL_GPU_LIBRARY_NAME} + PATHS ${onednn_gpu_lib_root} + ${extra_args}) + + if(NOT onednn_gpu_lib_path) + message(FATAL_ERROR "Internal error: failed to find '${_OV_DNNL_GPU_LIBRARY_NAME}' in '${onednn_gpu_lib_root}'") + endif() + + unset(extra_args) + unset(onednn_gpu_lib) + else() + set(onednn_gpu_lib_path "@ONEDNN_GPU_LIB_PATH@") + endif() + + set_target_properties(openvino::onednn_gpu_tgt PROPERTIES + INTERFACE_LINK_LIBRARIES "${onednn_gpu_lib_path}") + + unset(onednn_gpu_lib_path) + unset(_ov_in_install_tree) + unset(_OV_DNNL_GPU_LIBRARY_NAME) + endif() + unset(_OV_ENABLE_ONEDNN_FOR_GPU) endmacro() macro(_ov_find_intel_gna_dependencies) @@ -455,6 +494,7 @@ set(_OV_ENABLE_OPENVINO_BUILD_SHARED "@BUILD_SHARED_LIBS@") if(NOT TARGET openvino) set(_ov_as_external_package ON) + include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake") endif() if(NOT _OV_ENABLE_OPENVINO_BUILD_SHARED) @@ -487,8 +527,6 @@ set(_ov_imported_libs openvino::runtime openvino::runtime::c openvino::frontend::pytorch openvino::frontend::tensorflow_lite) if(_ov_as_external_package) - include("${CMAKE_CURRENT_LIST_DIR}/OpenVINOTargets.cmake") - foreach(target IN LISTS _ov_imported_libs) if(TARGET ${target}) get_target_property(imported_configs ${target} IMPORTED_CONFIGURATIONS) diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake index 685a5e50051b3c..db48ff69c68a78 100644 --- a/src/cmake/openvino.cmake +++ b/src/cmake/openvino.cmake @@ -177,11 +177,11 @@ configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINOCo # install tree -if(DNNL_USE_ACL) - list(APPEND INSTALL_PATH_VARS "ARM_COMPUTE_LIB_DIR") +if(DNNL_USE_ACL OR ENABLE_ONEDNN_FOR_GPU) + list(APPEND INSTALL_PATH_VARS "OPENVINO_LIB_DIR") # remove generator expression at the end, because searching in Release / Debug will be # done by ACLConfig.cmake itself - string(REPLACE "$" "" ARM_COMPUTE_LIB_DIR "${OV_CPACK_LIBRARYDIR}") + string(REPLACE "$" "" OPENVINO_LIB_DIR "${OV_CPACK_LIBRARYDIR}") endif() set(IE_INCLUDE_DIR "${OV_CPACK_INCLUDEDIR}/ie") diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt index 98935a0792cc01..5e77bdd973e58e 100644 --- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt @@ -117,7 +117,7 @@ function(ov_add_onednn) add_subdirectory(onednn EXCLUDE_FROM_ALL) # install static libraries - ov_install_static_lib(dnnl cpu) + ov_install_static_lib(dnnl ${OV_CPACK_COMP_CORE}) if(DNNL_USE_ACL AND NOT BUILD_SHARED_LIBS) # use ACLConfig.cmake in OpenVINOConfig.cmake in case of static build @@ -125,10 +125,10 @@ function(ov_add_onednn) # but for this we need to install library files install(FILES $ DESTINATION ${OV_CPACK_ARCHIVEDIR} - COMPONENT cpu) + COMPONENT ${OV_CPACK_COMP_CORE}) install(FILES "${intel_cpu_thirdparty_SOURCE_DIR}/ACLConfig.cmake" DESTINATION ${OV_CPACK_OPENVINO_CMAKEDIR} - COMPONENT core_dev) + COMPONENT ${OV_CPACK_COMP_CORE_DEV}) endif() endfunction() diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt index 3fd37615fd1e66..46bdec4b1816df 100644 --- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt @@ -9,11 +9,12 @@ if(ENABLE_ONEDNN_FOR_GPU) function(build_onednn_gpu) include(ExternalProject) - set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build/") - set(ONEDNN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_install/") + set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build") + set(ONEDNN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_install" CACHE PATH "Installation path for oneDNN GPU library") set(ONEDNN_PREFIX_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_root") set(ONEDNN_ENABLED_PRIMITIVES "CONCAT;CONVOLUTION;DECONVOLUTION;INNER_PRODUCT;MATMUL;REORDER;POOLING;REDUCTION") set(ONEDNN_ENABLED_ISA "XEHP;XEHPG;XEHPC") + set(DNNL_GPU_LIBRARY_NAME "openvino_onednn_gpu" CACHE STRING "Name of oneDNN library for Intel GPU Plugin") if(X86_64) set(ONEDNN_TARGET_ARCH "X64" CACHE STRING "" FORCE) @@ -99,7 +100,7 @@ if(ENABLE_ONEDNN_FOR_GPU) "-DDNNL_TARGET_ARCH=${ONEDNN_TARGET_ARCH}" "-DDNNL_CPU_RUNTIME=NONE" "-DDNNL_GPU_RUNTIME=OCL" - "-DDNNL_LIBRARY_NAME=openvino_onednn_gpu" + "-DDNNL_LIBRARY_NAME=${DNNL_GPU_LIBRARY_NAME}" "-DCMAKE_INSTALL_PREFIX=${ONEDNN_INSTALL_DIR}" "-DDNNL_ENABLE_CONCURRENT_EXEC=ON" "-DDNNL_ENABLE_PRIMITIVE_CACHE=OFF" @@ -127,15 +128,28 @@ if(ENABLE_ONEDNN_FOR_GPU) # Target Options: EXCLUDE_FROM_ALL ON ) + add_library(onednn_gpu_tgt INTERFACE) + + set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(ONEDNN_GPU_LIB_PATH ${ONEDNN_INSTALL_DIR}/lib/${onednn_gpu_lib} CACHE FILEPATH "Path to oneDNN GPU library") + set_target_properties(onednn_gpu_tgt PROPERTIES - INTERFACE_LINK_DIRECTORIES "${ONEDNN_INSTALL_DIR}/lib" - INTERFACE_LINK_LIBRARIES "openvino_onednn_gpu" - INTERFACE_INCLUDE_DIRECTORIES "${ONEDNN_INSTALL_DIR}/include" + INTERFACE_LINK_LIBRARIES $ + INTERFACE_INCLUDE_DIRECTORIES $ INTERFACE_COMPILE_DEFINITIONS ENABLE_ONEDNN_FOR_GPU ) add_dependencies(onednn_gpu_tgt onednn_gpu_build) - # TODO: install onednn_gpu in static builds + + if(NOT BUILD_SHARED_LIBS) + ov_install_static_lib(onednn_gpu_tgt ${OV_CPACK_COMP_CORE}) + + # we need to install library explicitly and set_target_properties in OpenVINOConfig.cmake for 'onednn_gpu_tgt' + # to point to installation location of this file + install(FILES "${ONEDNN_GPU_LIB_PATH}" + DESTINATION ${OV_CPACK_ARCHIVEDIR} + COMPONENT ${OV_CPACK_COMP_CORE}) + endif() endfunction() build_onednn_gpu() endif() diff --git a/src/plugins/template/src/CMakeLists.txt b/src/plugins/template/src/CMakeLists.txt index 2409bb10e0c152..f382f90d11b450 100644 --- a/src/plugins/template/src/CMakeLists.txt +++ b/src/plugins/template/src/CMakeLists.txt @@ -28,7 +28,7 @@ target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${TEMPLATE_PLUGIN_SOURCE_DIR}/include") -# link common Inference Engine libraries +# link common OpenVINO Runtime libraries target_link_libraries(${TARGET_NAME} PRIVATE openvino::interpreter_backend openvino::reference) @@ -42,4 +42,4 @@ endif() # [cmake:plugin] install(TARGETS ${TARGET_NAME} - LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) + LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) From 753d23986c7ee979760969635357448eefa5b4fd Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 16 Sep 2023 14:18:59 +0400 Subject: [PATCH 2/4] Fixed issue with absolute paths inside installed OpenVINOConfig.cmake --- cmake/templates/OpenVINOConfig.cmake.in | 6 ++++-- src/cmake/openvino.cmake | 12 +++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in index 32faf3df600393..61cd58f5b209d7 100644 --- a/cmake/templates/OpenVINOConfig.cmake.in +++ b/cmake/templates/OpenVINOConfig.cmake.in @@ -352,8 +352,10 @@ macro(_ov_find_intel_cpu_dependencies) set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_OPENVINO_LIB_DIR@") set(ACL_DIR "${CMAKE_CURRENT_LIST_DIR}") else() - # we are not using 'set_and_check' below, because the directory has not been created yet - set(ARM_COMPUTE_LIB_DIR "@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@") + if(NOT TARGET arm_compute::arm_compute) + # for case when build tree is used separately, e.g. OpenVINODeveloperPackageConfig.cmake + set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_CMAKE_ARCHIVE_OUTPUT_DIRECTORY@") + endif() set_and_check(ACL_DIR "@PACKAGE_FIND_ACL_PATH@") endif() diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake index 58e78d9900a1dc..c00c0d666ec9c3 100644 --- a/src/cmake/openvino.cmake +++ b/src/cmake/openvino.cmake @@ -157,7 +157,7 @@ if(ENABLE_INTEL_GNA) list(APPEND PATH_VARS "GNA_PATH") endif() if(DNNL_USE_ACL) - list(APPEND BUILD_PATH_VARS "FIND_ACL_PATH") + list(APPEND BUILD_PATH_VARS "FIND_ACL_PATH;CMAKE_ARCHIVE_OUTPUT_DIRECTORY") set(FIND_ACL_PATH "${intel_cpu_thirdparty_SOURCE_DIR}") endif() @@ -177,12 +177,10 @@ configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINOCo # install tree -if(DNNL_USE_ACL OR ENABLE_ONEDNN_FOR_GPU) - list(APPEND INSTALL_PATH_VARS "OPENVINO_LIB_DIR") - # remove generator expression at the end, because searching in Release / Debug will be - # done by ACLConfig.cmake itself - string(REPLACE "$" "" OPENVINO_LIB_DIR "${OV_CPACK_LIBRARYDIR}") -endif() +list(APPEND INSTALL_PATH_VARS "OPENVINO_LIB_DIR") +# remove generator expression at the end, because searching in Release / Debug +# will be done by inside OpenVINOConfig.cmak / ACLConfig.cmake +string(REPLACE "$" "" OPENVINO_LIB_DIR "${OV_CPACK_LIBRARYDIR}") set(IE_INCLUDE_DIR "${OV_CPACK_INCLUDEDIR}/ie") set(IE_TBB_DIR "${IE_TBB_DIR_INSTALL}") From 779d30c0c79290d6effdc80cbe9af0be1bd08469 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 16 Sep 2023 19:36:18 +0800 Subject: [PATCH 3/4] Fixed absolute paths in installed OpenVINOConfig.cmake --- cmake/templates/OpenVINOConfig.cmake.in | 2 +- src/cmake/openvino.cmake | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in index 61cd58f5b209d7..7dda80d8a312fd 100644 --- a/cmake/templates/OpenVINOConfig.cmake.in +++ b/cmake/templates/OpenVINOConfig.cmake.in @@ -404,7 +404,7 @@ macro(_ov_find_intel_gpu_dependencies) unset(extra_args) unset(onednn_gpu_lib) else() - set(onednn_gpu_lib_path "@ONEDNN_GPU_LIB_PATH@") + set_and_check(onednn_gpu_lib_path "@PACKAGE_ONEDNN_GPU_LIB_PATH@") endif() set_target_properties(openvino::onednn_gpu_tgt PROPERTIES diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake index c00c0d666ec9c3..302c263b024e7e 100644 --- a/src/cmake/openvino.cmake +++ b/src/cmake/openvino.cmake @@ -160,6 +160,9 @@ if(DNNL_USE_ACL) list(APPEND BUILD_PATH_VARS "FIND_ACL_PATH;CMAKE_ARCHIVE_OUTPUT_DIRECTORY") set(FIND_ACL_PATH "${intel_cpu_thirdparty_SOURCE_DIR}") endif() +if(ENABLE_ONEDNN_FOR_GPU) + list(APPEND BUILD_PATH_VARS "ONEDNN_GPU_LIB_PATH") +endif() set(PUBLIC_HEADERS_DIR "${OpenVINO_SOURCE_DIR}/src/inference/include") set(IE_INCLUDE_DIR "${PUBLIC_HEADERS_DIR}/ie") From e059a311302c43f74868d7a221a505b97c49e62d Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 17 Sep 2023 04:34:22 +0800 Subject: [PATCH 4/4] Changed components for installation --- src/plugins/intel_cpu/thirdparty/CMakeLists.txt | 2 +- src/plugins/intel_gpu/src/graph/CMakeLists.txt | 2 +- .../intel_gpu/src/kernel_selector/CMakeLists.txt | 14 +++++++++++--- src/plugins/intel_gpu/src/runtime/CMakeLists.txt | 2 +- src/plugins/template/backend/CMakeLists.txt | 2 +- thirdparty/ocl/CMakeLists.txt | 2 +- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt index 22f121f6ce4584..4c17e2e32373ec 100644 --- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt @@ -134,7 +134,7 @@ endfunction() if(ENABLE_MLAS_FOR_CPU) add_subdirectory(mlas) - ov_install_static_lib(mlas cpu) + ov_install_static_lib(mlas ${OV_CPACK_COMP_CORE}) endif() ov_add_onednn() diff --git a/src/plugins/intel_gpu/src/graph/CMakeLists.txt b/src/plugins/intel_gpu/src/graph/CMakeLists.txt index 3831742ace55f6..dd3ddb87d1016e 100644 --- a/src/plugins/intel_gpu/src/graph/CMakeLists.txt +++ b/src/plugins/intel_gpu/src/graph/CMakeLists.txt @@ -58,7 +58,7 @@ elseif((NOT ANDROID) AND (UNIX)) target_link_libraries(${TARGET_NAME} PRIVATE pthread) endif() -ov_install_static_lib(${TARGET_NAME} gpu) +ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) if(ENABLE_SSE42) ie_sse42_optimization_flags(sse4_2_flags) diff --git a/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt b/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt index 4e4aa260520a06..99ebf5331ab305 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt +++ b/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt @@ -91,8 +91,16 @@ add_custom_command( TARGET ${TARGET_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cache/cache.json ${TUNING_CACHE_PATH}/cache.json) +if(BUILD_SHARED_LIBS) + set(CACHE_JSON_INSTALL_DIR ${OV_CPACK_PLUGINSDIR}) + set(CACHE_JSON_COMPONENT gpu) +else() + set(CACHE_JSON_INSTALL_DIR ${OV_CPACK_ARCHIVEDIR}) + set(CACHE_JSON_COMPONENT ${OV_CPACK_COMP_CORE}) +endif() + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cache/cache.json - DESTINATION ${OV_CPACK_PLUGINSDIR} - COMPONENT gpu) + DESTINATION ${CACHE_JSON_INSTALL_DIR} + COMPONENT ${CACHE_JSON_COMPONENT}) -ov_install_static_lib(${TARGET_NAME} gpu) +ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) diff --git a/src/plugins/intel_gpu/src/runtime/CMakeLists.txt b/src/plugins/intel_gpu/src/runtime/CMakeLists.txt index 47c9139a4f9f8b..f1de561105c0ca 100644 --- a/src/plugins/intel_gpu/src/runtime/CMakeLists.txt +++ b/src/plugins/intel_gpu/src/runtime/CMakeLists.txt @@ -64,4 +64,4 @@ elseif((NOT ANDROID) AND (UNIX)) target_link_libraries(${TARGET_NAME} PRIVATE pthread) endif() -ov_install_static_lib(${TARGET_NAME} gpu) +ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) diff --git a/src/plugins/template/backend/CMakeLists.txt b/src/plugins/template/backend/CMakeLists.txt index 7b945216c95898..74e10c01863dfe 100644 --- a/src/plugins/template/backend/CMakeLists.txt +++ b/src/plugins/template/backend/CMakeLists.txt @@ -51,4 +51,4 @@ openvino_developer_export_targets(COMPONENT core TARGETS interpreter_backend) # install -ov_install_static_lib(interpreter_backend template) +ov_install_static_lib(interpreter_backend ${OV_CPACK_COMP_CORE}) diff --git a/thirdparty/ocl/CMakeLists.txt b/thirdparty/ocl/CMakeLists.txt index f31519467f3f64..0ebe3fd6d1df39 100644 --- a/thirdparty/ocl/CMakeLists.txt +++ b/thirdparty/ocl/CMakeLists.txt @@ -58,4 +58,4 @@ set(opencl_root_hints "${OpenCL_INCLUDE_DIR}" PARENT_SCOPE) # installation -ov_install_static_lib(OpenCL gpu) +ov_install_static_lib(OpenCL ${OV_CPACK_COMP_CORE})