From 77f5a265345d7f1cadbd2123d73b833508b91c5c Mon Sep 17 00:00:00 2001 From: Vitaly Tuzov Date: Mon, 24 May 2021 12:58:33 +0300 Subject: [PATCH] Arm pluging cross-compilation dockerfile for Debian Buster (#136) --- modules/arm_plugin/Dockerfile.RPi32_buster | 89 +++++++++++++++++++ ...kerfile.RPi32 => Dockerfile.RPi32_stretch} | 0 ...ckerfile.RPi64 => Dockerfile.RPi64_bionic} | 0 modules/arm_plugin/README.md | 6 +- modules/arm_plugin/armplg_build.sh | 1 - 5 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 modules/arm_plugin/Dockerfile.RPi32_buster rename modules/arm_plugin/{Dockerfile.RPi32 => Dockerfile.RPi32_stretch} (100%) rename modules/arm_plugin/{Dockerfile.RPi64 => Dockerfile.RPi64_bionic} (100%) diff --git a/modules/arm_plugin/Dockerfile.RPi32_buster b/modules/arm_plugin/Dockerfile.RPi32_buster new file mode 100644 index 00000000000000..706e65d62cb70c --- /dev/null +++ b/modules/arm_plugin/Dockerfile.RPi32_buster @@ -0,0 +1,89 @@ +#This Dockerfile is for x86 and should be used for OpenVINO ARM plugin cross-compilation +#https://github.com/openvinotoolkit/openvino_contrib/tree/master/modules/arm_plugin#how-to-build + +FROM debian:10 + +ENV DEBIAN_FRONTEND noninteractive +ENV PAKAGE_UPDATES_OF 20210505 + +#Prerequisite installation +RUN apt-get update && \ + apt-get -y upgrade && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + lsb-release \ + nano \ + wget \ + curl \ + nano \ + tar \ + bzip2 \ + unzip \ + cpio \ + cifs-utils \ + locales \ + rsync \ + apt-transport-https \ + debian-archive-keyring \ + sudo \ + openssh-client \ + default-jre \ + p7zip-full \ + software-properties-common \ + dirmngr \ + gnupg \ + netcat-openbsd \ + dh-autoreconf \ + libcurl4-gnutls-dev \ + libexpat1-dev \ + gettext \ + libz-dev \ + libssl-dev \ + build-essential \ + git-lfs \ + cmake \ + && \ + locale-gen en_US.UTF-8 && \ + rm -rf /var/lib/apt/lists/* + +RUN dpkg --add-architecture armhf && \ + apt-get update && \ + apt-get install -y --no-install-recommends -f -o Dpkg::Options::="--force-confnew" \ + build-essential \ + libusb-1.0-0-dev:armhf \ + software-properties-common \ + crossbuild-essential-armhf \ + zlib1g-dev \ + libffi-dev \ + libssl-dev \ + chrpath \ + libssl-dev \ + libprotobuf-dev \ + libprotoc-dev \ + protobuf-compiler \ + python3-dev \ + python3-numpy \ + python3-pip \ + libpython3-dev:armhf \ + libgtk-3-dev:armhf \ + libavcodec-dev:armhf \ + libavformat-dev:armhf \ + libswscale-dev:armhf \ + # For ARM CPU plugin + scons \ + && \ + pip3 install cython && \ + rm -rf /var/lib/apt/lists/* + +RUN git config --global user.name "Your Name" && \ + git config --global user.email "you@example.com" + +ENV ARCH_NAME arm-linux-gnueabihf +ENV TOOLCHAIN_DEFS arm.toolchain.cmake +COPY armplg_build.sh /armplg_build.sh + +#configure paths +RUN mkdir -p /armcpu_plugin +WORKDIR /armcpu_plugin/ + +CMD ["sh", "/armplg_build.sh"] diff --git a/modules/arm_plugin/Dockerfile.RPi32 b/modules/arm_plugin/Dockerfile.RPi32_stretch similarity index 100% rename from modules/arm_plugin/Dockerfile.RPi32 rename to modules/arm_plugin/Dockerfile.RPi32_stretch diff --git a/modules/arm_plugin/Dockerfile.RPi64 b/modules/arm_plugin/Dockerfile.RPi64_bionic similarity index 100% rename from modules/arm_plugin/Dockerfile.RPi64 rename to modules/arm_plugin/Dockerfile.RPi64_bionic diff --git a/modules/arm_plugin/README.md b/modules/arm_plugin/README.md index c6527d82d0895f..54a52b7964d925 100644 --- a/modules/arm_plugin/README.md +++ b/modules/arm_plugin/README.md @@ -8,6 +8,7 @@ OpenVINO™ ARM CPU plugin is supported and validated on the following platforms Host | OS ------------- | ------------- +Raspberry Pi* 4 Model B | Debian* 9 (32-bit) Raspberry Pi* 4 Model B | Debian* 10.3 (32-bit) Raspberry Pi* 4 Model B | Ubuntu* 18.04 (64-bit) @@ -16,7 +17,8 @@ OpenVINO™ ARM CPU plugin is not included into Intel® Distribution of OpenVINO ## How to build ### Approach #1: build OpenCV, OpenVINO™ and the plugin using pre-configured Dockerfile (cross-compiling, the preferred way) -OpenVINO™ and ARM CPU plugin could be built in Docker* container for [32-bit](Dockerfile.RPi32) Debian* and [64-bit](Dockerfile.RPi64) Ubuntu*: +OpenVINO™ and ARM CPU plugin could be built in Docker* container for 32-bit Debian* [Stretch](Dockerfile.RPi32_stretch), +[Buster](Dockerfile.RPi32_buster) and [64-bit](Dockerfile.RPi64_bionic) Ubuntu*: 1. Clone `openvino_contrib` repository: ``` @@ -28,7 +30,7 @@ cd openvino_contrib/modules/arm_plugin ``` 3. Build a Docker* image: ``` -docker image build -t arm-plugin -f Dockerfile.RPi32 . +docker image build -t arm-plugin -f Dockerfile.RPi32_buster . ``` 4. Build the plugin in Docker* container: diff --git a/modules/arm_plugin/armplg_build.sh b/modules/arm_plugin/armplg_build.sh index 9b80e4e75a5350..c85f69a3bc3ed4 100644 --- a/modules/arm_plugin/armplg_build.sh +++ b/modules/arm_plugin/armplg_build.sh @@ -94,7 +94,6 @@ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_LIST=imgcodecs,videoio,highgui,gapi -DPYTHON3_LIMITED_API=ON -DPYTHON3_PACKAGES_PATH=$STAGING_DIR/opencv/python \ -DPYTHON3_INCLUDE_PATH=/usr/include/${PYTHONVER}m \ -DPYTHON3_LIBRARIES=/usr/lib/$ARCH_NAME/lib${PYTHONVER}m.so \ - -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include \ -D CMAKE_USE_RELATIVE_PATHS=ON \ -D CMAKE_SKIP_INSTALL_RPATH=ON \ -D OPENCV_SKIP_PKGCONFIG_GENERATION=ON \