Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added install rules for tests #6344

Merged
merged 23 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
619901e
Moved cmake/templates to <root>
ilya-lavrenov Jun 23, 2021
951c412
Removed ngraph versioning, reused IE one
ilya-lavrenov Jun 23, 2021
56b294c
Merged converage
ilya-lavrenov Jun 23, 2021
f20584c
Removed duplicatde ngraph cmake options
ilya-lavrenov Jun 23, 2021
35f74d3
Merge remote-tracking branch 'upstream/master' into cmake-merge
ilya-lavrenov Jun 23, 2021
83e5b94
Moved dependencies to <root>/cmake
ilya-lavrenov Jun 23, 2021
2d8c3d4
Removed installing of VERSION
ilya-lavrenov Jun 23, 2021
5e1ad3b
Start #1
ilya-lavrenov Jun 23, 2021
abe0336
Merge remote-tracking branch 'upstream/master' into cpack-dev-pkg
ilya-lavrenov Jun 24, 2021
e900f6f
cpack
ilya-lavrenov Jun 24, 2021
2090f27
Merge remote-tracking branch 'upstream/master' into cpack-dev-pkg
ilya-lavrenov Jun 24, 2021
f21735e
Added component type
ilya-lavrenov Jun 24, 2021
5c2237d
Added installation of tests targets
ilya-lavrenov Jun 24, 2021
f783e10
Added ngraph tests target install
ilya-lavrenov Jun 24, 2021
c40b722
Fixed runtime dependencies location
ilya-lavrenov Jun 24, 2021
689eb0c
Merge remote-tracking branch 'upstream/master' into cpack-dev-pkg
ilya-lavrenov Jun 24, 2021
da53986
Disable GNA unit tests
ilya-lavrenov Jun 24, 2021
6bb6fa6
Revert "Disable GNA unit tests"
ilya-lavrenov Jun 24, 2021
01200ef
Merge remote-tracking branch 'upstream/master' into cpack-dev-pkg
ilya-lavrenov Jun 25, 2021
763e491
Installed only core component
ilya-lavrenov Jun 25, 2021
67b8c32
Replaced ENABLE_DEV_PKG_INSTALL with EXCLUDE_FROM_ALL
ilya-lavrenov Jun 25, 2021
d0a541d
Removed extra cmake options
ilya-lavrenov Jun 25, 2021
2c77e78
Merge remote-tracking branch 'upstream/master' into cpack-dev-pkg
ilya-lavrenov Jun 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ if(THREADING STREQUAL "OMP")
install(FILES ${source_list}
DESTINATION "deployment_tools/inference_engine/external/omp/lib"
COMPONENT omp)

endif()

## TBB package
Expand Down
5 changes: 5 additions & 0 deletions cmake/developer_package/add_ie_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,9 @@ function(addIeTargetTest)

add_test(NAME ${ARG_NAME} COMMAND ${ARG_NAME})
set_property(TEST ${ARG_NAME} PROPERTY LABELS ${ARG_LABELS})

install(TARGETS ${ARG_NAME}
RUNTIME DESTINATION tests
COMPONENT tests
EXCLUDE_FROM_ALL)
endfunction()
36 changes: 27 additions & 9 deletions cmake/developer_package/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
# SPDX-License-Identifier: Apache-2.0
#

include(CMakeParseArguments)
include(CPackComponent)
unset(IE_CPACK_COMPONENTS_ALL CACHE)

set(IE_CPACK_IE_DIR deployment_tools/inference_engine)

#
# ie_cpack_set_library_dir()
#
# Set library directory for cpack
#
set(IE_CPACK_IE_DIR deployment_tools/inference_engine)
function(ie_cpack_set_library_dir)
if(WIN32)
set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
Expand All @@ -31,25 +30,44 @@ ie_cpack_set_library_dir()
#
# Wraps original `cpack_add_component` and adds component to internal IE list
#
unset(IE_CPACK_COMPONENTS_ALL CACHE)
macro(ie_cpack_add_component NAME)
list(APPEND IE_CPACK_COMPONENTS_ALL ${NAME})
set(IE_CPACK_COMPONENTS_ALL "${IE_CPACK_COMPONENTS_ALL}" CACHE STRING "" FORCE)
cpack_add_component(${NAME} ${ARGN})

cpack_add_component(${NAME} ${args})
endmacro()

# create test component
if(ENABLE_TESTS)
cpack_add_component(tests DISABLED)
endif()

