Skip to content

Commit

Permalink
publish master branch snapshot, revision 0110d9c98fd7209589d06344f0d8…
Browse files Browse the repository at this point in the history
…36f61d81f4b3
  • Loading branch information
Alexey Suhov committed Apr 27, 2020
1 parent 822692f commit 357cc7e
Show file tree
Hide file tree
Showing 1,456 changed files with 113,995 additions and 26,285 deletions.
25 changes: 21 additions & 4 deletions cmake/coverage/coverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@

if(NOT TARGET ie_coverage_clean)
add_custom_target(ie_coverage_clean)
set_target_properties(ie_coverage_clean PROPERTIES FOLDER coverage)
endif()

if(NOT TARGET ie_coverage_init)
add_custom_target(ie_coverage_init)
set_target_properties(ie_coverage_init PROPERTIES FOLDER coverage)
endif()

if(NOT TARGET ie_coverage)
add_custom_target(ie_coverage)
set_target_properties(ie_coverage PROPERTIES FOLDER coverage)
endif()

set(IE_COVERAGE_REPORTS "${CMAKE_BINARY_DIR}/coverage")
Expand All @@ -26,10 +29,10 @@ function(ie_coverage_clean)
cmake_parse_arguments(IE_COVERAGE "" "REPOSITORY;DIRECTORY" "" ${ARGN})

add_custom_target(ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
COMMAND lcov --zerocounters --quiet
--directory "${IE_COVERAGE_DIRECTORY}"
COMMENT "Add zero counters for coverage for ${IE_COVERAGE_REPOSITORY}"
VERBATIM)
COMMAND lcov --zerocounters --quiet
--directory "${IE_COVERAGE_DIRECTORY}"
COMMENT "Add zero counters for coverage for ${IE_COVERAGE_REPOSITORY}"
VERBATIM)

add_custom_target(ie_coverage_clean_${IE_COVERAGE_REPOSITORY}
COMMAND ${CMAKE_COMMAND}
Expand All @@ -42,6 +45,10 @@ function(ie_coverage_clean)
DEPENDS "${IE_COVERAGE_SCRIPT_DIR}/coverage_clean.cmake"
VERBATIM)

set_target_properties(ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
ie_coverage_clean_${IE_COVERAGE_REPOSITORY}
PROPERTIES FOLDER coverage)

add_dependencies(ie_coverage_clean ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
ie_coverage_clean_${IE_COVERAGE_REPOSITORY})
endfunction()
Expand Down Expand Up @@ -87,6 +94,8 @@ function(ie_coverage_capture)

add_custom_target(ie_coverage_${IE_COVERAGE_INFO_FILE}_info
DEPENDS ${output_file})
set_target_properties(ie_coverage_${IE_COVERAGE_INFO_FILE}_info
PROPERTIES FOLDER coverage)
endfunction()

#
Expand All @@ -111,6 +120,8 @@ function(ie_coverage_extract)
VERBATIM)
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
DEPENDS ${output_file})
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
PROPERTIES FOLDER coverage)

add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ie_coverage_${IE_COVERAGE_INPUT}_info)
endfunction()
Expand All @@ -137,6 +148,8 @@ function(ie_coverage_remove)
VERBATIM)
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
DEPENDS ${output_file})
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
PROPERTIES FOLDER coverage)

add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ie_coverage_${IE_COVERAGE_INPUT}_info)
endfunction()
Expand Down Expand Up @@ -164,6 +177,8 @@ function(ie_coverage_merge)
VERBATIM)
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
DEPENDS ${output_file})
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
PROPERTIES FOLDER coverage)

add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ${dependencies})
endfunction()
Expand All @@ -188,6 +203,8 @@ function(ie_coverage_genhtml)
VERBATIM)
add_custom_target(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml
DEPENDS "${output_directory}/index.html")
set_target_properties(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml
PROPERTIES FOLDER coverage)

add_dependencies(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml ie_coverage_${IE_COVERAGE_INFO_FILE}_info)
add_dependencies(ie_coverage ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml)
Expand Down
10 changes: 5 additions & 5 deletions cmake/developer_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ function(ie_cpack_set_library_dir)
endif()

