Skip to content

Commit

Permalink
Rename onference_engine targets
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Jan 22, 2024
1 parent dc880a5 commit 73caf50
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 71 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,10 @@ if(NOT OV_GLIBC_VERSION VERSION_EQUAL 0.0)
endif()

# remove file with exported targets to force its regeneration
file(REMOVE "${CMAKE_BINARY_DIR}/ngraphTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/InferenceEngineTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")

# remove exported developer targets files to force its regeneration
macro(ov_clean_developer_package_targets)
file(REMOVE "${CMAKE_BINARY_DIR}/inference_engine_developer_package_targets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/openvino_developer_package_targets.cmake")
unset(_OPENVINO_DEVELOPER_PACKAGE_TARGETS CACHE)
unset(openvino_installed_targets CACHE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/developer_package/frontends/frontends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function(ov_generate_frontends_hpp)
endif()
endforeach()

# add dependency on header file generation for all inference_engine source files
# add dependency on header file generation for all openvino_frontend_common_obj runtime source files
set_source_files_properties(${all_sources} PROPERTIES OBJECT_DEPENDS ${ov_frontends_hpp})
endfunction()

Expand Down
8 changes: 4 additions & 4 deletions cmake/developer_package/plugins/plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ function(ov_generate_plugins_hpp)

# add plugins to libraries including ov_plugins.hpp
ov_target_link_plugins(openvino)
if(TARGET inference_engine_s)
ov_target_link_plugins(inference_engine_s)
if(TARGET openvino_runtime_s)
ov_target_link_plugins(openvino_runtime_s)
endif()

if(OV_GENERATOR_MULTI_CONFIG AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
Expand Down Expand Up @@ -352,7 +352,7 @@ function(ov_generate_plugins_hpp)
VERBATIM)

# for some reason dependency on source files does not work
# so, we have to use explicit target and make it dependency for inference_engine_obj
# so, we have to use explicit target and make it dependency for openvino_runtime_obj
add_custom_target(_ov_plugins_hpp DEPENDS ${ov_plugins_hpp})
add_dependencies(inference_engine_obj _ov_plugins_hpp)
add_dependencies(openvino_runtime_obj _ov_plugins_hpp)
endfunction()
4 changes: 2 additions & 2 deletions cmake/extra_modules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ endfunction()
# since it's generated after modules are configured
ov_generate_dev_package_config()

# extra modules must be registered after inference_engine library
# extra modules must be registered after openvino_runtime library
# and all other OpenVINO Core libraries are creared
# because '_ov_register_extra_modules' creates fake InferenceEngineDeveloperPackageConfig.cmake
# because '_ov_register_extra_modules' creates fake OpenVINODeveloperPackageConfig.cmake
# with all imported developer targets
_ov_register_extra_modules()

Expand Down
2 changes: 0 additions & 2 deletions cmake/packaging/debian.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ macro(ov_cpack_settings)
ov_debian_add_lintian_suppression(${python_component}
# usr/lib/python3/dist-packages/requirements.txt
"unknown-file-in-python-module-directory"
# usr/lib/python3/dist-packages/openvino/inference_engine/__init__.py
"executable-not-elf-or-script"
# all directories
"non-standard-dir-perm"
# usr/bin/benchmark_app
Expand Down
8 changes: 4 additions & 4 deletions src/cmake/openvino.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ add_library(${TARGET_NAME}
$<TARGET_OBJECTS:openvino_core_obj>
$<TARGET_OBJECTS:openvino_core_obj_version>
$<TARGET_OBJECTS:openvino_frontend_common_obj>
$<TARGET_OBJECTS:inference_engine_obj>
$<TARGET_OBJECTS:inference_engine_obj_version>
$<TARGET_OBJECTS:inference_engine_transformations_obj>
$<TARGET_OBJECTS:inference_engine_lp_transformations_obj>
$<TARGET_OBJECTS:openvino_runtime_obj>
$<TARGET_OBJECTS:openvino_runtime_obj_version>
$<TARGET_OBJECTS:openvino_transformations_obj>
$<TARGET_OBJECTS:openvino_lp_transformations_obj>
$<$<TARGET_EXISTS:openvino_proxy_plugin_obj>:$<TARGET_OBJECTS:openvino_proxy_plugin_obj>>)

add_library(openvino::runtime ALIAS ${TARGET_NAME})
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/ov_parallel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function(ov_set_threading_interface_for TARGET_NAME)
set(LINK_TYPE "PRIVATE")
set(COMPILE_DEF_TYPE "PRIVATE")
elseif(target_type STREQUAL "STATIC_LIBRARY")
# Affected libraries: inference_engine_s
# Affected libraries: openvino_runtime_s
# they don't have TBB in public headers => PRIVATE
set(LINK_TYPE "PRIVATE")
set(COMPILE_DEF_TYPE "PUBLIC")
Expand Down
14 changes: 2 additions & 12 deletions src/common/low_precision_transformations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
#

set (TARGET_NAME "inference_engine_lp_transformations")
set (TARGET_NAME "openvino_lp_transformations")

set(PUBLIC_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")

Expand All @@ -27,8 +27,7 @@ ov_build_target_faster(${TARGET_NAME}_obj UNITY)

target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::itt openvino::core::dev)

target_include_directories(${TARGET_NAME}_obj PRIVATE $<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}>
$<BUILD_INTERFACE:$<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>>)
target_include_directories(${TARGET_NAME}_obj PRIVATE $<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}>)

