1 /// Copyright (c) 2017 ARM Limited.
3 /// SPDX-License-Identifier: MIT
5 /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 /// of this software and associated documentation files (the "Software"), to deal
7 /// in the Software without restriction, including without limitation the rights
8 /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 /// copies of the Software, and to permit persons to whom the Software is
10 /// furnished to do so, subject to the following conditions:
12 /// The above copyright notice and this permission notice shall be included in all
13 /// copies or substantial portions of the Software.
15 /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 /** @mainpage Introduction
29 @section S0_1_armnn ArmNN
31 Arm NN is a key component of the [machine learning platform](https://mlplatform.org/), which is part of the [Linaro Machine Intelligence Initiative](https://www.linaro.org/news/linaro-announces-launch-of-machine-intelligence-initiative/). For more information on the machine learning platform and Arm NN, see: <https://mlplatform.org/>, also there is further Arm NN information available from <https://developer.arm.com/products/processors/machine-learning/arm-nn>
33 There is a getting started guide here using TensorFlow: <https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-tensorflow>
35 There is a getting started guide here using TensorFlow Lite: <https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-tensorflow-lite>
37 There is a getting started guide here using Caffe: <https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-caffe>
39 There is a getting started guide here using ONNX: <https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-onnx>
41 There is a guide for backend development <a href="backends.xhtml">here</a>.
44 @section S1_license License
46 Arm NN is provided under the [MIT](https://spdx.org/licenses/MIT.html) license.
50 Copyright (c) 2017-2020 ARM Limited.
52 Permission is hereby granted, free of charge, to any person obtaining a copy
53 of this software and associated documentation files (the "Software"), to deal
54 in the Software without restriction, including without limitation the rights
55 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56 copies of the Software, and to permit persons to whom the Software is
57 furnished to do so, subject to the following conditions:
59 The above copyright notice and this permission notice shall be included in all
60 copies or substantial portions of the Software.
62 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
71 Individual files contain the following tag instead of the full license text.
73 SPDX-License-Identifier: MIT
75 This enables machine processing of license information based on the SPDX License Identifiers that are available [here](http://spdx.org/licenses/)
78 @section S2_1_contributions Contributor Guide
80 The Arm NN project is open for external contributors and welcomes contributions. Arm NN is licensed under the [MIT license](https://spdx.org/licenses/MIT.html) and all accepted contributions must have the same license. For more details on contributing to Arm NN see the [Contributing page](https://mlplatform.org/contributing/) on the [MLPlatform.org](https://mlplatform.org/) website.
82 @subsection S2_1_dco Developer Certificate of Origin (DCO)
84 Before the Arm NN project accepts your contribution, you need to certify its origin and give us your permission. To manage this process we use Developer Certificate of Origin (DCO) V1.1 (https://developercertificate.org/).
86 To indicate that you agree to the the terms of the DCO, you "sign off" your contribution by adding a line with your name and e-mail address to every git commit message:
88 Signed-off-by: John Doe <john.doe@example.org>
90 You must use your real name, no pseudonyms or anonymous contributions are accepted.
92 @subsection S2_2_releases Releases
94 Official Arm NN releases are published through the official [Arm NN Github repository](https://github.com/ARM-software/armnn).
96 @subsection S2_3_development_repository Developer Repository
98 The Arm NN development repository is hosted on the [mlplatform.org git repository](https://git.mlplatform.org/ml/armnn.git/) hosted by [Linaro](https://www.linaro.org/).
100 @subsection S2_4_code_review Code Review
102 Contributions must go through code review. Code reviews are performed through the [mlplatform.org Gerrit server](https://review.mlplatform.org). Contributors need to signup to this Gerrit server with their GitHub account
105 Only reviewed contributions can go to the master branch of Arm NN.
107 @subsection S2_5_continuous_integration Continuous Integration
109 Contributions to Arm NN go through testing at the Arm CI system. All unit, integration and regression tests must pass before a contribution gets merged to the Arm NN master branch.
111 @subsection S2_6_communications Communications
113 We encourage all Arm NN developers to subscribe to the [Arm NN developer mailing list](https://lists.linaro.org/mailman/listinfo/armnn-dev).
124 @section S3_build_instructions Build Instructions
126 Arm tests the build system of Arm NN with the following build environments:
129 * Cross compilation from x86_64 Ubuntu to arm64 Linux
130 * Native compilation under aarch64 Debian 9
133 Arm NN is written using portable C++14 and the build system uses [CMake](https://cmake.org/), therefore it is possible to build for a wide variety of target platforms, from a wide variety of host environments.
135 The armnn/tests directory contains tests used during Arm NN development. Many of them depend on third-party IP, model protobufs and image files not distributed with Arm NN. The dependencies of some of the tests are available freely on the Internet, for those who wish to experiment.
137 The 'armnn/samples' directory contains SimpleSample.cpp, a very basic example of the ArmNN SDK API in use.
139 The 'ExecuteNetwork' program, in armnn/tests/ExecuteNetwork, has no additional dependencies beyond those required by Arm NN and the model parsers. It takes any model and any input tensor, and simply prints out the output tensor. Run it with no arguments to see command-line help.
141 The 'ArmnnConverter' program, in armnn/src/armnnConverter, has no additional dependencies beyond those required by Arm NN and the model parsers. It takes a model in TensorFlow format and produces a serialized model in Arm NN format. Run it with no arguments to see command-line help. Note that this program can only convert models for which all operations are supported by the serialization tool [src/armnnSerializer](src/armnnSerializer/README.md).
143 The 'ArmnnQuantizer' program, in armnn/src/armnnQuantizer, has no additional dependencies beyond those required by Arm NN and the model parsers. It takes a 32-bit float network and converts it into a quantized asymmetric 8-bit or quantized symmetric 16-bit network.
144 Static quantization is supported by default but dynamic quantization can be enabled if CSV file of raw input tensors is specified. Run it with no arguments to see command-line help.
146 \Note note that Arm NN needs to be built against a particular version of [ARM's Compute Library](https://github.com/ARM-software/ComputeLibrary). The get_compute_library.sh in the scripts subdirectory will clone the compute library from the review.mlplatform.org github repository into a directory alongside armnn named 'clframework' and checks out the correct revision.
149 @subsection S3_1_android_ndk_build_guide How to use the Android NDK to build ArmNN
152 <li> [Introduction](#introduction) </li>
153 <li> [Download the Android NDK and make a standalone toolchain](#downloadNDK) </li>
154 <li> [Build the Boost C++ libraries](#buildBoost) </li>
155 <li> [Build the Compute Library](#buildCL) </li>
156 <li> [Build Google's Protobuf library](#buildProtobuf) </li>
157 <li> [Download TensorFlow](#downloadTF) </li>
158 <li> [Build ArmNN](#buildArmNN) </li>
159 <li> [Run ArmNN UnitTests on an Android device](#runArmNNUnitTests) </li>
162 ## <a name="introduction">Introduction</a>
163 These are step by step instructions for using the Android NDK to build ArmNN.
164 They have been tested on a clean install of Ubuntu 18.04, and should also work with other OS versions.
165 The instructions show how to build the ArmNN core library and the optional TensorFlow parser.
166 All downloaded or generated files will be saved inside the `~/armnn-devenv` directory.
169 ## <a name="downloadNDK">Download the Android NDK and make a standalone toolchain</a>
171 ### Download the Android NDK from [the official website](https://developer.android.com/ndk/downloads/index.html):
173 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
175 mkdir -p ~/armnn-devenv/toolchains
176 cd ~/armnn-devenv/toolchains
178 #For Mac OS, change the NDK download link accordingly.
179 wget https://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip
180 unzip android-ndk-r17b-linux-x86_64.zip
181 export NDK=~/armnn-devenv/toolchains/android-ndk-r17b
183 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
185 You may want to append `export NDK=~/armnn-devenv/toolchains/android-ndk-r17b` to your `~/.bashrc` (or `~/.bash_profile` in Mac OS).
187 ### Make a standalone toolchain:
189 (Requires python if not previously installed: `sudo apt install python`)
191 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
193 # Create an arm64 API 26 libc++ toolchain.
194 $NDK/build/tools/make_standalone_toolchain.py \
198 --install-dir=$HOME/armnn-devenv/toolchains/aarch64-android-r17b
199 export PATH=$HOME/armnn-devenv/toolchains/aarch64-android-r17b/bin:$PATH
201 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203 You may want to append `export PATH=$HOME/armnn-devenv/toolchains/aarch64-android-r17b/bin:$PATH` to your `~/.bashrc` (or `~/.bash_profile` in Mac OS).
205 ## <a name="buildBoost">Build the Boost C++ libraries</a>
207 ### Download Boost version 1.64:
209 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
210 mkdir ~/armnn-devenv/boost
211 cd ~/armnn-devenv/boost
212 wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2
213 tar xvf boost_1_64_0.tar.bz2
215 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219 (Requires gcc if not previously installed: `sudo apt install gcc`)
220 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
222 echo "using gcc : arm : aarch64-linux-android-clang++ ;" > $HOME/armnn-devenv/boost/user-config.jam
223 cd ~/armnn-devenv/boost/boost_1_64_0
224 ./bootstrap.sh --prefix=$HOME/armnn-devenv/boost/install
225 ./b2 install --user-config=$HOME/armnn-devenv/boost/user-config.jam \
226 toolset=gcc-arm link=static cxxflags=-fPIC --with-filesystem \
227 --with-test --with-log --with-program_options -j16
229 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
231 ## <a name="buildCL">Build the Compute Library</a>
233 ### Clone the Compute Library:
235 (Requires Git if not previously installed: `sudo apt install git`)
237 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
240 git clone https://github.com/ARM-software/ComputeLibrary.git
242 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246 (Requires SCons if not previously installed: `sudo apt install scons`)
247 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
250 scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" \
251 benchmark_tests=0 validation_tests=0 os=android -j16
253 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
255 ## <a name="buildProtobuf">Build Google's Protobuf library</a>
259 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
261 mkdir ~/armnn-devenv/google
262 cd ~/armnn-devenv/google
263 git clone https://github.com/google/protobuf.git
265 git checkout -b v3.5.2 v3.5.2
267 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
269 ### Build a native (x86) version of the protobuf libraries and compiler (protoc):
271 (Requires cUrl, autoconf, llibtool, and other build dependencies if not previously installed: `sudo apt install curl autoconf libtool build-essential g++`)
273 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
278 ../configure --prefix=$HOME/armnn-devenv/google/x86_pb_install
282 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
284 ### Build the arm64 version of the protobuf libraries:
286 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
290 CC=aarch64-linux-android-clang \
291 CXX=aarch64-linux-android-clang++ \
292 CFLAGS="-fPIE -fPIC" LDFLAGS="-pie -llog" \
293 ../configure --host=aarch64-linux-android \
294 --prefix=$HOME/armnn-devenv/google/arm64_pb_install \
295 --with-protoc=$HOME/armnn-devenv/google/x86_pb_install/bin/protoc
299 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
301 ## <a name="downloadTF">Download TensorFlow</a>
302 ### Clone TensorFlow source code:
304 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
306 cd ~/armnn-devenv/google/
307 git clone https://github.com/tensorflow/tensorflow.git
309 git checkout a0043f9262dc1b0e7dc4bdf3a7f0ef0bebc4891e
311 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313 You need tensorflow/contrib/makefile/tf_proto_files.txt from TensorFlow to generate TensorFlow protobuf definitions. This file is not available in TensorFlow master branch.
315 ## <a name="buildArmNN">Build ArmNN</a>
317 ### Clone ArmNN source code:
319 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
322 git clone https://github.com/ARM-software/armnn.git
324 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
326 ### Generate TensorFlow protobuf definitions:
328 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
330 cd ~/armnn-devenv/google/tensorflow
331 ~/armnn-devenv/armnn/scripts/generate_tensorflow_protobuf.sh \
332 $HOME/armnn-devenv/google/tf_pb $HOME/armnn-devenv/google/x86_pb_install
334 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
338 (Requires CMake if not previously installed: `sudo apt install cmake`)
340 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
342 mkdir ~/armnn-devenv/armnn/build
343 cd ~/armnn-devenv/armnn/build
344 CXX=aarch64-linux-android-clang++ \
345 CC=aarch64-linux-android-clang \
346 CXX_FLAGS="-fPIE -fPIC" \
348 -DCMAKE_SYSTEM_NAME=Android \
349 -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \
350 -DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=$HOME/armnn-devenv/toolchains/aarch64-android-r17b/ \
351 -DCMAKE_EXE_LINKER_FLAGS="-pie -llog" \
352 -DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary/ \
353 -DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build \
354 -DBOOST_ROOT=$HOME/armnn-devenv/boost/install/ \
355 -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 \
356 -DTF_GENERATED_SOURCES=$HOME/armnn-devenv/google/tf_pb/ -DBUILD_TF_PARSER=1 \
357 -DPROTOBUF_ROOT=$HOME/armnn-devenv/google/arm64_pb_install/
360 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
362 ## <a name="runArmNNUnitTests">Run the ArmNN unit tests on an Android device</a>
365 ### Push the build results to an Android device and make symbolic links for shared libraries:
366 Currently adb version we have used for testing is 1.0.41.
368 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
370 adb push libarmnnTfParser.so /data/local/tmp/
371 adb push libarmnn.so /data/local/tmp/
372 adb push UnitTests /data/local/tmp/
373 adb push $NDK/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so /data/local/tmp/
374 adb push $HOME/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so /data/local/tmp/libprotobuf.so.15.0.1
375 adb shell 'ln -s libprotobuf.so.15.0.1 /data/local/tmp/libprotobuf.so.15'
376 adb shell 'ln -s libprotobuf.so.15.0.1 /data/local/tmp/libprotobuf.so'
378 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
380 ### Push the files needed for the unit tests (they are a mix of files, directories and symbolic links):
382 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
384 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/testSharedObject
385 adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/testSharedObject/* /data/local/tmp/src/backends/backendsCommon/test/testSharedObject/
387 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/testDynamicBackend
388 adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/testDynamicBackend/* /data/local/tmp/src/backends/backendsCommon/test/testDynamicBackend/
390 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath1
391 adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath1/* /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath1/
393 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2
394 adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath2/Arm_CpuAcc_backend.so /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/
395 adb shell ln -s Arm_CpuAcc_backend.so /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/Arm_CpuAcc_backend.so.1
396 adb shell ln -s Arm_CpuAcc_backend.so.1 /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/Arm_CpuAcc_backend.so.1.2
397 adb shell ln -s Arm_CpuAcc_backend.so.1.2 /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/Arm_CpuAcc_backend.so.1.2.3
398 adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath2/Arm_GpuAcc_backend.so /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/
399 adb shell ln -s nothing /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/Arm_no_backend.so
401 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath3
403 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath5
404 adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath5/* /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath5/
406 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath6
407 adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath6/* /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath6/
409 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath7
411 adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath9
412 adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath9/* /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath9/
414 adb shell mkdir -p /data/local/tmp/src/backends/dynamic/reference
415 adb push -p ~/armnn-devenv/armnn/build/src/backends/dynamic/reference/Arm_CpuRef_backend.so /data/local/tmp/src/backends/dynamic/reference/
417 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
419 ### Run ArmNN unit tests:
421 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
423 adb shell 'LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/UnitTests'
425 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427 If libarmnnUtils.a is present in `~/armnn-devenv/armnn/build/` and the unit tests run without failure then the build was successful.
430 @subsection S3_2_cross_compilations_build_guide Cross Compilation Build Guide
433 <li> [Introduction](#introduction) </li>
434 <li> [Cross-compiling ToolChain](#installCCT) </li>
435 <li> [Build and install Google's Protobuf library](#buildProtobuf) </li>
436 <li> [Build Caffe for x86_64](#buildCaffe) </li>
437 <li> [Build Boost library for arm64](#installBaarch) </li>
438 <li> [Build Compute Library](#buildCL) </li>
439 <li> [Build ArmNN](#buildANN) </li>
440 <li> [Run Unit Tests](#unittests) </li>
441 <li> [Troubleshooting and Errors](#troubleshooting) </li>
445 ## <a name="introduction">Introduction</a>
446 These are the step by step instructions on Cross-Compiling ArmNN under an x86_64 system to target an Arm64 system. This build flow has been tested with Ubuntu 16.04.
447 The instructions show how to build the ArmNN core library and the Boost, Protobuf, Caffe and Compute Libraries necessary for compilation.
449 ## <a name="installCCT">Cross-compiling ToolChain</a>
451 ### Install the standard cross-compilation libraries for arm64:
453 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
455 sudo apt install crossbuild-essential-arm64
457 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
459 ## <a name="buildProtobuf">Build and install Google's Protobuf library</a>
461 ### Get protobuf-all-3.5.1.tar.gz from [here](https://github.com/protocolbuffers/protobuf/releases/tag/v3.5.1).
465 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
467 tar -zxvf protobuf-all-3.5.1.tar.gz
470 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
472 ### Build a native (x86_64) version of the protobuf libraries and compiler (protoc):
473 (Requires cUrl, autoconf, llibtool, and other build dependencies if not previously installed: sudo apt install curl autoconf libtool build-essential g++)
475 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
479 ../configure --prefix=$HOME/armnn-devenv/google/x86_64_pb_install
483 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
485 ### Build the arm64 version of the protobuf libraries:
487 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
491 CC=aarch64-linux-gnu-gcc \
492 CXX=aarch64-linux-gnu-g++ \
493 ../configure --host=aarch64-linux \
494 --prefix=$HOME/armnn-devenv/google/arm64_pb_install \
495 --with-protoc=$HOME/armnn-devenv/google/x86_64_pb_install/bin/protoc
499 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
501 ## <a name="buildCaffe">Build Caffe for x86_64</a>
503 ### Ubuntu 16.04 installation. These steps are taken from the full Caffe installation documentation [here](http://caffe.berkeleyvision.org/install_apt.html)
505 ### Install dependencies:
507 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
509 sudo apt-get install libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev
510 sudo apt-get install --no-install-recommends libboost-all-dev
511 sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
512 sudo apt-get install libopenblas-dev
513 sudo apt-get install libatlas-base-dev
515 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
517 ### Download Caffe-Master from [here](https://github.com/BVLC/caffe).
519 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
521 git clone https://github.com/BVLC/caffe.git
523 cp Makefile.config.example Makefile.config
525 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
527 ### Adjust Makefile.config as necessary for your environment, for example:
529 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
534 #Add hdf5 and protobuf include and library directories (Replace $HOME with explicit /home/username dir):
535 INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/ $HOME/armnn-devenv/google/x86_64_pb_install/include/
536 LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/ $HOME/armnn-devenv/google/x86_64_pb_install/lib/
538 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
540 ### Setup environment:
542 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
544 export PATH=$HOME/armnn-devenv/google/x86_64_pb_install/bin/:$PATH
545 export LD_LIBRARY_PATH=$HOME/armnn-devenv/google/x86_64_pb_install/lib/:$LD_LIBRARY_PATH
547 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
549 ### Compilation with Make:
559 These should all run without errors
560 ### caffe.pb.h and caffe.pb.cc will be needed when building ArmNN's Caffe Parser
562 ## <a name="installBaarch">Build Boost library for arm64</a>
564 ### Build Boost library for arm64
565 Download Boost version 1.64 from [here](http://www.boost.org/doc/libs/1_64_0/more/getting_started/unix-variants.html).
566 Using any version of Boost greater than 1.64 will fail to build ArmNN, due to different dependency issues.
568 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
569 tar -zxvf boost_1_64_0.tar.gz
571 echo "using gcc : arm : aarch64-linux-gnu-g++ ;" > user_config.jam
572 ./bootstrap.sh --prefix=$HOME/armnn-devenv/boost_arm64_install
573 ./b2 install toolset=gcc-arm link=static cxxflags=-fPIC --with-filesystem --with-test --with-log --with-program_options -j32 --user-config=user_config.jam
575 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
577 ## <a name="buildCL">Build Compute Library</a>
579 ### Building the Arm Compute Library:
581 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
583 git clone https://github.com/ARM-software/ComputeLibrary.git
585 scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" -j8 internal_only=0
587 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
589 ## <a name="buildANN">Build ArmNN</a>
591 ### Compile ArmNN for arm64:
593 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
595 git clone https://github.com/ARM-software/armnn.git
600 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
602 ### Use CMake to configure your build environment, update the following script and run it from the armnn/build directory to set up the armNN build:
604 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
607 CXX=aarch64-linux-gnu-g++ \
608 CC=aarch64-linux-gnu-gcc \
610 -DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary \
611 -DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build/ \
612 -DBOOST_ROOT=$HOME/armnn-devenv/boost_arm64_install/ \
613 -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 \
614 -DCAFFE_GENERATED_SOURCES=$HOME/armnn-devenv/caffe/build/src \
615 -DBUILD_CAFFE_PARSER=1 \
616 -DPROTOBUF_ROOT=$HOME/armnn-devenv/google/x86_64_pb_install/ \
617 -DPROTOBUF_LIBRARY_DEBUG=$HOME/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so.15.0.1 \
618 -DPROTOBUF_LIBRARY_RELEASE=$HOME/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so.15.0.1
620 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
630 ## <a name="unittests">Run Unit Tests</a>
632 ### Copy the build folder to an arm64 linux machine
634 ### Copy the libprotobuf.so.15.0.1 library file to the build folder
636 ### cd to the build folder on your arm64 machine and set your LD_LIBRARY_PATH to its current location:
638 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
641 export LD_LIBRARY_PATH=`pwd`
643 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
645 ### Create a symbolic link to libprotobuf.so.15.0.1:
647 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
649 ln -s libprotobuf.so.15.0.1 ./libprotobuf.so.15
651 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
653 ### Run the UnitTests:
655 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
658 Running 567 test cases...
660 *** No errors detected
662 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
664 ## <a name="troubleshooting">Troubleshooting and Errors:</a>
665 ## Error adding symbols: File in wrong format
667 ### When building armNN:
669 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
671 /usr/local/lib/libboost_log.a: error adding symbols: File in wrong format
672 collect2: error: ld returned 1 exit status
673 CMakeFiles/armnn.dir/build.make:4028: recipe for target 'libarmnn.so' failed
674 make[2]: *** [libarmnn.so] Error 1
675 CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/armnn.dir/all' failed
676 make[1]: *** [CMakeFiles/armnn.dir/all] Error 2
677 Makefile:127: recipe for target 'all' failed
678 make: *** [all] Error 2
680 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
682 ### Boost libraries are not compiled for the correct architecture, try recompiling for arm64
684 ## Virtual memory exhausted
685 ### When compiling the boost libraries:
687 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
689 virtual memory exhausted: Cannot allocate memory
691 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
693 ### Not enough memory available to compile. Increase the amount of RAM or swap space available.
696 ## Unrecognized command line option '-m64'
698 ### When compiling the boost libraries:
700 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
702 aarch64-linux-gnu-g++: error: unrecognized command line option ‘-m64’
704 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
706 ### Clean the boost library directory before trying to build with a different architecture:
708 ~~~~~~~~~~~~~~~~~~~.sh
714 ### It should show the following for arm64:
716 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
722 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
727 ### When compiling armNN:
729 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
731 /usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: warning: libz.so.1, needed by /home/<username>/armNN/usr/lib64/libprotobuf.so.15.0.0, not found (try using -rpath or -rpath-link)
733 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
735 ### Missing arm64 libraries for libz.so.1, these can be added by adding a second architecture to dpkg and explicitly installing them:
737 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
739 sudo dpkg --add-architecture arm64
740 sudo apt-get install zlib1g:arm64
744 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
746 ### If apt-get update returns 404 errors for arm64 repos refer to section 5 below.
748 ### Alternatively the missing arm64 version of libz.so.1 can be downloaded and installed from a .deb package [here](https://launchpad.net/ubuntu/wily/arm64/zlib1g/1:1.2.8.dfsg-2ubuntu4)
750 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
752 sudo dpkg -i zlib1g_1.2.8.dfsg-2ubuntu4_arm64.deb
754 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
756 ## Unable to install arm64 packages after adding arm64 architecture
758 ### Using sudo apt-get update should add all of the required repos for arm64 but if it does not or you are getting 404 errors the following instructions can be used to add the repos manually:
760 ### From stackoverflow [here](https://askubuntu.com/questions/430705/how-to-use-apt-get-to-download-multi-arch-library/430718).
762 ### Open /etc/apt/sources.list with your preferred text editor.
764 ### Mark all the current (default) repos as \[arch=<current_os_arch>], e.g.
766 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
768 deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial main restricted
770 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
772 ### Then add the following:
774 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
776 deb [arch=arm64] http://ports.ubuntu.com/ xenial main restricted
777 deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates main restricted
778 deb [arch=arm64] http://ports.ubuntu.com/ xenial universe
779 deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates universe
780 deb [arch=arm64] http://ports.ubuntu.com/ xenial multiverse
781 deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates multiverse
782 deb [arch=arm64] http://ports.ubuntu.com/ xenial-backports main restricted universe multiverse
784 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
786 ### Update and install again:
788 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
790 sudo apt-get install zlib1g:arm64
794 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
796 ## Undefined references to google::protobuf:: functions
798 ### When compiling armNN there are multiple errors of the following type:
800 libarmnnCaffeParser.so: undefined reference to `google::protobuf:*
802 ### Missing or out of date protobuf compilation libraries.
803 Use the command 'protoc --version' to check which version of protobuf is available (version 3.5.1 is required).
804 Follow the instructions above to install protobuf 3.5.1
805 Note this will require you to recompile Caffe for x86_64
807 ## Errors on strict-aliasing rules when compiling the Compute Library
809 ### When compiling the Compute Library there are multiple errors on strict-aliasing rules:
811 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
813 cc1plus: error: unrecognized command line option ‘-Wno-implicit-fallthrough’ [-Werror]
815 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
817 ### Add Werror=0 to the scons command:
819 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.sh
821 scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" -j8 internal_only=0 Werror=0
823 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~