Skip to content

Commit

Permalink
[GML] Dont pull in third party repos in cmake, link to bazel provided…
Browse files Browse the repository at this point in the history
… deps

Signed-off-by: James Bartlett <[email protected]>
  • Loading branch information
JamesMBartlett committed Dec 4, 2024
1 parent 4b028e6 commit 693a148
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmake/developer_package/target_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ ov_libc_version()
#
macro(ov_get_glibcxx_use_cxx11_abi)
if(LINUX AND OPENVINO_STDLIB STREQUAL "GNU")
ov_get_compiler_definition("_GLIBCXX_USE_CXX11_ABI" OV_GLIBCXX_USE_CXX11_ABI)
set(OV_GLIBCXX_USE_CXX11_ABI "1" PARENT_SCOPE)
endif()
endmacro()

Expand Down
5 changes: 4 additions & 1 deletion cmake/templates/OpenVINOConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ macro(_ov_find_tbb)

set(enable_system_tbb "@ENABLE_SYSTEM_TBB@")
if(NOT enable_system_tbb)
set_and_check(_tbb_dir "@PACKAGE_OV_TBB_DIR@")
# [GML] Because bazel builds in a build_tmpdir, the TBB path is wrong.
# [GML] This is a hack to fix-up the path.
string(REPLACE ".build_tmpdir" "" _gml_package_ie_tbb_dir "@PACKAGE_OV_TBB_DIR@")
set_and_check(_tbb_dir ${_gml_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})
Expand Down
7 changes: 4 additions & 3 deletions src/plugins/intel_cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
elseif (OV_COMPILER_IS_INTEL_LLVM AND WIN32)
ov_add_compiler_flags("/Wno-microsoft-include")
endif()
if(NOT BUILD_SHARED_LIBS)

if((NOT BUILD_SHARED_LIBS) AND ENABLE_ONEDNN_FOR_GPU)
# Symbols are located in both src and include folders
file(GLOB_RECURSE onednn_files
"${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/include/*.cpp"
Expand Down Expand Up @@ -260,7 +261,7 @@ target_link_libraries(${TARGET_NAME} PRIVATE dnnl
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
if (ENABLE_MLAS_FOR_CPU)
target_link_libraries(${TARGET_NAME} PRIVATE mlas)
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE $<TARGET_PROPERTY:mlas,INCLUDE_DIRECTORIES>)
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${MLAS_INCLUDE_DIRS})
add_definitions(-DOV_CPU_WITH_MLAS)
endif()
if (ENABLE_SNIPPETS_LIBXSMM_TPP)
Expand All @@ -271,7 +272,7 @@ endif ()
if(ENABLE_SHL_FOR_CPU)
target_link_libraries(${TARGET_NAME} PRIVATE shl)
endif()
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE $<TARGET_PROPERTY:dnnl,INCLUDE_DIRECTORIES>)
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${DNNL_INCLUDE_DIRS})

# Temporal solution to use template reference implementations in cases where optimizied implementation
# is not (yet) needed.
Expand Down
7 changes: 4 additions & 3 deletions src/plugins/intel_cpu/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,14 @@ if (ENABLE_SNIPPETS_LIBXSMM_TPP)
endif()

if(ENABLE_MLAS_FOR_CPU)
add_subdirectory(mlas)
ov_install_static_lib(mlas ${OV_CPACK_COMP_CORE})
include_directories(${MLAS_INCLUDE_DIRS})
link_directories(${MLAS_LIBRARY_DIRS})
endif()

if(ENABLE_SHL_FOR_CPU)
add_subdirectory(shl)
ov_install_static_lib(shl ${OV_CPACK_COMP_CORE})
endif()

ov_add_onednn()
include_directories(${DNNL_INCLUDE_DIRS})
link_directories(${DNNL_LIBRARY_DIRS})
6 changes: 5 additions & 1 deletion thirdparty/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ endif()
#

if(ENABLE_OV_ONNX_FRONTEND)
find_package(ONNX 1.16.2 QUIET COMPONENTS onnx onnx_proto NO_MODULE)
find_package(ONNX QUIET COMPONENTS onnx onnx_proto NO_MODULE)

if(ONNX_FOUND)
# conan and vcpkg create imported targets 'onnx' and 'onnx_proto'
Expand Down Expand Up @@ -549,6 +549,7 @@ endif()
# Install
#

if(ENABLE_SAMPLES OR ENABLE_TESTS)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags
DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty
COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES}
Expand All @@ -569,7 +570,9 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags
PATTERN .travis.yml EXCLUDE
PATTERN src/gflags_completions.sh EXCLUDE
PATTERN WORKSPACE EXCLUDE)
endif()

if(ENABLE_SAMPLES)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/json/nlohmann_json
DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty
COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES}
Expand All @@ -594,6 +597,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/json/nlohmann_json
PATTERN tools EXCLUDE
PATTERN WORKSPACE.bazel EXCLUDE
PATTERN wsjcpp.yml EXCLUDE)
endif()

# restore state

Expand Down

0 comments on commit 693a148

Please sign in to comment.