if(WIN32)
set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${CMAKE_BUILD_TYPE}/${ARCH} PARENT_SCOPE)
set(IE_CPACK_RUNTIME_PATH ${IE_CPACK_IE_DIR}/bin/${CMAKE_BUILD_TYPE}/${ARCH} PARENT_SCOPE)
set(IE_CPACK_ARCHIVE_PATH ${IE_CPACK_IE_DIR}/lib/${CMAKE_BUILD_TYPE}/${ARCH} PARENT_SCOPE)
set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
set(IE_CPACK_RUNTIME_PATH ${IE_CPACK_IE_DIR}/bin/${ARCH}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
set(IE_CPACK_ARCHIVE_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
else()
set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH} PARENT_SCOPE)
set(IE_CPACK_RUNTIME_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH} PARENT_SCOPE)
Expand Down Expand Up @@ -200,8 +200,8 @@ else()
endif()

if(APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()

# Use solution folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down
8 changes: 8 additions & 0 deletions cmake/download/dependency_solver.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ function (RESOLVE_DEPENDENCY NAME_OF_CMAKE_VAR)

endfunction(RESOLVE_DEPENDENCY)

function (resolve_model_dependency network archive network_model_path)
RESOLVE_DEPENDENCY(${network_model_path}
ARCHIVE "models_archives/${archive}"
TARGET_PATH "${MODELS_PATH}/${network}")
string (REPLACE ${MODELS_PATH} "" relative_path ${${network_model_path}})
set(${network_model_path} ".${relative_path}" PARENT_SCOPE)
endfunction()

function(reset_deps_cache)
#
# Reset the dependencies cache if it was set by dependency solver
Expand Down
4 changes: 3 additions & 1 deletion cmake/download/download_and_extract.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked
set (status "ON")
set (on_master FALSE)

if(DEFINED ENV{IE_PATH_TO_DEPS})
if(DEFINED IE_PATH_TO_DEPS)
set(URL "${IE_PATH_TO_DEPS}/${RELATIVE_URL}")
elseif(DEFINED ENV{IE_PATH_TO_DEPS})
set(URL "$ENV{IE_PATH_TO_DEPS}/${RELATIVE_URL}")
else()
set(URL "https://download.01.org/opencv/2020/openvinotoolkit/2020.2/inference_engine/${RELATIVE_URL}")
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion cmake/os_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,13 @@ if(WIN32)
# 161 unrecognized pragma
# 177 variable was declared but never referenced
# 556 not matched type of assigned function pointer
# 1744: field of class type without a DLL interface used in a class with a DLL interface
# 2586 decorated name length exceeded, name was truncated
# 2651: attribute does not apply to any entity
# 3180 unrecognized OpenMP pragma
# 11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
# 15335 was not vectorized: vectorization possible but seems inefficient. Use vector always directive or /Qvec-threshold0 to override
ie_add_compiler_flags(/Qdiag-disable:161,177,556,2586,2651,3180,11075,15335)
ie_add_compiler_flags(/Qdiag-disable:161,177,556,1744,2586,2651,3180,11075,15335)
endif()

# Debug information flags
Expand Down
2 changes: 2 additions & 0 deletions cmake/sanitizer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if (ENABLE_SANITIZER)
set(SANITIZER_LINKER_FLAGS "-fsanitize=address")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fuse-ld=gold")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT WIN32)
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fuse-ld=lld")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_COMPILER_FLAGS}")
Expand Down
21 changes: 18 additions & 3 deletions inference-engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function(ie_developer_export)
APPEND FILE "${CMAKE_BINARY_DIR}/targets_developer.cmake")

# Custom target to build only Inference Engine Developer Package targets
add_custom_target(ie_dev_targets ALL DEPENDS ${IEDeveloperPackageTargets})
add_custom_target(ie_dev_targets ALL DEPENDS ${IEDeveloperPackageTargets} gflags)
endfunction()