add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}_obj)

Expand All @@ -38,15 +37,6 @@ if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(${TARGET_NAME}_obj PUBLIC OPENVINO_STATIC_LIBRARY)
endif()

# INTERFACE library for BW compatibility

add_library(${TARGET_NAME} INTERFACE)
target_link_libraries(${TARGET_NAME} INTERFACE openvino::runtime)

target_include_directories(${TARGET_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:$<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>>)

# LTO

set_target_properties(${TARGET_NAME}_obj PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
Expand Down
2 changes: 1 addition & 1 deletion src/common/transformations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
#

set(TARGET_NAME "inference_engine_transformations")
set(TARGET_NAME "openvino_transformations")

set(PUBLIC_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")

Expand Down
2 changes: 0 additions & 2 deletions src/common/transformations/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ ov_add_test_target(
sharedTestClasses
ov_lpt_models
ADD_CLANG_FORMAT
INCLUDES
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src
LABELS
OV UNIT TRANSFORMATIONS
)
Expand Down
32 changes: 13 additions & 19 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ if(ON)

set_property(SOURCE ${MIXED_SRC}
APPEND PROPERTY INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/dev_api
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/include
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/include/ie)
$<TARGET_PROPERTY:openvino_runtime_obj,SOURCE_DIR>/src
$<TARGET_PROPERTY:openvino_runtime_obj,SOURCE_DIR>/dev_api
$<TARGET_PROPERTY:openvino_runtime_obj,SOURCE_DIR>/include
$<TARGET_PROPERTY:openvino_runtime_obj,SOURCE_DIR>/include/ie)
endif()

# Create named folders for the sources within the .vcproj
Expand Down Expand Up @@ -98,23 +98,23 @@ target_link_libraries(openvino_core_obj PRIVATE openvino::reference openvino::ut

ov_mark_target_as_cc(openvino_core_obj)

# ngraph is public API => need to mark this library as important for ABI free
# openvino_core is public API => need to mark this library as important for ABI free
ov_abi_free_target(openvino_core_obj)

ov_ncc_naming_style(FOR_TARGET openvino_core_obj
SOURCE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include")

ov_add_clang_format_target(ngraph_clang FOR_SOURCES ${LIBRARY_SRC} ${PUBLIC_HEADERS} ${DEV_HEADERS})
ov_add_clang_format_target(openvino_core_clang FOR_SOURCES ${LIBRARY_SRC} ${PUBLIC_HEADERS} ${DEV_HEADERS})

if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(openvino_core_obj PUBLIC OPENVINO_STATIC_LIBRARY)
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# ngraph is linked against openvino::reference, openvino::shape_inference static libraries
# which include ngraph headers with dllimport attribute. Linker complains about it
# openvino_core is linked against openvino::reference, openvino::shape_inference static libraries
# which include openvino_core headers with dllimport attribute. Linker complains about it
# but no way to fix this: linking with no attribute defaults to dllexport and we have
# multiple defitions for ngraph symbols.
# multiple defitions for openvino_core symbols.
#
# The possible way is to use object libraries for openvino::reference
# but it's not convinient since these libraries are exported from build tree
Expand All @@ -128,7 +128,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_link_options(openvino_core_obj ${link_type} "/IGNORE:4217,4286")
endif()

# some sources are located in ngraph, while headers are in inference_engine_transformations
# TODO: try to remove this and move smart reshape to transformations
# some sources are located in openvino_core, while headers are in openvino_transformations
file(GLOB_RECURSE smart_reshape_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/pass/smart_reshape/*.cpp)
file(GLOB_RECURSE rt_info_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/pass/rt_info/*.cpp)
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/src/pass/convert_precision.cpp"
Expand All @@ -139,18 +140,11 @@ set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/src/pass/convert_precis
"${CMAKE_CURRENT_SOURCE_DIR}/src/preprocess/preprocess_steps_impl.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/model.cpp" # for SmartReshape
${smart_reshape_srcs} ${rt_info_srcs}
PROPERTIES INCLUDE_DIRECTORIES $<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>)
PROPERTIES INCLUDE_DIRECTORIES $<TARGET_PROPERTY:openvino::core::dev,INTERFACE_INCLUDE_DIRECTORIES>)

# Defines macro in C++ to load backend plugin
target_include_directories(openvino_core_obj PUBLIC $<BUILD_INTERFACE:${OV_CORE_INCLUDE_PATH}>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)

add_library(ngraph INTERFACE)
target_link_libraries(ngraph INTERFACE openvino::runtime)
# Add an alias so that library can be used inside the build tree, e.g. when testing
add_library(openvino::core ALIAS ngraph)

target_include_directories(ngraph INTERFACE $<BUILD_INTERFACE:${OV_CORE_INCLUDE_PATH}>)
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)

#-----------------------------------------------------------------------------------------------
# Installation logic...
Expand Down
2 changes: 1 addition & 1 deletion src/core/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_definitions(-DSERIALIZED_ZOO=\"${TEST_MODEL_ZOO}/core/models\")

# For type relaxed types
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/threading.cpp
PROPERTIES INCLUDE_DIRECTORIES $<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>)
PROPERTIES INCLUDE_DIRECTORIES $<TARGET_PROPERTY:openvino::core::dev,INTERFACE_INCLUDE_DIRECTORIES>)

if(SUGGEST_OVERRIDE_SUPPORTED)
set_source_files_properties(ov_tensor_test.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ov_abi_free_target(${TARGET_NAME}_obj)
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}_obj
SOURCE_DIRECTORIES "${FRONTEND_INCLUDE_DIR}"
ADDITIONAL_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>)
$<TARGET_PROPERTY:openvino::core::dev,INTERFACE_INCLUDE_DIRECTORIES>)

# Installation rules header files

Expand Down
15 changes: 7 additions & 8 deletions src/inference/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# SPDX-License-Identifier: Apache-2.0
#

set (TARGET_NAME "inference_engine")
set (TARGET_NAME "openvino_runtime")

if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# TODO: Add IMPLEMENT_OPENVINO_API to inference_engine_obj
# TODO: Add IMPLEMENT_OPENVINO_API to openvino_runtime_obj
ov_add_compiler_flags(/wd4273)
endif()

Expand Down Expand Up @@ -100,18 +100,17 @@ ov_build_target_faster(${TARGET_NAME}_obj

target_compile_definitions(${TARGET_NAME}_obj PRIVATE
IMPLEMENT_INFERENCE_ENGINE_API
$<$<TARGET_EXISTS:openvino_proxy_plugin_obj>:PROXY_PLUGIN_ENABLED>
$<TARGET_PROPERTY:ngraph,INTERFACE_COMPILE_DEFINITIONS>)
$<$<TARGET_EXISTS:openvino_proxy_plugin_obj>:PROXY_PLUGIN_ENABLED>)

target_include_directories(${TARGET_NAME}_obj SYSTEM PRIVATE
$<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:openvino::pugixml,INTERFACE_INCLUDE_DIRECTORIES>
$<$<TARGET_EXISTS:openvino_proxy_plugin_obj>:$<TARGET_PROPERTY:openvino_proxy_plugin_obj,INTERFACE_INCLUDE_DIRECTORIES>>
$<$<TARGET_EXISTS:xbyak::xbyak>:$<TARGET_PROPERTY:xbyak::xbyak,INTERFACE_INCLUDE_DIRECTORIES>>)

target_include_directories(${TARGET_NAME}_obj PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src"
"${CMAKE_CURRENT_SOURCE_DIR}/dev_api"
$<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>
"${CMAKE_CURRENT_SOURCE_DIR}/include/ie" # TODO: remove in 2024.0
$<$<TARGET_EXISTS:openvino_proxy_plugin_obj>:$<TARGET_PROPERTY:openvino_proxy_plugin_obj,INTERFACE_INCLUDE_DIRECTORIES>>
# for ov_plugins.hpp
$<IF:$<AND:$<BOOL:${OV_GENERATOR_MULTI_CONFIG}>,$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.20>>,${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>,${CMAKE_CURRENT_BINARY_DIR}>)

Expand All @@ -137,7 +136,7 @@ ov_add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${OV_STATIC_DEPENDEN

ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}_obj
SOURCE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/openvino"
ADDITIONAL_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>)
ADDITIONAL_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:openvino::core::dev,INTERFACE_INCLUDE_DIRECTORIES>)

# Static library used for unit tests which are always built

Expand Down
2 changes: 1 addition & 1 deletion src/inference/tests/functional/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ov_add_test_target(
DEFINES
${COMPILE_DEFINITIONS}
INCLUDES
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src
$<TARGET_PROPERTY:openvino_runtime_obj,SOURCE_DIR>/src
$<$<TARGET_EXISTS:openvino_proxy_plugin_obj>:$<TARGET_PROPERTY:openvino_proxy_plugin_obj,INTERFACE_INCLUDE_DIRECTORIES>>
${CMAKE_CURRENT_SOURCE_DIR}
ADD_CLANG_FORMAT
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/intel_cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ if(BUILD_SHARED_LIBS)
ov_set_threading_interface_for(${TARGET_NAME}_obj)

target_compile_definitions(${TARGET_NAME}_obj PRIVATE
USE_STATIC_IE IMPLEMENT_INFERENCE_ENGINE_PLUGIN IMPLEMENT_INFERENCE_EXTENSION_API
$<TARGET_PROPERTY:ngraph,INTERFACE_COMPILE_DEFINITIONS>)
USE_STATIC_IE IMPLEMENT_INFERENCE_ENGINE_PLUGIN IMPLEMENT_INFERENCE_EXTENSION_API)

set_target_properties(${TARGET_NAME}_obj PROPERTIES EXCLUDE_FROM_ALL ON)

Expand Down
4 changes: 1 addition & 3 deletions src/plugins/intel_cpu/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ ov_add_test_target(
gmock
dnnl
openvino::shape_inference
inference_engine_s
openvino_runtime_s
unit_test_utils
ov_models
ov_snippets_models
snippets_test_utils
${MLAS_LIBRARY}
inference_engine_transformations
inference_engine_lp_transformations
ADD_CPPLINT
LABELS
OV UNIT CPU
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/intel_gpu/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ endif()
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})

target_link_libraries(${TARGET_NAME} PRIVATE openvino_intel_gpu_graph
inference_engine
OpenCL::OpenCL
gtest
gtest_main
gflags
common_test_utils
openvino::reference
inference_engine_transformations
gmock)

target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_utils/common_test_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function(add_common_utils ADD_TARGET_NAME)

# USE_STATIC_IE is passed
if(ARGN)
target_link_libraries(${ADD_TARGET_NAME} PRIVATE inference_engine_s)
target_link_libraries(${ADD_TARGET_NAME} PRIVATE openvino_runtime_s)
endif()

ov_build_target_faster(${ADD_TARGET_NAME}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_utils/unit_test_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ov_add_target(
LINK_LIBRARIES
PUBLIC
common_test_utils_s
inference_engine_s
openvino_runtime_s
gmock
DEPENDENCIES
mock_engine
Expand Down

0 comments on commit 73caf50

Please sign in to comment.