3 export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
4 export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
5 export DEB_CXXFLAGS_MAINT_APPEND ?= -std=c++11
6 export SRC_ROOT ?= $(shell pwd)
10 EXTERNAL_ADE_ARCHIVE := ade-cbe2db61a659c2cc304c3837406f95c39dfa938e
11 EXTERNAL_NGRAPH_ARCHIVE := ngraph-0.22.0-rc.2
12 EXTERNAL_TBB_ARCHIVE := tbb_2019~U9
13 EXTERNAL_TBB_SRC_ROOT := $(SRC_ROOT)/inference-engine/temp/tbb
14 EXTERNAL_TBB_SRC_PATCH0 := 0001-Local-Makefile-Skip-test-to-speed-up-the-build-time.patch
15 EXTERNAL_DEVKIT_ROOT := $(SRC_ROOT)/inference-engine/temp/out
17 LIBDIR := lib/${DEB_HOST_MULTIARCH}
20 DATADIR := $(PREFIX)/share
21 DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
22 VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[~-].*//')
24 ifneq ($(filter $(DEB_HOST_ARCH),amd64),)
33 dh $@ --with quilt --parallel
36 echo "Preparing tbb_2019~U9......"
37 rm -rf $(SRC_ROOT)/inference-engine/temp && mkdir -p $(SRC_ROOT)/inference-engine/temp
38 cp $(SRC_ROOT)/packaging/$(EXTERNAL_TBB_ARCHIVE).tar.gz $(SRC_ROOT)/inference-engine/temp
39 cd $(SRC_ROOT)/inference-engine/temp && tar zxvf $(EXTERNAL_TBB_ARCHIVE).tar.gz && rm -f *.tar.gz
40 cp $(SRC_ROOT)/debian/tbb_patches/*.patch $(EXTERNAL_TBB_SRC_ROOT)
41 patch -d $(EXTERNAL_TBB_SRC_ROOT) -p1 < $(EXTERNAL_TBB_SRC_ROOT)/$(EXTERNAL_TBB_SRC_PATCH0)
42 cd $(EXTERNAL_TBB_SRC_ROOT) && LDFLAGS="" $(MAKE) tbb_build_prefix=ubuntu_$(DEB_HOST_ARCH) extra_inc=big_iron.inc -j$(nproc)
43 mkdir -p $(EXTERNAL_DEVKIT_ROOT)
44 mkdir -p $(EXTERNAL_DEVKIT_ROOT)/include
45 mkdir -p $(EXTERNAL_DEVKIT_ROOT)/lib
46 cd $(SRC_ROOT)/inference-engine/temp/tbb/build/ubuntu_$(DEB_HOST_ARCH)_release && \
47 install -m 644 *.a $(EXTERNAL_DEVKIT_ROOT)/lib
48 cp -rf $(SRC_ROOT)/inference-engine/temp/tbb/include/tbb $(EXTERNAL_DEVKIT_ROOT)/include
51 override_dh_auto_configure: prepare_tbb
52 cp $(SRC_ROOT)/packaging/$(EXTERNAL_ADE_ARCHIVE).tar.gz $(SRC_ROOT)/inference-engine/thirdparty
53 cp $(SRC_ROOT)/packaging/$(EXTERNAL_NGRAPH_ARCHIVE).tar.gz $(SRC_ROOT)/inference-engine/thirdparty
54 cd $(SRC_ROOT)/inference-engine/thirdparty && \
55 tar zxf $(EXTERNAL_ADE_ARCHIVE).tar.gz && \
56 mv $(EXTERNAL_ADE_ARCHIVE)/* ade/
57 cd $(SRC_ROOT)/inference-engine/thirdparty && \
58 tar zxf $(EXTERNAL_NGRAPH_ARCHIVE).tar.gz && \
59 mv $(EXTERNAL_NGRAPH_ARCHIVE)/* ngraph/
60 cd $(SRC_ROOT)/inference-engine/thirdparty && \
61 rm -rf *.tar.gz $(EXTERNAL_ADE_ARCHIVE)
62 cd $(SRC_ROOT)/inference-engine/thirdparty && \
63 rm -rf *.tar.gz $(EXTERNAL_NGRAPH_ARCHIVE)
64 cd $(SRC_ROOT)/inference-engine && rm -rf build && mkdir -p build
65 cd $(SRC_ROOT)/inference-engine/build && cmake .. \
66 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX:PATH=$(PREFIX) \
67 -DCMAKE_INSTALL_LIBDIR:PATH=$(LIBDIR) -DINCLUDE_INSTALL_DIR:PATH=$(INCDIR) \
68 -DLIB_INSTALL_DIR:PATH=$(LIBDIR) -DSYSCONF_INSTALL_DIR:PATH=$(SYSCONFDIR) \
69 -DSHARE_INSTALL_PREFIX:PATH=$(DATADIR) \
70 -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_ALTERNATIVE_TEMP=OFF \
71 -DUSE_TBB_IN_HOUSE_STATIC_BUILD:PATH=$(EXTERNAL_DEVKIT_ROOT) -DUSE_MYRIAD_SYSTEM_DEPS=ON \
72 -DENABLE_VPU=ON -DENABLE_MYRIAD=ON -DENABLE_MYRIAD_MVNC_TESTS=OFF -DENABLE_MYRIAD_NO_BOOT=OFF \
73 -DENABLE_MKL_DNN=$(ENABLE_MKL_DNN) -DENABLE_SSE42=$(ENABLE_SSE42) -DENABLE_GNA=OFF \
74 -DBUILD_ADE_DOCUMENTATION=OFF -DBUILD_ADE_TUTORIAL=OFF \
75 -DBUILD_TESTING=OFF -DBUILD_TESTS=OFF \
76 -DCLDNN__INCLUDE_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCOVERAGE=OFF \
77 -DDEVELOPMENT_PLUGIN_MODE=OFF -DENABLE_ADE_TESTING=OFF \
78 -DENABLE_AFFINITY_GENERATOR=OFF -DENABLE_CLDNN=OFF -DBUILD_PKGCONFIG=OFF \
79 -DENABLE_CLDNN_BUILD=OFF -DENABLE_CLDNN_TESTS=OFF -DENABLE_CPPCHECK=OFF -DENABLE_CPPLINT=OFF \
80 -DENABLE_CPPLINT_REPORT=OFF -DENABLE_CPP_CCT=OFF -DENABLE_DEBUG_SYMBOLS=OFF \
81 -DENABLE_FUZZING=OFF -DENABLE_GAPI_TESTS=OFF -DENABLE_LTO=OFF \
82 -DENABLE_OBJECT_DETECTION_TESTS=ON -DENABLE_OPENCV=OFF -DENABLE_PLUGIN_RPATH=OFF \
83 -DENABLE_PROFILING_ITT=OFF -DENABLE_PROFILING_RAW=OFF -DENABLE_PYTHON=OFF -DENABLE_ROCKHOPER=OFF \
84 -DENABLE_SAMPLES=OFF -DENABLE_SAMPLES_CORE=OFF -DENABLE_SEGMENTATION_TESTS=OFF -DENABLE_TESTS=ON \
85 -DTREAT_WARNING_AS_ERROR=OFF
87 override_dh_auto_build:
88 dh_auto_build --builddirectory=$(SRC_ROOT)/inference-engine/build --
90 override_dh_auto_install:
91 mkdir -p $(SRC_ROOT)/debian/tmp$(PREFIX)/$(LIBDIR)
92 mkdir -p $(SRC_ROOT)/debian/tmp$(PREFIX)/$(INCDIR)
93 mkdir -p debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig
94 find $(SRC_ROOT)/inference-engine/bin -name "*.so" -exec install -m 644 {} $(SRC_ROOT)/debian/tmp$(PREFIX)/$(LIBDIR) \;
95 find $(SRC_ROOT)/inference-engine/bin -name "plugins.xml" -exec install -m 644 {} $(SRC_ROOT)/debian/tmp$(PREFIX)/$(LIBDIR) \;
96 cp -r $(SRC_ROOT)/inference-engine/include/* $(SRC_ROOT)/debian/tmp$(PREFIX)/$(INCDIR)
97 find $(SRC_ROOT)/inference-engine/bin -name "*.a" -exec install -m 644 {} $(SRC_ROOT)/debian/tmp$(PREFIX)/$(LIBDIR) \;
98 cp -f $(SRC_ROOT)/packaging/openvino.pc.in debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig
99 sed -i 's|@VERSION@|$(VERSION)|g' debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/openvino.pc.in
100 sed -i 's|@PREFIX@|$(PREFIX)|g' debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/openvino.pc.in
101 sed -i 's|@LIB_INSTALL_DIR@|$(PREFIX)/$(LIBDIR)|g' debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/openvino.pc.in
102 sed -i 's|@INCLUDE_INSTALL_DIR@|$(PREFIX)/$(INCDIR)|g' debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/openvino.pc.in
103 mv debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/openvino.pc.in debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/openvino.pc
104 ifneq ($(filter $(DEB_HOST_ARCH),amd64),)
105 cp -r $(SRC_ROOT)/inference-engine/src/extension/ext_list.hpp $(SRC_ROOT)/debian/tmp$(PREFIX)/$(INCDIR)
108 override_dh_auto_clean:
109 dh_auto_clean --builddirectory=$(SRC_ROOT)/inference-engine/build --
110 rm -rf $(SRC_ROOT)/inference-engine/bin
111 rm -rf $(SRC_ROOT)/inference-engine/build
112 rm -rf $(SRC_ROOT)/debian/tmp
113 rm -rf $(SRC_ROOT)/inference-engine/thirdparty/ade/*
114 rm -rf $(SRC_ROOT)/inference-engine/thirdparty/ngraph/*