James Conroy | 3c6e9ed | 2021-11-24 15:17:49 +0000 | [diff] [blame] | 1 | FROM ubuntu:18.04 |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 2 | ENV TERM linux |
| 3 | ENV DEBIAN_FRONTEND noninteractive |
| 4 | |
| 5 | # Forward system proxy setting |
| 6 | # ARG proxy |
| 7 | # ENV http_proxy $proxy |
| 8 | # ENV https_proxy $proxy |
| 9 | |
| 10 | # Basic apt update |
| 11 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends locales ca-certificates && rm -rf /var/lib/apt/lists/* |
| 12 | |
| 13 | # Set the locale to en_US.UTF-8, because the Yocto build fails without any locale set. |
| 14 | RUN locale-gen en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 |
| 15 | ENV LANG en_US.UTF-8 |
| 16 | ENV LC_ALL en_US.UTF-8 |
| 17 | |
| 18 | # Again, off the certificare |
| 19 | RUN echo "check_certificate = off" >> ~/.wgetrc |
| 20 | RUN echo "[global] \n\ |
| 21 | trusted-host = pypi.python.org \n \ |
| 22 | \t pypi.org \n \ |
| 23 | \t files.pythonhosted.org" >> /etc/pip.conf |
| 24 | |
| 25 | # Get basic packages |
| 26 | RUN apt-get update && apt-get install -y \ |
| 27 | apparmor \ |
| 28 | aufs-tools \ |
| 29 | automake \ |
| 30 | bash-completion \ |
| 31 | btrfs-tools \ |
| 32 | build-essential \ |
| 33 | cmake \ |
| 34 | createrepo \ |
| 35 | curl \ |
| 36 | dpkg-sig \ |
| 37 | g++ \ |
| 38 | gcc \ |
| 39 | git \ |
| 40 | iptables \ |
| 41 | jq \ |
| 42 | libapparmor-dev \ |
| 43 | libc6-dev \ |
| 44 | libcap-dev \ |
| 45 | libsystemd-dev \ |
| 46 | libyaml-dev \ |
| 47 | mercurial \ |
| 48 | net-tools \ |
| 49 | parallel \ |
| 50 | pkg-config \ |
| 51 | python-dev \ |
| 52 | python-mock \ |
| 53 | python-pip \ |
| 54 | python-setuptools \ |
| 55 | python-websocket \ |
| 56 | golang-go \ |
| 57 | iproute2 \ |
| 58 | iputils-ping \ |
| 59 | vim-common \ |
| 60 | vim \ |
| 61 | wget \ |
| 62 | libtool \ |
| 63 | unzip \ |
| 64 | scons \ |
| 65 | curl \ |
| 66 | autoconf \ |
| 67 | libtool \ |
| 68 | build-essential \ |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 69 | libssl-dev \ |
| 70 | g++ && rm -rf /var/lib/apt/lists/* |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 71 | |
| 72 | # Install Cross-compiling ToolChain |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 73 | RUN apt-get update && apt-get install -y crossbuild-essential-arm64 crossbuild-essential-armhf |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 74 | |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 75 | # Install Cmake 3.19 |
| 76 | RUN cd $HOME && \ |
| 77 | wget -O cmake-3.19.0.tar.gz https://cmake.org/files/v3.19/cmake-3.19.0.tar.gz && \ |
| 78 | tar -xzf cmake-3.19.0.tar.gz && \ |
| 79 | cd $HOME/cmake-3.19.0 && \ |
| 80 | ./bootstrap && \ |
| 81 | make && \ |
| 82 | make install |
| 83 | |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 84 | # Build and install Google's Protobuf library |
| 85 | # Download and Extract |
| 86 | RUN mkdir -p $HOME/google && \ |
| 87 | cd $HOME/google && \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 88 | wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.0/protobuf-all-3.12.0.tar.gz && \ |
| 89 | tar -zxvf protobuf-all-3.12.0.tar.gz |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 90 | |
| 91 | # Build a native (x86_64) version |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 92 | RUN cd $HOME/google/protobuf-3.12.0 && \ |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 93 | mkdir x86_build && cd x86_build && \ |
| 94 | ../configure --prefix=$HOME/armnn-devenv/google/x86_64_pb_install && \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 95 | make install -j$(nproc) |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 96 | |
| 97 | # Build the arm64 version of the protobuf libraries |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 98 | RUN cd $HOME/google/protobuf-3.12.0 && \ |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 99 | mkdir arm64_build && cd arm64_build && \ |
| 100 | export CC=aarch64-linux-gnu-gcc && \ |
| 101 | export CXX=aarch64-linux-gnu-g++ && \ |
| 102 | ../configure --host=aarch64-linux \ |
| 103 | --prefix=$HOME/armnn-devenv/google/arm64_pb_install \ |
| 104 | --with-protoc=$HOME/armnn-devenv/google/x86_64_pb_install/bin/protoc && \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 105 | make install -j$(nproc) |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 106 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 107 | # Build the arm32 version of the protobuf libraries |
| 108 | RUN cd $HOME/google/protobuf-3.12.0 && \ |
| 109 | mkdir arm32_build && cd arm32_build && \ |
| 110 | export CC=arm-linux-gnueabihf-gcc && \ |
| 111 | export CXX=arm-linux-gnueabihf-g++ && \ |
| 112 | ../configure --host=arm-linux \ |
| 113 | --prefix=$HOME/armnn-devenv/google/arm32_pb_install \ |
| 114 | --with-protoc=$HOME/armnn-devenv/google/x86_64_pb_install/bin/protoc && \ |
| 115 | make install -j$(nproc) |
| 116 | |
| 117 | # Dep Error - Bug ARMNN |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 118 | RUN apt-get update && apt-get install -y \ |
| 119 | python-numpy |
| 120 | |
| 121 | # Setup Env |
| 122 | # ENV PATH=$HOME/armnn-devenv/google/x86_64_pb_install/bin/:$PATH |
| 123 | # ENV LD_LIBRARY_PATH=$HOME/armnn-devenv/google/x86_64_pb_install/lib/:$LD_LIBRARY_PATH |
| 124 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 125 | # Download ArmNN 64-bit |
James Conroy | 3c6e9ed | 2021-11-24 15:17:49 +0000 | [diff] [blame] | 126 | RUN cd $HOME/armnn-devenv && git clone "https://review.mlplatform.org/ml/armnn" && \ |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 127 | cd armnn/ && git checkout master |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 128 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 129 | # Download ArmNN 32-bit |
| 130 | RUN cd $HOME/armnn-devenv && git clone "https://review.mlplatform.org/ml/armnn" armnn-32 && \ |
| 131 | cd armnn-32/ && git checkout master |
| 132 | |
| 133 | # Build 64-bit Compute Library |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 134 | RUN cd $HOME/armnn-devenv/ && git clone https://review.mlplatform.org/ml/ComputeLibrary && \ |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 135 | cd ComputeLibrary && \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 136 | git checkout $($HOME/armnn-devenv/armnn/scripts/get_compute_library.sh -p) && \ |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 137 | scons Werror=0 arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" -j$(nproc) |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 138 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 139 | # Build 32-bit Compute Library |
| 140 | RUN cd $HOME/armnn-devenv/ && mkdir ComputeLibrary_32 && git clone https://review.mlplatform.org/ml/ComputeLibrary ComputeLibrary_32 && \ |
| 141 | cd ComputeLibrary_32 &&\ |
| 142 | git checkout $($HOME/armnn-devenv/armnn/scripts/get_compute_library.sh -p) && \ |
| 143 | scons Werror=0 arch=armv7a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" -j$(nproc) |
| 144 | |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 145 | # Download Tensorflow (Checkout latest tested version of TF using get_tensorflow.sh) |
| 146 | RUN cd $HOME/armnn-devenv && \ |
| 147 | git clone https://github.com/tensorflow/tensorflow.git && \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 148 | cd tensorflow && \ |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 149 | git checkout $($HOME/armnn-devenv/armnn/scripts/get_tensorflow.sh -p) |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 150 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 151 | # Build 64-bit TF Lite |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 152 | RUN cd $HOME/armnn-devenv && \ |
| 153 | curl -LO https://storage.googleapis.com/mirror.tensorflow.org/developer.arm.com/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz && \ |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 154 | mkdir tflite-toolchains &&\ |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 155 | tar xvf gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz -C tflite-toolchains && \ |
| 156 | mkdir -p tflite/build && \ |
| 157 | cd tflite/build && \ |
| 158 | ARMCC_PREFIX=$HOME/armnn-devenv/tflite-toolchains/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu- && \ |
| 159 | ARMCC_FLAGS="-funsafe-math-optimizations" && \ |
| 160 | cmake -DCMAKE_C_COMPILER=${ARMCC_PREFIX}gcc \ |
| 161 | -DCMAKE_CXX_COMPILER=${ARMCC_PREFIX}g++ \ |
| 162 | -DCMAKE_C_FLAGS="${ARMCC_FLAGS}" -DCMAKE_CXX_FLAGS="${ARMCC_FLAGS}" \ |
| 163 | -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_SYSTEM_NAME=Linux \ |
| 164 | -DTFLITE_ENABLE_XNNPACK=OFF \ |
| 165 | -DCMAKE_SYSTEM_PROCESSOR=aarch64 \ |
| 166 | $HOME/armnn-devenv/tensorflow/tensorflow/lite/ && \ |
| 167 | cmake --build . |
| 168 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 169 | # Build 32-bit TF Lite |
| 170 | RUN cd $HOME/armnn-devenv && \ |
| 171 | curl -LO https://storage.googleapis.com/mirror.tensorflow.org/developer.arm.com/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz && \ |
| 172 | mkdir tflite-toolchains-32 && \ |
| 173 | tar xf gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz -C tflite-toolchains-32 && \ |
| 174 | mkdir -p tflite-32/build && \ |
| 175 | cd tflite-32/build && \ |
| 176 | ARMCC_PREFIX=$HOME/armnn-devenv/tflite-toolchains-32/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf- && \ |
| 177 | ARMCC_FLAGS="-funsafe-math-optimizations" && \ |
| 178 | cmake -DCMAKE_C_COMPILER=${ARMCC_PREFIX}gcc \ |
| 179 | -DCMAKE_CXX_COMPILER=${ARMCC_PREFIX}g++ \ |
| 180 | -DCMAKE_C_FLAGS="${ARMCC_FLAGS}" -DCMAKE_CXX_FLAGS="${ARMCC_FLAGS}" \ |
| 181 | -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_SYSTEM_NAME=Linux \ |
| 182 | -DTFLITE_ENABLE_XNNPACK=OFF \ |
| 183 | -DCMAKE_SYSTEM_PROCESSOR=armv7a \ |
| 184 | $HOME/armnn-devenv/tensorflow/tensorflow/lite/ && \ |
| 185 | cmake --build . |
| 186 | |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 187 | # Download Flatbuffers |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 188 | RUN cd $HOME/armnn-devenv && \ |
| 189 | wget -O flatbuffers-1.12.0.tar.gz https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz && \ |
| 190 | tar xf flatbuffers-1.12.0.tar.gz && \ |
| 191 | cd flatbuffers-1.12.0 && \ |
| 192 | rm -f CMakeCache.txt |
| 193 | |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 194 | # Build native x86_64 version of Flatbuffers |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 195 | RUN cd $HOME/armnn-devenv && cd flatbuffers-1.12.0 && \ |
| 196 | mkdir build && \ |
| 197 | cd build && \ |
| 198 | cmake .. -DFLATBUFFERS_BUILD_FLATC=1 \ |
| 199 | -DCMAKE_INSTALL_PREFIX:PATH=$HOME/armnn-devenv/flatbuffers \ |
| 200 | -DFLATBUFFERS_BUILD_TESTS=0 && \ |
| 201 | make all install -j$(nproc) |
| 202 | |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 203 | # Build arm64 version of Flatbuffers |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 204 | RUN cd $HOME/armnn-devenv && cd flatbuffers-1.12.0 && \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 205 | mkdir build-arm64 && \ |
| 206 | cd build-arm64 && \ |
| 207 | CXXFLAGS="-fPIC" cmake .. -DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc \ |
| 208 | -DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++ \ |
| 209 | -DFLATBUFFERS_BUILD_FLATC=1 \ |
| 210 | -DCMAKE_INSTALL_PREFIX:PATH=$HOME/armnn-devenv/flatbuffers-arm64 \ |
| 211 | -DFLATBUFFERS_BUILD_TESTS=0 && \ |
| 212 | make all install -j$(nproc) |
| 213 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 214 | # Build arm32 version of Flatbuffers |
| 215 | RUN cd $HOME/armnn-devenv && cd flatbuffers-1.12.0 && \ |
| 216 | mkdir build-arm32 && \ |
| 217 | cd build-arm32 && \ |
| 218 | CXXFLAGS="-fPIC" cmake .. -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc \ |
| 219 | -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ \ |
| 220 | -DFLATBUFFERS_BUILD_FLATC=1 \ |
| 221 | -DCMAKE_INSTALL_PREFIX:PATH=$HOME/armnn-devenv/flatbuffers-arm32 \ |
| 222 | -DFLATBUFFERS_BUILD_TESTS=0 && \ |
| 223 | make all install -j$(nproc) |
| 224 | |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 225 | # Build onnx |
| 226 | RUN cd $HOME/armnn-devenv && git clone https://github.com/onnx/onnx.git && \ |
| 227 | cd onnx && \ |
| 228 | git fetch https://github.com/onnx/onnx.git 553df22c67bee5f0fe6599cff60f1afc6748c635 && git checkout FETCH_HEAD && \ |
| 229 | LD_LIBRARY_PATH=$HOME/armnn-devenv/google/x86_64_pb_install/lib:$LD_LIBRARY_PATH \ |
| 230 | $HOME/armnn-devenv/google/x86_64_pb_install/bin/protoc \ |
| 231 | onnx/onnx.proto --proto_path=. --proto_path=../google/x86_64_pb_install/include --cpp_out $HOME/armnn-devenv/onnx |
| 232 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 233 | # Generate TF Lite Schema 64-bit |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 234 | RUN cd $HOME/armnn-devenv && \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 235 | cd tflite && \ |
| 236 | cp ../tensorflow/tensorflow/lite/schema/schema.fbs . && \ |
| 237 | ../flatbuffers-1.12.0/build/flatc -c --gen-object-api --reflect-types --reflect-names schema.fbs |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 238 | |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 239 | # Generate TF Lite Schema 32-bit |
| 240 | RUN cd $HOME/armnn-devenv && \ |
| 241 | cd tflite-32 && \ |
| 242 | cp ../tensorflow/tensorflow/lite/schema/schema.fbs . && \ |
| 243 | ../flatbuffers-1.12.0/build/flatc -c --gen-object-api --reflect-types --reflect-names schema.fbs |
| 244 | |
| 245 | # Build 64-bit ArmNN |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 246 | RUN cd $HOME/armnn-devenv && \ |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 247 | cd armnn && mkdir build && cd build && \ |
| 248 | export CXX=aarch64-linux-gnu-g++ && \ |
| 249 | export CC=aarch64-linux-gnu-gcc && \ |
| 250 | cmake .. \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 251 | -DCMAKE_CXX_FLAGS=-w \ |
| 252 | -DBUILD_TESTS=1 \ |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 253 | -DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary \ |
| 254 | -DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build/ \ |
Jegathesan Shanmugam | bdba272 | 2020-03-26 22:47:37 +0530 | [diff] [blame] | 255 | -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 256 | -DONNX_GENERATED_SOURCES=$HOME/armnn-devenv/onnx \ |
| 257 | -DBUILD_ONNX_PARSER=1 \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 258 | -DBUILD_TF_LITE_PARSER=1 \ |
James Conroy | 3aa2985 | 2021-12-24 14:46:23 +0000 | [diff] [blame] | 259 | -DBUILD_ARMNN_TFLITE_DELEGATE=1 \ |
| 260 | -DTENSORFLOW_ROOT=$HOME/armnn-devenv/tensorflow \ |
| 261 | -DTFLITE_LIB_ROOT=$HOME/armnn-devenv/tflite/build \ |
| 262 | -DTF_LITE_SCHEMA_INCLUDE_PATH=$HOME/armnn-devenv/tflite \ |
Keith Mok | 34b9aba | 2021-03-18 21:42:16 -0700 | [diff] [blame] | 263 | -DFLATBUFFERS_ROOT=$HOME/armnn-devenv/flatbuffers-arm64 \ |
| 264 | -DFLATC_DIR=$HOME/armnn-devenv/flatbuffers-1.12.0/build \ |
| 265 | -DPROTOBUF_ROOT=$HOME/armnn-devenv/google/x86_64_pb_install \ |
| 266 | -DPROTOBUF_LIBRARY_DEBUG=$HOME/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so.23.0.0 \ |
| 267 | -DPROTOBUF_LIBRARY_RELEASE=$HOME/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so.23.0.0 && \ |
| 268 | make -j$(nproc) |
Elham | 8f5042f | 2022-04-05 13:19:10 -0400 | [diff] [blame] | 269 | |
| 270 | # Build 32-bit ArmNN |
| 271 | RUN cd $HOME/armnn-devenv && \ |
| 272 | cd armnn-32 && mkdir build && cd build && \ |
| 273 | export CXX=arm-linux-gnueabihf-g++ && \ |
| 274 | export CC=arm-linux-gnueabihf-gcc && \ |
| 275 | cmake .. \ |
| 276 | -DCMAKE_CXX_FLAGS=-w \ |
| 277 | -DBUILD_TESTS=1 \ |
| 278 | -DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary_32 \ |
| 279 | -DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary_32/build/ \ |
| 280 | -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 \ |
| 281 | -DONNX_GENERATED_SOURCES=$HOME/armnn-devenv/onnx \ |
| 282 | -DBUILD_ONNX_PARSER=1 \ |
| 283 | -DBUILD_TF_LITE_PARSER=1 \ |
| 284 | -DBUILD_ARMNN_TFLITE_DELEGATE=1 \ |
| 285 | -DTENSORFLOW_ROOT=$HOME/armnn-devenv/tensorflow \ |
| 286 | -DTFLITE_LIB_ROOT=$HOME/armnn-devenv/tflite-32/build \ |
| 287 | -DTF_LITE_SCHEMA_INCLUDE_PATH=$HOME/armnn-devenv/tflite-32 \ |
| 288 | -DFLATBUFFERS_ROOT=$HOME/armnn-devenv/flatbuffers-arm32 \ |
| 289 | -DFLATC_DIR=$HOME/armnn-devenv/flatbuffers-1.12.0/build \ |
| 290 | -DPROTOBUF_ROOT=$HOME/armnn-devenv/google/x86_64_pb_install \ |
| 291 | -DPROTOBUF_LIBRARY_DEBUG=$HOME/armnn-devenv/google/arm32_pb_install/lib/libprotobuf.so.23.0.0 \ |
| 292 | -DPROTOBUF_LIBRARY_RELEASE=$HOME/armnn-devenv/google/arm32_pb_install/lib/libprotobuf.so.23.0.0 \ |
| 293 | -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON && \ |
| 294 | make -j$(nproc) |
| 295 | |