macro(ie_cpack)
set(CPACK_GENERATOR "TGZ")
set(CPACK_SOURCE_GENERATOR "")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenVINO toolkit")
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED OFF)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) # multiple components
set(CPACK_PACKAGE_VENDOR "Intel Corporation")
set(CPACK_VERBATIM_VARIABLES ON)
set(CPACK_COMPONENTS_ALL ${ARGN})
set(CPACK_STRIP_FILES ON)
set(CPACK_THREADS 8)

string(REPLACE "/" "_" CPACK_PACKAGE_VERSION "${CI_BUILD_NUMBER}")
if(WIN32)
set(CPACK_PACKAGE_NAME inference-engine_${CMAKE_BUILD_TYPE})
else()
set(CPACK_PACKAGE_NAME inference-engine)
endif()
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_PACKAGE_VENDOR "Intel")
set(CPACK_COMPONENTS_ALL ${ARGN})
set(CPACK_STRIP_FILES ON)

foreach(ver IN LISTS MAJOR MINOR PATCH)
if(DEFINED IE_VERSION_${ver})
set(CPACK_PACKAGE_VERSION_${ver} ${IE_VERSION_${ver}})
endif()
endforeach()

if(OS_FOLDER)
set(CPACK_SYSTEM_NAME "${OS_FOLDER}")
Expand Down
18 changes: 14 additions & 4 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,33 @@ if(NOT ENABLE_DOCKER)
set(InferenceEngine_DIR ${CMAKE_BINARY_DIR})
endif()

if (NGRAPH_ONNX_IMPORT_ENABLE)
if(NGRAPH_ONNX_IMPORT_ENABLE)
add_subdirectory(onnx_custom_op)
endif()
add_subdirectory(template_extension)

set(all_docs_targets
ie_docs_snippets
template_extension
templatePlugin TemplateBehaviorTests TemplateFunctionalTests)
template_extension templatePlugin templateFuncTests)
foreach(target_name IN LISTS all_docs_targets)
if (TARGET ${target_name})
if(TARGET ${target_name})
set_target_properties(${target_name} PROPERTIES FOLDER docs)
if(WIN32)
set_target_properties(${target_name} PROPERTIES COMPILE_PDB_NAME ${target_name})
endif()
endif()
endforeach()

# install

set(install_targets template_extension)
if(ENABLE_TEMPLATE_PLUGIN)
list(APPEND install_targets templatePlugin templateFuncTests)
endif()

install(TARGETS ${install_targets}
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
endif()

set(LINKCHECKER_PY "" CACHE FILEPATH "Path to linkchecker.py for documentation check")
Expand Down
1 change: 0 additions & 1 deletion docs/template_plugin/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ endif()

# install(TARGETS ${TARGET_NAME}
# RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH}
# ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH}
# LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH}
# COMPONENT ${component_name})
4 changes: 2 additions & 2 deletions inference-engine/cmake/vpu_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ foreach(firmware_name IN LISTS VPU_SUPPORTED_FIRMWARES)
VERBATIM)

install(FILES ${${var_name}}
DESTINATION ${IE_CPACK_RUNTIME_PATH}
COMPONENT myriad)
DESTINATION ${IE_CPACK_RUNTIME_PATH}
COMPONENT myriad)
endforeach()

add_custom_target(vpu_copy_firmware
Expand Down
6 changes: 6 additions & 0 deletions inference-engine/src/inference_engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml
DESTINATION ${IE_CPACK_RUNTIME_PATH}
COMPONENT core)

# for InferenceEngineUnitTest
install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml
DESTINATION tests/lib
COMPONENT tests
EXCLUDE_FROM_ALL)

# Install cmake scripts

install(EXPORT InferenceEngineTargets
Expand Down
10 changes: 10 additions & 0 deletions inference-engine/src/readers/ir_reader_v7/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@ endif()
# code style

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

# for ieFuncTests
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL)

# for InferenceEngineUnitTest
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL)
5 changes: 5 additions & 0 deletions inference-engine/src/snippets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@ openvino_developer_export_targets(COMPONENT inference_engine TARGETS ${TARGET_NA
# install(TARGETS ${TARGET_NAME}
# RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT core
# LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT core)

# TODO: remove once install commands above are commented out
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ endif()
target_link_libraries(${TARGET_NAME} PRIVATE inference_engine)

target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLUGIN)

install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL)
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ function(enable_vpu TARGET_NAME FLAG_NAME PLUGIN_NAME)
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME})
set_property(TEST ${TARGET_NAME} PROPERTY LABELS VPU MYRIAD)

