meta-intel/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-Installation-and-build-fixes.patch
Anuj Mittal af4fdcc321 dldt-inference-engine: fix installation of samples
We don't want to install sample sources. So delete them and install the
binaries instead. Also make sure that we're installing the python
samples and modules at correct location. Remove the tweaks from local
patch and copy in the recipe itself.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2020-04-13 15:22:18 +08:00

384 lines
16 KiB
Diff

From 1c78ff3ff1f77c78a618f7a780985cef1933bb2b Mon Sep 17 00:00:00 2001
From: Anuj Mittal <anuj.mittal@intel.com>
Date: Mon, 13 Apr 2020 15:20:28 +0800
Subject: [PATCH] Installation and build fixes
- Install libs, samples and binaries at appropriate places.
- Use system installed pugixml, ade, gflags, ngraph, opencl-headers
and icd-loader.
- Disable usage of Werror.
- Use find_library to look for tbb instead of looking for cmake module.
Upstream-Status: Inappropriate [OS-specific]
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
CMakeLists.txt | 2 --
cmake/developer_package.cmake | 8 +++++---
cmake/os_flags.cmake | 1 -
inference-engine/CMakeLists.txt | 7 ++-----
inference-engine/cmake/ie_parallel.cmake | 10 ++--------
.../include/gpu/gpu_ocl_wrapper.hpp | 2 +-
inference-engine/samples/CMakeLists.txt | 8 +++-----
.../samples/common/format_reader/CMakeLists.txt | 2 ++
.../src/cldnn_engine/CMakeLists.txt | 1 +
.../src/inference_engine/CMakeLists.txt | 17 +----------------
.../src/vpu/myriad_plugin/CMakeLists.txt | 2 +-
.../tests/mock_engine/CMakeLists.txt | 2 ++
inference-engine/tests/unit/CMakeLists.txt | 2 ++
inference-engine/thirdparty/CMakeLists.txt | 4 +---
.../clDNN/CMakeCompilerLinkerOpts.txt | 2 --
.../thirdparty/clDNN/CMakeLists.txt | 1 -
.../clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp | 2 +-
.../tools/compile_tool/CMakeLists.txt | 2 +-
.../tools/vpu/vpu_compile/CMakeLists.txt | 4 ++--
.../tools/vpu/vpu_perfcheck/CMakeLists.txt | 2 +-
20 files changed, 28 insertions(+), 53 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e48cee57..e9598455 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,8 +120,6 @@ function(build_ngraph)
endif()
ie_cpack_add_component(ngraph)
-
- add_subdirectory(ngraph)
endfunction()
build_ngraph()
diff --git a/cmake/developer_package.cmake b/cmake/developer_package.cmake
index e59edb2b..35672cac 100644
--- a/cmake/developer_package.cmake
+++ b/cmake/developer_package.cmake
@@ -5,7 +5,9 @@
include(CPackComponent)
unset(IE_CPACK_COMPONENTS_ALL CACHE)
-set(IE_CPACK_IE_DIR deployment_tools/inference_engine)
+if (NOT DEFINED IE_CPACK_IE_DIR)
+ set(IE_CPACK_IE_DIR deployment_tools/inference_engine)
+endif()
function(ie_cpack_set_library_dir)
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} ARCH)
@@ -18,7 +20,7 @@ function(ie_cpack_set_library_dir)
if(WIN32)
set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/$<CONFIG>/${ARCH} PARENT_SCOPE)
else()
- set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH} PARENT_SCOPE)
+ set(IE_CPACK_LIBRARY_PATH ${CMAKE_INSTALL_LIBDIR} PARENT_SCOPE)
endif()
endfunction()
@@ -99,7 +101,7 @@ if(UNIX)
SET(LIB_DL ${CMAKE_DL_LIBS})
endif()
-set(OUTPUT_ROOT ${OpenVINO_MAIN_SOURCE_DIR})
+set(OUTPUT_ROOT ${CMAKE_CURRENT_BINARY_DIR})
# Enable postfixes for Debug/Release builds
set(IE_DEBUG_POSTFIX_WIN "d")
diff --git a/cmake/os_flags.cmake b/cmake/os_flags.cmake
index 6f70768f..40141aca 100644
--- a/cmake/os_flags.cmake
+++ b/cmake/os_flags.cmake
@@ -139,7 +139,6 @@ if(WIN32)
else()
# TODO: enable for C sources as well
# ie_add_compiler_flags(-Werror)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
ie_add_compiler_flags(-ffunction-sections -fdata-sections)
ie_add_compiler_flags(-fvisibility=hidden)
ie_add_compiler_flags(-fdiagnostics-show-option)
diff --git a/inference-engine/CMakeLists.txt b/inference-engine/CMakeLists.txt
index d5feedb4..1ee656a1 100644
--- a/inference-engine/CMakeLists.txt
+++ b/inference-engine/CMakeLists.txt
@@ -123,12 +123,13 @@ install(FILES samples/CMakeLists.txt
# install Python samples
+if (ENABLE_PYTHON)
ie_cpack_add_component(python_samples REQUIRED DEPENDS core)
install(DIRECTORY ${ie_python_api_SOURCE_DIR}/sample/
DESTINATION ${IE_CPACK_IE_DIR}/samples/python
COMPONENT python_samples)
-
+endif()
# Custom target to build only Inference Engine Developer Package targets
add_custom_target(ie_dev_targets ALL DEPENDS inference_engine HeteroPlugin)
@@ -136,10 +137,6 @@ add_custom_target(ie_dev_targets ALL DEPENDS inference_engine HeteroPlugin)
# Developer package
ie_developer_export_targets(format_reader)
-if (ENABLE_NGRAPH)
- ie_developer_export_targets(${NGRAPH_LIBRARIES})
-endif()
-
export(TARGETS ${IEDeveloperPackageTargets} NAMESPACE IE::
APPEND FILE "${CMAKE_BINARY_DIR}/targets_developer.cmake")
diff --git a/inference-engine/cmake/ie_parallel.cmake b/inference-engine/cmake/ie_parallel.cmake
index 9ea885be..71733fd9 100644
--- a/inference-engine/cmake/ie_parallel.cmake
+++ b/inference-engine/cmake/ie_parallel.cmake
@@ -42,14 +42,8 @@ function(set_ie_threading_interface_for TARGET_NAME)
set(IE_THREAD_DEFINE "IE_THREAD_SEQ")
if (THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
- find_package(TBB COMPONENTS tbb tbbmalloc)
- if (TBB_FOUND)
- set(IE_THREAD_DEFINE "IE_THREAD_TBB")
- ie_target_link_libraries(${TARGET_NAME} PUBLIC ${TBB_IMPORTED_TARGETS})
- else ()
- ext_message(WARNING "TBB was not found by the configured TBB_DIR path. \
- SEQ method will be used for ${TARGET_NAME}")
- endif ()
+ set(IE_THREAD_DEFINE "IE_THREAD_TBB")
+ target_link_libraries(${TARGET_NAME} PUBLIC tbb tbbmalloc)
elseif (THREADING STREQUAL "OMP")
if (WIN32)
set(omp_lib_name libiomp5md)
diff --git a/inference-engine/include/gpu/gpu_ocl_wrapper.hpp b/inference-engine/include/gpu/gpu_ocl_wrapper.hpp
index fce7d8f1..827e5764 100644
--- a/inference-engine/include/gpu/gpu_ocl_wrapper.hpp
+++ b/inference-engine/include/gpu/gpu_ocl_wrapper.hpp
@@ -21,4 +21,4 @@
# pragma GCC system_header
#endif
-#include <CL/cl2.hpp>
+#include <cl2.hpp>
diff --git a/inference-engine/samples/CMakeLists.txt b/inference-engine/samples/CMakeLists.txt
index f355e7b9..d24c7c78 100644
--- a/inference-engine/samples/CMakeLists.txt
+++ b/inference-engine/samples/CMakeLists.txt
@@ -24,7 +24,7 @@ endif()
if(IE_MAIN_SOURCE_DIR)
# in case if samples are built from IE repo
- set(IE_MAIN_SAMPLES_DIR ${OpenVINO_MAIN_SOURCE_DIR})
+ set(IE_MAIN_SAMPLES_DIR ${CMAKE_BINARY_DIR})
# hint for find_package(InferenceEngine in the samples folder)
set(InferenceEngine_DIR "${CMAKE_BINARY_DIR}")
else()
@@ -91,10 +91,6 @@ set (HAVE_INTTYPES_H 1)
set (INTTYPES_FORMAT C99)
set (BUILD_TESTING OFF)
-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags")
- add_subdirectory(thirdparty/gflags)
-endif()
-
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
@@ -203,6 +199,8 @@ macro(ie_add_sample)
if(COMMAND add_cpplint_target AND NOT IE_SAMPLE_EXCLUDE_CPPLINT)
add_cpplint_target(${IE_SAMPLE_NAME}_cpplint FOR_TARGETS ${IE_SAMPLE_NAME})
endif()
+
+ install(TARGETS ${IE_SAMPLE_NAME} DESTINATION bin)
endmacro()
# collect all samples subdirectories
diff --git a/inference-engine/samples/common/format_reader/CMakeLists.txt b/inference-engine/samples/common/format_reader/CMakeLists.txt
index 6d935135..fe12eeb7 100644
--- a/inference-engine/samples/common/format_reader/CMakeLists.txt
+++ b/inference-engine/samples/common/format_reader/CMakeLists.txt
@@ -40,3 +40,5 @@ target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/..")
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME})
+
+install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/inference-engine/src/cldnn_engine/CMakeLists.txt b/inference-engine/src/cldnn_engine/CMakeLists.txt
index 43344e7f..50beda23 100644
--- a/inference-engine/src/cldnn_engine/CMakeLists.txt
+++ b/inference-engine/src/cldnn_engine/CMakeLists.txt
@@ -32,6 +32,7 @@ target_include_directories(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CLDNN__IOCL_ICD_INCDIRS}
${CLDNN_TOP_FOLDER}
+ ${CLDNN_TOP_FOLDER}/common/khronos_ocl_clhpp
${IE_MAIN_SOURCE_DIR}/thirdparty/pugixml/src)
# copy default global xml file describing the custom kernels and the *.cl files
diff --git a/inference-engine/src/inference_engine/CMakeLists.txt b/inference-engine/src/inference_engine/CMakeLists.txt
index 54e264c8..e3809654 100644
--- a/inference-engine/src/inference_engine/CMakeLists.txt
+++ b/inference-engine/src/inference_engine/CMakeLists.txt
@@ -292,20 +292,6 @@ if(threading_tbb)
ie_cpack_add_component(tbb REQUIRED)
list(APPEND core_components tbb)
- install(DIRECTORY "${TBB}/include"
- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb
- COMPONENT tbb)
- install(DIRECTORY "${TBB}/lib"
- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb
- COMPONENT tbb)
- if(EXISTS "${TBB}/bin")
- install(DIRECTORY "${TBB}/bin"
- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb
- COMPONENT tbb)
- endif()
- install(FILES "${TBB}/LICENSE"
- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb
- COMPONENT tbb)
endif()
ie_cpack_add_component(core REQUIRED DEPENDS ${core_components})
@@ -318,10 +304,9 @@ install(TARGETS ${TARGET_NAME} ${TARGET_NAME}_nn_builder
LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH}
COMPONENT core)
install(FILES "${OpenVINO_BINARY_DIR}/share/ie_parallel.cmake"
- "${OpenVINO_BINARY_DIR}/share/ie_rh_decoder.cmake"
"${OpenVINO_BINARY_DIR}/share/InferenceEngineConfig.cmake"
"${OpenVINO_BINARY_DIR}/share/InferenceEngineConfig-version.cmake"
- DESTINATION ${IE_CPACK_IE_DIR}/share
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/InferenceEngine
COMPONENT core)
install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml
DESTINATION ${IE_CPACK_LIBRARY_PATH}
diff --git a/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt b/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
index 32cb534a..858ffefc 100644
--- a/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
+++ b/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
@@ -41,5 +41,5 @@ target_link_libraries(${TARGET_NAME}
# install
install(FILES ${IE_MAIN_SOURCE_DIR}/thirdparty/movidius/mvnc/src/97-myriad-usbboot.rules
- DESTINATION deployment_tools/inference_engine/external
+ DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/udev/rules.d
COMPONENT myriad)
diff --git a/inference-engine/tests/mock_engine/CMakeLists.txt b/inference-engine/tests/mock_engine/CMakeLists.txt
index f3fb53e1..09fb66ce 100644
--- a/inference-engine/tests/mock_engine/CMakeLists.txt
+++ b/inference-engine/tests/mock_engine/CMakeLists.txt
@@ -38,3 +38,5 @@ target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLU
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET ${TARGET_NAME} PROPERTY COMPILE_PDB_NAME ${TARGET_NAME})
+
+install(TARGETS ${TARGET_NAME} EXPORT ${TARGET_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/inference-engine/tests/unit/CMakeLists.txt b/inference-engine/tests/unit/CMakeLists.txt
index a5c945ae..eabe70d3 100644
--- a/inference-engine/tests/unit/CMakeLists.txt
+++ b/inference-engine/tests/unit/CMakeLists.txt
@@ -187,3 +187,5 @@ add_test(NAME ${TARGET_NAME}
COMMAND ${TARGET_NAME})
add_dependencies(${TARGET_NAME} mock_engine)
+
+install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/inference-engine/thirdparty/CMakeLists.txt b/inference-engine/thirdparty/CMakeLists.txt
index ec22761d..3962d924 100644
--- a/inference-engine/thirdparty/CMakeLists.txt
+++ b/inference-engine/thirdparty/CMakeLists.txt
@@ -35,14 +35,12 @@ function(build_with_lto)
add_subdirectory(clDNN)
endif()
- add_subdirectory(pugixml)
add_subdirectory(stb_lib)
- add_subdirectory(ade)
add_subdirectory(fluid/modules/gapi)
# developer package
- ie_developer_export_targets(ade fluid pugixml)
+ ie_developer_export_targets(fluid)
if(TARGET pugixml_mt)
ie_developer_export_targets(pugixml_mt)
endif()
diff --git a/inference-engine/thirdparty/clDNN/CMakeCompilerLinkerOpts.txt b/inference-engine/thirdparty/clDNN/CMakeCompilerLinkerOpts.txt
index 6b799cdd..91755b35 100644
--- a/inference-engine/thirdparty/clDNN/CMakeCompilerLinkerOpts.txt
+++ b/inference-engine/thirdparty/clDNN/CMakeCompilerLinkerOpts.txt
@@ -206,7 +206,6 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ALIAS RttiDisabled "-fno-rtti"
ALIAS RttiEnabled "-frtti"
ALIAS TreatWarnAsErrorDisabled TreatWarnAsError REMOVE_GROUP
- ALIAS TreatWarnAsErrorEnabled "-Werror" "-pedantic-errors"
ALIAS WarnLevel0 "-w"
ALIAS WarnLevel1 WarnLevels REMOVE_GROUP
ALIAS WarnLevel2 "-Wall"
@@ -290,7 +289,6 @@ elseif((CMAKE_C_COMPILER_ID MATCHES "^Clang$") OR (CMAKE_CXX_COMPILER_ID MATCHES
ALIAS RttiDisabled "-fno-rtti"
ALIAS RttiEnabled Rtti REMOVE_GROUP
ALIAS TreatWarnAsErrorDisabled TreatWarnAsError REMOVE_GROUP
- ALIAS TreatWarnAsErrorEnabled "-Werror"
ALIAS WarnLevel0 "-w"
ALIAS WarnLevel1 WarnLevels REMOVE_GROUP
ALIAS WarnLevel2 "-Wall"
diff --git a/inference-engine/thirdparty/clDNN/CMakeLists.txt b/inference-engine/thirdparty/clDNN/CMakeLists.txt
index b08c2744..42ca79e6 100644
--- a/inference-engine/thirdparty/clDNN/CMakeLists.txt
+++ b/inference-engine/thirdparty/clDNN/CMakeLists.txt
@@ -767,7 +767,6 @@ foreach(__CLDNN_CompilerFlagName IN ITEMS "CMAKE_CXX_FLAGS" "CMAKE_C_FLAGS")
MultiProcessorCompilation
DeadCodeEliminate
ExtensionsEnabled
- TreatWarnAsErrorEnabled
WarnLevel4
NoFastMath
StackProtector
diff --git a/inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp b/inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp
index a9e379bd..8b822223 100644
--- a/inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp
+++ b/inference-engine/thirdparty/clDNN/common/khronos_ocl_clhpp/cl2_ext.hpp
@@ -30,7 +30,7 @@ typedef cl_d3d11_device_set_khr cl_device_set_intel;
typedef cl_va_api_device_source_intel cl_device_source_intel;
typedef cl_va_api_device_set_intel cl_device_set_intel;
#endif
-#include <CL/cl_intel_planar_yuv.h>
+#include <CL/cl_ext_intel.h>
namespace cl {
typedef CL_API_ENTRY cl_int(CL_API_CALL *PFN_clEnqueueAcquireMediaSurfacesINTEL)(
diff --git a/inference-engine/tools/compile_tool/CMakeLists.txt b/inference-engine/tools/compile_tool/CMakeLists.txt
index 25168bac..1c57116f 100644
--- a/inference-engine/tools/compile_tool/CMakeLists.txt
+++ b/inference-engine/tools/compile_tool/CMakeLists.txt
@@ -48,5 +48,5 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
# install
install(TARGETS compile_tool
- RUNTIME DESTINATION ${IE_CPACK_LIBRARY_PATH}
+ RUNTIME DESTINATION bin
COMPONENT core)
diff --git a/inference-engine/tools/vpu/vpu_compile/CMakeLists.txt b/inference-engine/tools/vpu/vpu_compile/CMakeLists.txt
index 4123de6f..52179fac 100644
--- a/inference-engine/tools/vpu/vpu_compile/CMakeLists.txt
+++ b/inference-engine/tools/vpu/vpu_compile/CMakeLists.txt
@@ -50,5 +50,5 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
# install
install(TARGETS ${TARGET_NAME}
- RUNTIME DESTINATION ${IE_CPACK_LIBRARY_PATH}
- COMPONENT myriad)
\ No newline at end of file
+ RUNTIME DESTINATION bin
+ COMPONENT myriad)
diff --git a/inference-engine/tools/vpu/vpu_perfcheck/CMakeLists.txt b/inference-engine/tools/vpu/vpu_perfcheck/CMakeLists.txt
index a7a801d4..b8f9e26f 100644
--- a/inference-engine/tools/vpu/vpu_perfcheck/CMakeLists.txt
+++ b/inference-engine/tools/vpu/vpu_perfcheck/CMakeLists.txt
@@ -55,6 +55,6 @@ if(ENABLE_MYRIAD)
add_perfcheck_target(myriad_perfcheck myriadPlugin)
install(TARGETS myriad_perfcheck
- RUNTIME DESTINATION ${IE_CPACK_LIBRARY_PATH}
+ RUNTIME DESTINATION bin
COMPONENT myriad)
endif()
--
2.25.2