add_subdirectory(thirdparty)
Expand All @@ -74,9 +74,24 @@ endif()

add_subdirectory(tools)

function(ie_build_samples)
# samples should be build with the same flags as from OpenVINO package,
# so unset all flags
foreach(var CMAKE_CXX_FLAGS CMAKE_C_FLAGS CMAKE_CXX_STANDARD
CMAKE_EXE_LINKER_FLAGS CMAKE_POLICY_DEFAULT_CMP0063
CMAKE_CXX_VISIBILITY_PRESET CMAKE_C_VISIBILITY_PRESET
CMAKE_VISIBILITY_INLINES_HIDDEN CMAKE_POSITION_INDEPENDENT_CODE
THREADS_PREFER_PTHREAD_FLAG X86_64 X86 ARM AARCH64 LINUX
MINGW64 CMAKE_BUILD_TYPE CMAKE_MACOSX_RPATH)
unset(${var})
endforeach()

add_subdirectory(samples)
endfunction()

# gflags and format_reader targets are kept inside of samples directory and
# they must be built even if samples build is disabled (required for tests and tools).
add_subdirectory(samples)
ie_build_samples()

file(GLOB_RECURSE SAMPLES_SOURCES samples/*.cpp samples/*.hpp samples/*.h)
add_cpplint_target(sample_cpplint
Expand Down Expand Up @@ -109,7 +124,7 @@ if(UNIX)
PATTERN *.bat EXCLUDE
PATTERN speech_libs_and_demos EXCLUDE)
elseif(WIN32)
install(DIRECTORY samples
install(DIRECTORY samples/
DESTINATION ${IE_CPACK_IE_DIR}/samples/cpp
COMPONENT cpp_samples
USE_SOURCE_PERMISSIONS
Expand Down
5 changes: 5 additions & 0 deletions inference-engine/cmake/clang_format.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ endif()
if(ENABLE_CLANG_FORMAT)
add_custom_target(clang_format_check_all)
add_custom_target(clang_format_fix_all)
set_target_properties(clang_format_check_all clang_format_fix_all
PROPERTIES FOLDER clang_format)
set(CLANG_FORMAT_ALL_OUTPUT_FILES "" CACHE INTERNAL "All clang-format output files")
endif()

Expand Down Expand Up @@ -108,6 +110,9 @@ function(add_clang_format_target TARGET_NAME)
"[clang-format] ${TARGET_NAME}_fix"
VERBATIM)

set_target_properties(${TARGET_NAME} ${TARGET_NAME}_fix
PROPERTIES FOLDER clang_format)

# if(CLANG_FORMAT_FOR_TARGETS)
# foreach(target IN LISTS CLANG_FORMAT_FOR_TARGETS)
# add_dependencies(${target} ${TARGET_NAME})
Expand Down
4 changes: 2 additions & 2 deletions inference-engine/cmake/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

if(DEFINED IE_MAIN_SOURCE_DIR AND TARGET inference_engine)
set(InferenceEngine_LIBRARIES inference_engine_legacy inference_engine
inference_engine_c_api inference_engine_nn_builder)
inference_engine_c_api)
else()
include("${CMAKE_CURRENT_LIST_DIR}/targets.cmake")
if(NOT WIN32)
Expand All @@ -30,5 +30,5 @@ else()

get_target_property(InferenceEngine_INCLUDE_DIRS IE::inference_engine INTERFACE_INCLUDE_DIRECTORIES)
set(InferenceEngine_LIBRARIES IE::inference_engine_legacy IE::inference_engine
IE::inference_engine_c_api IE::inference_engine_nn_builder)
IE::inference_engine_c_api)
endif()
3 changes: 3 additions & 0 deletions inference-engine/cmake/cpplint.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ endif()

if(ENABLE_CPPLINT)
add_custom_target(cpplint_all ALL)
set_target_properties(cpplint_all PROPERTIES FOLDER cpplint)
set(CPPLINT_ALL_OUTPUT_FILES "" CACHE INTERNAL "All cpplint output files")
endif()

Expand Down Expand Up @@ -93,6 +94,7 @@ function(add_cpplint_target TARGET_NAME)
add_custom_target(${TARGET_NAME} ALL
DEPENDS ${all_output_files}
COMMENT "[cpplint] ${TARGET_NAME}")
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER cpplint)

if(CPPLINT_FOR_TARGETS)
foreach(target IN LISTS CPPLINT_FOR_TARGETS)
Expand Down Expand Up @@ -168,4 +170,5 @@ function(add_cpplint_report_target)
add_custom_target(cpplint_report
DEPENDS "${html_output_file}"
COMMENT "[cpplint] Generate report")
set_target_properties(cpplint_report PROPERTIES FOLDER cpplint)
endfunction()
2 changes: 1 addition & 1 deletion inference-engine/cmake/cpplint_run.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ file(WRITE "${OUTPUT_FILE}" "${formatted_output}")

if(NOT SKIP_RETURN_CODE)
# Pass through the cpplint return code
if(NOT result EQUAL 0)
if(NOT result EQUAL "0")
# Display the cpplint output to console (to parse it form IDE)
message("${output}")
message(FATAL_ERROR "[cpplint] Code style check failed for : ${INPUT_FILE}")
Expand Down
2 changes: 1 addition & 1 deletion inference-engine/cmake/developer_package_config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/targets_developer.cmake")
set_property(TARGET IE::inference_engine PROPERTY IMPORTED_GLOBAL TRUE)

get_target_property(InferenceEngine_INCLUDE_DIRS IE::inference_engine INTERFACE_INCLUDE_DIRECTORIES)
set(InferenceEngine_LIBRARIES IE::inference_engine_legacy IE::inference_engine IE::inference_engine_nn_builder)
set(InferenceEngine_LIBRARIES IE::inference_engine_legacy IE::inference_engine)

#
# Common cmake includes
Expand Down
2 changes: 1 addition & 1 deletion inference-engine/cmake/features_ie.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ ie_option (ENABLE_CPP_CCT "enables C++ version of Cross Check Tool" OFF)

ie_option (ENABLE_C "enables ie c bridge build" ON)

ie_dependent_option(ENABLE_CPPLINT "Enable cpplint checks during the build" OFF "OFF;UNIX;NOT APPLE;NOT ANDROID" OFF)
ie_dependent_option(ENABLE_CPPLINT "Enable cpplint checks during the build" OFF "UNIX;NOT APPLE;NOT ANDROID" OFF)
ie_dependent_option(ENABLE_CPPLINT_REPORT "Build cpplint report instead of failing the build" OFF "ENABLE_CPPLINT" OFF)

ie_option(ENABLE_CLANG_FORMAT "Enable clang-format checks during the build" OFF)
Expand Down
3 changes: 3 additions & 0 deletions inference-engine/cmake/plugins/plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ function(ie_add_plugin)
if(TARGET inference_engine_preproc)
add_dependencies(${IE_PLUGIN_NAME} inference_engine_preproc)
endif()
if(TARGET inference_engine_ir_readers)
add_dependencies(${IE_PLUGIN_NAME} inference_engine_ir_readers)
endif()

# install rules

Expand Down
12 changes: 4 additions & 8 deletions inference-engine/cmake/share/InferenceEngineConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# IE::inference_engine - The Inference Engine library
# IE::inference_engine_legacy - The Inference Engine library with legacy API for IR v7 and older.
# IE::inference_engine_c_api - The Inference Engine C API library
# IE::inference_engine_nn_builder - The Inference Engine NN Builder library
#

macro(ext_message TRACE_LEVEL)
Expand All @@ -40,7 +39,7 @@ if(TARGET IE::inference_engine)
set(InferenceEngine_FOUND TRUE)
get_target_property(InferenceEngine_INCLUDE_DIRS IE::inference_engine INTERFACE_INCLUDE_DIRECTORIES)
set(InferenceEngine_LIBRARIES IE::inference_engine_legacy IE::inference_engine
IE::inference_engine_c_api IE::inference_engine_nn_builder)
IE::inference_engine_c_api)
else()
if (WIN32)
set(_ARCH intel64)
Expand Down Expand Up @@ -88,29 +87,26 @@ else()
find_library(IE_RELEASE_LIBRARY inference_engine@IE_RELEASE_POSTFIX_WIN@ "${IE_LIB_REL_DIR}" NO_DEFAULT_PATH)
find_library(IE_LEGACY_RELEASE_LIBRARY inference_engine_legacy@IE_RELEASE_POSTFIX_WIN@ "${IE_LIB_REL_DIR}" NO_DEFAULT_PATH)
find_library(IE_C_API_RELEASE_LIBRARY inference_engine_c_api@IE_RELEASE_POSTFIX_WIN@ "${IE_LIB_REL_DIR}" NO_DEFAULT_PATH)
find_library(IE_NN_BUILDER_RELEASE_LIBRARY inference_engine_nn_builder@IE_RELEASE_POSTFIX_WIN@ "${IE_LIB_REL_DIR}" NO_DEFAULT_PATH)
elseif(APPLE)
find_library(IE_RELEASE_LIBRARY inference_engine@IE_RELEASE_POSTFIX_MAC@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
find_library(IE_LEGACY_RELEASE_LIBRARY inference_engine_legacy@IE_RELEASE_POSTFIX_MAC@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
find_library(IE_C_API_RELEASE_LIBRARY inference_engine_c_api@IE_RELEASE_POSTFIX_MAC@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
find_library(IE_NN_BUILDER_RELEASE_LIBRARY inference_engine_nn_builder@IE_RELEASE_POSTFIX_MAC@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
else()
find_library(IE_RELEASE_LIBRARY inference_engine@IE_RELEASE_POSTFIX_LIN@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
find_library(IE_LEGACY_RELEASE_LIBRARY inference_engine_legacy@IE_RELEASE_POSTFIX_LIN@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
find_library(IE_C_API_RELEASE_LIBRARY inference_engine_c_api@IE_RELEASE_POSTFIX_LIN@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
find_library(IE_NN_BUILDER_RELEASE_LIBRARY inference_engine_nn_builder@IE_RELEASE_POSTFIX_LIN@ "${IE_LIB_DIR}" NO_DEFAULT_PATH)
endif()

find_package_handle_standard_args( InferenceEngine
FOUND_VAR INFERENCEENGINE_FOUND
REQUIRED_VARS IE_RELEASE_LIBRARY IE_LEGACY_RELEASE_LIBRARY IE_C_API_RELEASE_LIBRARY IE_NN_BUILDER_RELEASE_LIBRARY IE_INCLUDE_DIR
REQUIRED_VARS IE_RELEASE_LIBRARY IE_LEGACY_RELEASE_LIBRARY IE_C_API_RELEASE_LIBRARY IE_INCLUDE_DIR
FAIL_MESSAGE "Some of mandatory Inference Engine components are not found. Please consult InferenceEgnineConfig.cmake module's help page.")

if(INFERENCEENGINE_FOUND)
# to keep this line for successful execution in CMake 2.8
set(InferenceEngine_FOUND TRUE)

foreach(ie_library_suffix "" "_legacy" "_c_api" "_nn_builder")
foreach(ie_library_suffix "" "_legacy" "_c_api")
string(TOUPPER "${ie_library_suffix}" ie_library_usuffix)
add_library(IE::inference_engine${ie_library_suffix} SHARED IMPORTED GLOBAL)

Expand Down Expand Up @@ -167,7 +163,7 @@ else()

set(InferenceEngine_INCLUDE_DIRS ${IE_INCLUDE_DIR})
set(InferenceEngine_LIBRARIES IE::inference_engine_legacy IE::inference_engine
IE::inference_engine_c_api IE::inference_engine_nn_builder)
IE::inference_engine_c_api)

set(IE_EXTERNAL_DIR "${IE_ROOT_DIR}/external")
include("${IE_ROOT_DIR}/share/ie_parallel.cmake")
Expand Down
Loading

0 comments on commit 357cc7e

Please sign in to comment.