From ed230cd87972184a8952ac79cab28dd85a66fab8 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 9 Sep 2023 01:52:58 +0400 Subject: [PATCH] Fixed build with oneDNN GPU in some Conan scenarios (#19711) --- CMakeLists.txt | 1 + src/plugins/intel_gpu/thirdparty/CMakeLists.txt | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 461f1a209cb..0b552b3da34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR}) message (STATUS "CPACK_GENERATOR ....................... " ${CPACK_GENERATOR}) message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID}) message (STATUS "CMAKE_CXX_COMPILER_ID ................. " ${CMAKE_CXX_COMPILER_ID}) +message (STATUS "CMAKE_CXX_STANDARD .................... " ${CMAKE_CXX_STANDARD}) if(OV_GENERATOR_MULTI_CONFIG) string(REPLACE ";" " " config_types "${CMAKE_CONFIGURATION_TYPES}") message (STATUS "CMAKE_CONFIGURATION_TYPES ............. " ${config_types}) diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt index c7c616d0df1..7a3132d8b10 100644 --- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt @@ -62,6 +62,9 @@ if(ENABLE_ONEDNN_FOR_GPU) list(APPEND cmake_extra_args "-DCMAKE_CONFIGURATION_TYPES=${CMAKE_DEFAULT_BUILD_TYPE}") list(APPEND cmake_extra_args "-DCMAKE_DEFAULT_BUILD_TYPE=${CMAKE_DEFAULT_BUILD_TYPE}") endif() + # sometimes $ is evaluated as real build type even for non-multi-config generators + # so, have to put under OV_GENERATOR_MULTI_CONFIG (example: docker pull conanio/gcc11-ubuntu16.04:latest) + list(APPEND cmake_config "$") else() list(APPEND cmake_extra_args "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") endif() @@ -114,7 +117,7 @@ if(ENABLE_ONEDNN_FOR_GPU) "-DDNNL_GPU_RUNTIME=OCL" "-DDNNL_LIBRARY_NAME=openvino_onednn_gpu" "-DCMAKE_INSTALL_PREFIX=${ONEDNN_INSTALL_DIR}" - "-DCMAKE_INSTALL_LIBDIR=lib/$" + "-DCMAKE_INSTALL_LIBDIR=lib/${cmake_config}" "-DDNNL_ENABLE_CONCURRENT_EXEC=ON" "-DDNNL_ENABLE_PRIMITIVE_CACHE=OFF" "-DDNNL_ENABLE_WORKLOAD=INFERENCE" @@ -132,7 +135,7 @@ if(ENABLE_ONEDNN_FOR_GPU) ) add_library(onednn_gpu_tgt INTERFACE) set_target_properties(onednn_gpu_tgt PROPERTIES - INTERFACE_LINK_DIRECTORIES "${ONEDNN_INSTALL_DIR}/lib/$" + INTERFACE_LINK_DIRECTORIES "${ONEDNN_INSTALL_DIR}/lib/${cmake_config}" INTERFACE_LINK_LIBRARIES "openvino_onednn_gpu" INTERFACE_INCLUDE_DIRECTORIES "${ONEDNN_INSTALL_DIR}/include" INTERFACE_COMPILE_DEFINITIONS ENABLE_ONEDNN_FOR_GPU