-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
112 lines (100 loc) · 4.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
###################################################################################################
# Build OpenVino Runtime
###################################################################################################
FROM --platform=amd64 debian:11 as ov-build
ARG TARGETARCH
ENV TARGETARCH ${TARGETARCH}
ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture arm64 && \
apt-get -qq update && \
apt-get install -y \
git build-essential cmake ninja-build \
python3.9 libpython3-dev python3-pip \
python3-venv python3-enchant python-argparse \
pkg-config unzip automake libtool autoconf \
ccache curl wget unzip lintian file gzip \
patchelf shellcheck \
libssl-dev ca-certificates \
protobuf-compiler \
git-lfs \
# ARM64 Support Packages
crossbuild-essential-arm64 \
libusb-1.0-0-dev:arm64 \
libtbb-dev:arm64 libtbb2:arm64 \
libgtk-3-dev:arm64 \
libavcodec-dev:arm64 \
libavformat-dev:arm64 \
libswscale-dev:arm64 \
libgstreamer1.0-dev:arm64 \
libgstreamer-plugins-base1.0-dev:arm64 \
libpython3-dev:arm64
# \
# libjson-c5 nlohmann-json3-dev \
# libpugixml-dev \
# libudev1 \
# libtinfo5 \
# libboost-filesystem1.74.0 libboost-program-options1.74.0 libboost-regex-dev \
# libpng-dev \
# libopenblas-dev \
# libva-dev libavcodec-dev libavformat-dev \
# libgtk2.0-dev libglib2.0-dev libpango1.0-dev libcairo2-dev
# cmake 3.20 or higher is required to build OpenVINO
RUN current_cmake_ver=$(cmake --version | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p') && \
required_cmake_ver=3.20.0 && \
if [ ! "$(printf '%s\n' "$required_cmake_ver" "$current_cmake_ver" | sort -V | head -n1)" = "$required_cmake_ver" ]; then \
installed_cmake_ver=3.23.2 && \
wget "https://github.com/Kitware/CMake/releases/download/v${installed_cmake_ver}/cmake-${installed_cmake_ver}.tar.gz" && \
tar xf cmake-${installed_cmake_ver}.tar.gz && \
(cd cmake-${installed_cmake_ver} && ./bootstrap --parallel="$(nproc --all)" && make --jobs="$(nproc --all)" && make install) && \
rm -rf cmake-${installed_cmake_ver} cmake-${installed_cmake_ver}.tar.gz; \
fi
# Arm-Specific package needs
RUN if ! [ "${TARGETARCH}" = "amd64"]; then \
apt-get install -y scons python3.9-dev; \
fi
# # # Get OpenVino Source
# RUN git clone --recurse-submodules --shallow-submodules --depth 1 --branch 2022.1.0 https://github.com/openvinotoolkit/openvino.git
# RUN pip3 install --upgrade setuptools wheel cython protobuf && \
# pip3 install -r openvino/src/bindings/python/requirements.txt
# # # Configure and Build OpenVino
# RUN mkdir -p openvino/build && cd openvino/build && \
# if [ "${TARGETARCH}" = "arm" ]; then \
# export TCFILE="../cmake/arm.toolchain.cmake"; \
# elif [ "${TARGETARCH}" = "arm64" ]; then \
# export TCFILE="../cmake/arm64.toolchain.cmake"; \
# elif [ "${TARGETARCH}" = "amd64" ]; then \
# export TCFILE="" ;\
# fi && \
# cmake -GNinja \
# -DCMAKE_BUILD_TYPE=Release \
# -DCMAKE_TOOLCHAIN_FILE=${TCFILE} \
# -DTHREADING=TBB\
# -DENABLE_OPENCV=OFF \
# -DENABLE_OV_ONNX_FRONTEND=OFF \
# -DENABLE_OV_TF_FRONTEND=OFF \
# -DENABLE_OV_PADDLE_FRONTEND=OFF \
# -DENABLE_BEH_TESTS=OFF \
# -DENABLE_FUNCTIONAL_TESTS=OFF \
# -DENABLE_TESTS=OFF \
# -DENABLE_SAMPLES=OFF \
# -DENABLE_PYTHON=ON \
# -DENABLE_WHEEL=ON \
# .. && ninja -j $(nproc --ignore=1)
# ## Build ARM CPU Plugin
# # Get Contrib Source for ARM Builds
# RUN if ! [ "${TARGETARCH}" = "amd64" ]; then \
# cd / && \
# git clone --recurse-submodules --single-branch --branch=2022.1 https://github.com/openvinotoolkit/openvino_contrib.git &&\
# cd openvino_contrib/modules/arm_plugin && mkdir build && cd build && \
# cmake -GNinja \
# -DInferenceEngineDeveloperPackage_DIR=/openvino/build \
# -DCMAKE_BUILD_TYPE=Release \
# -DARM_COMPUTE_SCONS_JOBS=$(nproc --ignore=1) .. && \
# ninja -j $(nproc --ignore=1); \
# fi
# # # Install
# RUN mkdir /opt/openvino && cd /openvino/build && \
# cmake --install /openvino/build --prefix /opt/openvino
COPY patches /patches
COPY build-ov.sh build-ov.sh
CMD [ "/bin/bash", "build-ov.sh", "$TARGETARCH" ]