-From 9f1b68a48c93b01bf4ed61a96dafa7f1ac3ca2a5 Mon Sep 17 00:00:00 2001
+From c5776b1c367ef19574166e6562f930125789ae97 Mon Sep 17 00:00:00 2001
From: Wook Song <wook16.song@samsung.com>
Date: Wed, 13 Nov 2019 14:45:42 +0900
-Subject: [PATCH 1/3] [CMake] Do not call get_linux_name when LINUX_OS_NAME is
+Subject: [PATCH 1/2] [CMake] Do not call get_linux_name when LINUX_OS_NAME is
provided
In order to handle other OS platforms that are not compatible with the
function, get_linux_name, in dependencies.cmake, this patch makes this
function be not invoked when LINUX_OS_NAME is provided from outside.
+Change-Id: I19f7bde8d4175997cb9df31810595aa4ccbca460
Signed-off-by: Wook Song <wook16.song@samsung.com>
---
inference-engine/cmake/dependencies.cmake | 8 +++++---
--- /dev/null
+From 5ffd669730e185d4e7f2d4c56a701d035f2186b6 Mon Sep 17 00:00:00 2001
+From: Wook Song <wook16.song@samsung.com>
+Date: Mon, 6 Jan 2020 18:44:39 +0900
+Subject: [PATCH 1/1] [VPU/CMake] Add a cmake option to skip downloading MVNC
+ firmwares
+
+In order to build via GBS/OBS (Tizen) or pdebuild/debuild (Ubuntu),
+which does not support resolving dependencies via network, this patch
+adds a cmake option to skip downloading MVNC firmwares while building
+the inference-engine and its VPU plugin.
+
+Change-Id: I913cd3fc59c5ebada0f7d11ebc55a7df9f2537a8
+Signed-off-by: Wook Song <wook16.song@samsung.com>
+---
+ inference-engine/cmake/dependencies.cmake | 6 +++++-
+ inference-engine/src/vpu/myriad_plugin/CMakeLists.txt | 4 +++-
+ inference-engine/thirdparty/movidius/XLink/CMakeLists.txt | 4 +++-
+ 3 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/inference-engine/cmake/dependencies.cmake b/inference-engine/cmake/dependencies.cmake
+index 682f2e55..aa5d76c9 100644
+--- a/inference-engine/cmake/dependencies.cmake
++++ b/inference-engine/cmake/dependencies.cmake
+@@ -17,7 +17,11 @@ if(COMMAND get_linux_name)
+ endif()
+
+ if (ENABLE_MYRIAD)
+- include(vpu_dependencies)
++ if (USE_MYRIAD_SYSTEM_DEPS)
++ message(STATUS "Use MVNC firmware provided by other packages or pre-installed in the system")
++ else ()
++ include(vpu_dependencies)
++ endif ()
+ endif()
+
+ ## enable cblas_gemm from OpenBLAS package
+diff --git a/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt b/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
+index 7023513d..7a2c9da7 100644
+--- a/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
++++ b/inference-engine/src/vpu/myriad_plugin/CMakeLists.txt
+@@ -11,7 +11,9 @@ ie_add_plugin(NAME ${TARGET_NAME}
+ SOURCES ${SOURCES}
+ VERSION_DEFINES_FOR api/myriad_api.cpp)
+
+-add_dependencies(${TARGET_NAME} vpu_copy_firmware)
++if (NOT USE_MYRIAD_SYSTEM_DEPS)
++ add_dependencies(${TARGET_NAME} vpu_copy_firmware)
++endif ()
+ if(TARGET vpu_compile_custom_kernels)
+ add_dependencies(${TARGET_NAME} vpu_compile_custom_kernels)
+ endif()
+diff --git a/inference-engine/thirdparty/movidius/XLink/CMakeLists.txt b/inference-engine/thirdparty/movidius/XLink/CMakeLists.txt
+index 658081f4..96424502 100644
+--- a/inference-engine/thirdparty/movidius/XLink/CMakeLists.txt
++++ b/inference-engine/thirdparty/movidius/XLink/CMakeLists.txt
+@@ -57,6 +57,8 @@ if (ENABLE_MYRIAD_NO_BOOT)
+ NO_BOOT)
+ endif()
+
+-add_dependencies(${TARGET_NAME} vpu_copy_firmware)
++if (NOT USE_MYRIAD_SYSTEM_DEPS)
++ add_dependencies(${TARGET_NAME} vpu_copy_firmware)
++endif ()
+
+ set_property(TARGET ${TARGET_NAME} PROPERTY C_STANDARD 99)
+--
+2.17.1
+
Source1003: openvino.pc.in
Patch0: 0001-CMake-Do-not-call-get_linux_name-when-LINUX_OS_NAME-.patch
Patch1: 0002-CMake-Add-a-variable-to-resolve-dependency-on-TBB-us.patch
+Patch2: 0003-VPU-CMake-Add-a-cmake-option-to-skip-downloading-MVN.patch
BuildRequires: cmake
BuildRequires: pkgconfig(libtbb)
+BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkg-config
%description
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
cp %{SOURCE1} .
cp %{SOURCE1001} ./inference-engine/thirdparty
cp %{SOURCE1002} ./inference-engine/thirdparty
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
-DLIB_INSTALL_DIR:PATH=%{_libdir} -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \
- %{?_cmake_skip_rpath} \
- -DBUILD_SHARED_LIBS:BOOL=ON \
- -DUSE_TBB_SYSTEM_DEPS=ON -DBUILD_ADE_DOCUMENTATION=OFF -DBUILD_ADE_TUTORIAL=OFF \
+ %{?_cmake_skip_rpath} -DUSE_TBB_SYSTEM_DEPS=ON -DUSE_MYRIAD_SYSTEM_DEPS=ON \
+ -DENABLE_VPU=ON -DENABLE_MYRIAD=ON -DENABLE_MYRIAD_MVNC_TESTS=OFF -DENABLE_MYRIAD_NO_BOOT=OFF \
+ -DBUILD_ADE_DOCUMENTATION=OFF -DBUILD_ADE_TUTORIAL=OFF \
-DBUILD_PKGCONFIG=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_TESTS=OFF \
-DCLDNN__INCLUDE_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCOVERAGE=OFF \
- -DDEVELOPMENT_PLUGIN_MODE=OFF -DENABLE_VPU=OFF -DENABLE_ADE_TESTING=OFF \
+ -DDEVELOPMENT_PLUGIN_MODE=OFF-DENABLE_ADE_TESTING=OFF \
-DENABLE_AFFINITY_GENERATOR=OFF -DENABLE_ALTERNATIVE_TEMP=OFF -DENABLE_CLDNN=OFF \
-DENABLE_CLDNN_BUILD=OFF -DENABLE_CLDNN_TESTS=OFF -DENABLE_CPPCHECK=OFF -DENABLE_CPPLINT=OFF \
-DENABLE_CPPLINT_REPORT=OFF -DENABLE_CPP_CCT=OFF -DENABLE_DEBUG_SYMBOLS=OFF \
-DENABLE_FUZZING=OFF -DENABLE_GAPI_TESTS=OFF -DENABLE_GNA=OFF -DENABLE_LTO=OFF \
- -DENABLE_MKL_DNN=OFF -DENABLE_MYRIAD=OFF -DENABLE_MYRIAD_MVNC_TESTS=OFF -DENABLE_MYRIAD_NO_BOOT=OFF \
+ -DENABLE_MKL_DNN=OFF \
-DENABLE_OBJECT_DETECTION_TESTS=ON -DENABLE_OPENCV=OFF -DENABLE_PLUGIN_RPATH=OFF \
-DENABLE_PROFILING_ITT=OFF -DENABLE_PROFILING_RAW=OFF -DENABLE_PYTHON=OFF -DENABLE_ROCKHOPER=OFF \
-DENABLE_SAMPLES=OFF -DENABLE_SAMPLES_CORE=OFF -DENABLE_SEGMENTATION_TESTS=OFF -DENABLE_TESTS=ON \
pushd inference-engine/bin/%{install_arch}/Release
install -m 644 lib/*.so %{buildroot}%{_libdir}
install -m 644 lib/*.xml %{buildroot}%{_libdir}
-install -m 644 lib/libngraph.a %{buildroot}%{_libdir}
-install -m 644 lib/libinference_engine_s.a %{buildroot}%{_libdir}
-install -m 644 lib/libhelpers.a %{buildroot}%{_libdir}
-install -m 644 lib/libpugixml.a %{buildroot}%{_libdir}
-install -m 644 lib/libfluid.a %{buildroot}%{_libdir}
+rm -rf lib/libstb_image.a
+rm -rf lib/libgflags_nothreads.a
+rm -rf lib/libgtest_main.a
+rm -rf lib/libgtest.a
+rm -rf lib/libgmock_main.a
+rm -rf lib/libgmock.a
+install -m 644 lib/*.a %{buildroot}%{_libdir}
popd
mkdir -p %{buildroot}%{_includedir}