install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests
COMPONENT tests
EXCLUDE_FROM_ALL)

add_dependencies(${TARGET_NAME} ${DEPENDENCIES})
endfunction(enable_vpu)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ endif()

add_test(NAME ${TARGET} COMMAND ${TARGET})
set_property(TEST ${TARGET} PROPERTY LABELS IE PREPROC)

install(TARGETS ${TARGET}
RUNTIME DESTINATION tests
COMPONENT tests
EXCLUDE_FROM_ALL)
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ add_dependencies(${TARGET_NAME} ${DEPENDENCIES})
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME})
set_property(TEST ${TARGET_NAME} PROPERTY LABELS GNA)

install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests
COMPONENT tests
EXCLUDE_FROM_ALL)

if(GNA_LIBRARY_VERSION STREQUAL "GNA1")
target_compile_definitions(${TARGET_NAME} PRIVATE GNA1_LIB)
endif()
5 changes: 5 additions & 0 deletions inference-engine/tests_deprecated/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,9 @@ endif()
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME})
set_property(TEST ${TARGET_NAME} PROPERTY LABELS IE)

install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests
COMPONENT tests
EXCLUDE_FROM_ALL)

add_dependencies(${TARGET_NAME} mock_engine)
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ void GNAPropagateMatcher :: match() {
OutputsDataMap outputsInfo;

auto loadNetworkFromIR = [&] () -> InferenceEngine::CNNNetwork {
Core net_reader;
Core core;
auto weights_fake = make_shared_blob<uint8_t>(TensorDesc(Precision::U8,
SizeVector({std::numeric_limits<uint32_t>::max()/2}), Layout::C));
weights_fake->allocate();

auto net_original = net_reader.ReadNetwork(_env.model, weights_fake);
auto net_original = core.ReadNetwork(_env.model, weights_fake);
size_t weightsSize = 0;
std::vector<std::string> dataBlobs = {
"weights",
Expand Down Expand Up @@ -157,7 +157,7 @@ void GNAPropagateMatcher :: match() {
fillWeights(weights);
}

auto net = net_reader.ReadNetwork(_env.model, weights);
auto net = core.ReadNetwork(_env.model, weights);
sortedLayers = details::CNNNetSortTopologically(net);
sortedLayers.insert(sortedLayers.end(), tiBodies.begin(), tiBodies.end());

Expand Down
5 changes: 5 additions & 0 deletions ngraph/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@ if (NGRAPH_INTERPRETER_ENABLE)
target_link_libraries(unit-test PRIVATE interpreter_backend)
endif()

install(TARGETS unit-test
RUNTIME DESTINATION tests
COMPONENT tests
EXCLUDE_FROM_ALL)

############ FRONTEND ############
target_include_directories(unit-test PRIVATE ${FRONTEND_INCLUDE_PATH})
target_link_libraries(unit-test PRIVATE frontend_manager)
Expand Down
4 changes: 4 additions & 0 deletions ngraph/test/frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ target_link_libraries(mock1_ngraph_frontend PRIVATE frontend_manager)
add_dependencies(unit-test mock1_ngraph_frontend)

add_clang_format_target(mock1_ngraph_frontend_clang FOR_TARGETS mock1_ngraph_frontend)

install(TARGETS mock1_ngraph_frontend
RUNTIME DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL)
4 changes: 4 additions & 0 deletions ngraph/test/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,9 @@ if (NOT WIN32)
endif()
target_include_directories(ngraph_backend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

install(TARGETS ngraph_backend
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

add_subdirectory(interpreter)
add_subdirectory(ie)
4 changes: 4 additions & 0 deletions ngraph/test/runtime/ie/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ endif()
add_dependencies(ie_backend inference_engine)
target_include_directories(ie_backend PUBLIC ${IE_MAIN_SOURCE_DIR}/include)
target_link_libraries(ie_backend PUBLIC ngraph_backend inference_engine)

install(TARGETS ie_backend
RUNTIME DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL)
4 changes: 4 additions & 0 deletions ngraph/test/runtime/interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ if (NGRAPH_INTERPRETER_ENABLE)

target_compile_definitions(interpreter_backend PRIVATE INTERPRETER_BACKEND_EXPORTS)
target_link_libraries(interpreter_backend PUBLIC ngraph_backend)

install(TARGETS interpreter_backend
RUNTIME DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL)
endif()