Skip to content

Commit

Permalink
Arm pluging cross-compilation dockerfile for Debian Buster (openvinot…
Browse files Browse the repository at this point in the history
  • Loading branch information
terfendail authored May 24, 2021
1 parent d033fca commit 77f5a26
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 3 deletions.
89 changes: 89 additions & 0 deletions modules/arm_plugin/Dockerfile.RPi32_buster
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"

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"]
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions modules/arm_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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:
```
Expand All @@ -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:

Expand Down
1 change: 0 additions & 1 deletion modules/arm_plugin/armplg_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 77f5a26

Please sign in to comment.