aboutsummaryrefslogtreecommitdiff
path: root/20.02/index.xhtml
diff options
context:
space:
mode:
Diffstat (limited to '20.02/index.xhtml')
-rw-r--r--20.02/index.xhtml346
1 files changed, 346 insertions, 0 deletions
diff --git a/20.02/index.xhtml b/20.02/index.xhtml
new file mode 100644
index 0000000000..53874ead63
--- /dev/null
+++ b/20.02/index.xhtml
@@ -0,0 +1,346 @@
+<!-- Copyright (c) 2020 ARM Limited. -->
+<!-- -->
+<!-- SPDX-License-Identifier: MIT -->
+<!-- -->
+<!-- HTML header for doxygen 1.8.13-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.13"/>
+<meta name="robots" content="NOINDEX, NOFOLLOW" />
+<meta name="viewport" content="width=device-width, initial-scale=1"/>
+<title>ArmNN: Introduction</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+</script>
+<link href="search/search.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="search/searchdata.js"></script>
+<script type="text/javascript" src="search/search.js"></script>
+<script type="text/x-mathjax-config">
+ MathJax.Hub.Config({
+ extensions: ["tex2jax.js"],
+ jax: ["input/TeX","output/HTML-CSS"],
+});
+</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/>
+ <td style="padding-left: 0.5em;">
+ <div id="projectname">
+ &#160;<span id="projectnumber">20.02</span>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.13 -->
+<script type="text/javascript">
+var searchBox = new SearchBox("searchBox", "search",false,'Search');
+</script>
+<script type="text/javascript" src="menudata.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript">
+$(function() {
+ initMenu('',true,false,'search.php','Search');
+ $(document).ready(function() { init_search(); });
+});
+</script>
+<div id="main-nav"></div>
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('index.xhtml','');});
+</script>
+<div id="doc-content">
+<!-- window showing the filter options -->
+<div id="MSearchSelectWindow"
+ onmouseover="return searchBox.OnSearchSelectShow()"
+ onmouseout="return searchBox.OnSearchSelectHide()"
+ onkeydown="return searchBox.OnSearchSelectKey(event)">
+</div>
+
+<!-- iframe showing the search results (closed by default) -->
+<div id="MSearchResultsWindow">
+<iframe src="javascript:void(0)" frameborder="0"
+ name="MSearchResults" id="MSearchResults">
+</iframe>
+</div>
+
+<div class="header">
+ <div class="headertitle">
+<div class="title">Introduction </div> </div>
+</div><!--header-->
+<div class="contents">
+<div class="toc"><h3>Table of Contents</h3>
+<ul><li class="level1"><a href="#S0_1_armnn">ArmNN</a></li>
+<li class="level1"><a href="#S1_license">License</a></li>
+<li class="level1"><a href="#S2_1_contributions">Contributor Guide</a><ul><li class="level2"><a href="#S2_1_dco">Developer Certificate of Origin (DCO)</a></li>
+<li class="level2"><a href="#S2_2_releases">Releases</a></li>
+<li class="level2"><a href="#S2_3_development_repository">Developer Repository</a></li>
+<li class="level2"><a href="#S2_4_code_review">Code Review</a></li>
+<li class="level2"><a href="#S2_5_continuous_integration">Continuous Integration</a></li>
+<li class="level2"><a href="#S2_6_communications">Communications</a></li>
+</ul>
+</li>
+<li class="level1"><a href="#S3_build_instructions">Build Instructions</a><ul><li class="level2"><a href="#S3_1_android_ndk_build_guide">How to use the Android NDK to build ArmNN</a></li>
+<li class="level2"><a href="#S3_2_cross_compilations_build_guide">Cross Compilation Build Guide</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="textblock"><h1><a class="anchor" id="S0_1_armnn"></a>
+ArmNN</h1>
+<p>Arm NN is a key component of the <a href="https://mlplatform.org/">machine learning platform</a>, which is part of the <a href="https://www.linaro.org/news/linaro-announces-launch-of-machine-intelligence-initiative/">Linaro Machine Intelligence Initiative</a>. For more information on the machine learning platform and Arm NN, see: <a href="https://mlplatform.org/">https://mlplatform.org/</a>, also there is further Arm NN information available from <a href="https://developer.arm.com/products/processors/machine-learning/arm-nn">https://developer.arm.com/products/processors/machine-learning/arm-nn</a></p>
+<p>There is a getting started guide here using TensorFlow: <a href="https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-tensorflow">https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-tensorflow</a></p>
+<p>There is a getting started guide here using TensorFlow Lite: <a href="https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-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</a></p>
+<p>There is a getting started guide here using Caffe: <a href="https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-caffe">https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-caffe</a></p>
+<p>There is a getting started guide here using ONNX: <a href="https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-onnx">https://developer.arm.com/technologies/machine-learning-on-arm/developer-material/how-to-guides/configuring-the-arm-nn-sdk-build-environment-for-onnx</a></p>
+<p>There is a guide for backend development <a href="backends.xhtml">here</a>. <br />
+<br />
+<br />
+<br />
+</p>
+<h1><a class="anchor" id="S1_license"></a>
+License</h1>
+<p>Arm NN is provided under the <a href="https://spdx.org/licenses/MIT.html">MIT</a> license.</p>
+<p><b><b>MIT License</b></b></p>
+<p>Copyright (c) 2017-2020 ARM Limited.</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
+<p>Individual files contain the following tag instead of the full license text. </p><pre class="fragment">SPDX-License-Identifier: MIT
+</pre><p>This enables machine processing of license information based on the SPDX License Identifiers that are available <a href="http://spdx.org/licenses/">here</a> <br />
+<br />
+<br />
+<br />
+</p>
+<h1><a class="anchor" id="S2_1_contributions"></a>
+Contributor Guide</h1>
+<p>The Arm NN project is open for external contributors and welcomes contributions. Arm NN is licensed under the <a href="https://spdx.org/licenses/MIT.html">MIT license</a> and all accepted contributions must have the same license. For more details on contributing to Arm NN see the <a href="https://mlplatform.org/contributing/">Contributing page</a> on the <a href="https://mlplatform.org/">MLPlatform.org</a> website.</p>
+<h2><a class="anchor" id="S2_1_dco"></a>
+Developer Certificate of Origin (DCO)</h2>
+<p>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 (<a href="https://developercertificate.org/">https://developercertificate.org/</a>).</p>
+<p>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:</p>
+<p>Signed-off-by: John Doe <a href="#" onclick="location.href='mai'+'lto:'+'joh'+'n.'+'doe'+'@e'+'xam'+'pl'+'e.o'+'rg'; return false;">john.<span style="display: none;">.nosp@m.</span>doe@<span style="display: none;">.nosp@m.</span>examp<span style="display: none;">.nosp@m.</span>le.o<span style="display: none;">.nosp@m.</span>rg</a></p>
+<p>You must use your real name, no pseudonyms or anonymous contributions are accepted.</p>
+<h2><a class="anchor" id="S2_2_releases"></a>
+Releases</h2>
+<p>Official Arm NN releases are published through the official <a href="https://github.com/ARM-software/armnn">Arm NN Github repository</a>.</p>
+<h2><a class="anchor" id="S2_3_development_repository"></a>
+Developer Repository</h2>
+<p>The Arm NN development repository is hosted on the <a href="https://git.mlplatform.org/ml/armnn.git/">mlplatform.org git repository</a> hosted by <a href="https://www.linaro.org/">Linaro</a>.</p>
+<h2><a class="anchor" id="S2_4_code_review"></a>
+Code Review</h2>
+<p>Contributions must go through code review. Code reviews are performed through the <a href="https://review.mlplatform.org">mlplatform.org Gerrit server</a>. Contributors need to signup to this Gerrit server with their GitHub account credentials.</p>
+<p>Only reviewed contributions can go to the master branch of Arm NN.</p>
+<h2><a class="anchor" id="S2_5_continuous_integration"></a>
+Continuous Integration</h2>
+<p>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.</p>
+<h2><a class="anchor" id="S2_6_communications"></a>
+Communications</h2>
+<p>We encourage all Arm NN developers to subscribe to the <a href="https://lists.linaro.org/mailman/listinfo/armnn-dev">Arm NN developer mailing list</a>. <br />
+<br />
+<br />
+<br />
+</p>
+<h1><a class="anchor" id="S3_build_instructions"></a>
+Build Instructions</h1>
+<p>Arm tests the build system of Arm NN with the following build environments:</p>
+<p>Android NDK Cross compilation from x86_64 Ubuntu to arm64 Linux Native compilation under aarch64 Debian 9</p>
+<p>Arm NN is written using portable C++14 and the build system uses <a href="https://cmake.org/">CMake</a>, therefore it is possible to build for a wide variety of target platforms, from a wide variety of host environments.</p>
+<p>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.</p>
+<p>The 'armnn/samples' directory contains SimpleSample.cpp, a very basic example of the ArmNN SDK API in use.</p>
+<p>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.</p>
+<p>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.</p>
+<p>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. 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.</p>
+<p>note that Arm NN needs to be built against a particular version of <a href="https://github.com/ARM-software/ComputeLibrary">ARM's Compute Library</a>. 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. <br />
+<br />
+<br />
+<br />
+</p>
+<h2><a class="anchor" id="S3_1_android_ndk_build_guide"></a>
+How to use the Android NDK to build ArmNN</h2>
+<ul>
+<li>
+<a href="#introduction">Introduction</a> </li>
+<li>
+<a href="#downloadNDK">Download the Android NDK and make a standalone toolchain</a> </li>
+<li>
+<a href="#buildBoost">Build the Boost C++ libraries</a> </li>
+<li>
+<a href="#buildCL">Build the Compute Library</a> </li>
+<li>
+<a href="#buildProtobuf">Build Google's Protobuf library</a> </li>
+<li>
+<a href="#downloadTF">Download TensorFlow</a> </li>
+<li>
+<a href="#buildArmNN">Build ArmNN</a> </li>
+<li>
+<a href="#runArmNNUnitTests">Run ArmNN UnitTests on an Android device</a> </li>
+</ul>
+<h2><a class="anchor" id="introduction"></a>Introduction</h2>
+<p>These are step by step instructions for using the Android NDK to build ArmNN. They have been tested on a clean install of Ubuntu 18.04, and should also work with other OS versions. The instructions show how to build the ArmNN core library and the optional TensorFlow parser. All downloaded or generated files will be saved inside the <code>~/armnn-devenv</code> directory.</p>
+<h2><a class="anchor" id="downloadNDK"></a>Download the Android NDK and make a standalone toolchain</h2>
+<h3>Download the Android NDK from <a href="https://developer.android.com/ndk/downloads/index.html">the official website</a>:</h3>
+<div class="fragment"><div class="line">mkdir -p ~/armnn-devenv/toolchains</div><div class="line">cd ~/armnn-devenv/toolchains</div><div class="line"></div><div class="line">#For Mac OS, change the NDK download link accordingly.</div><div class="line">wget https://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip</div><div class="line">unzip android-ndk-r17b-linux-x86_64.zip</div><div class="line">export NDK=~/armnn-devenv/toolchains/android-ndk-r17b</div></div><!-- fragment --> <pre class="fragment"> You may want to append `export NDK=~/armnn-devenv/toolchains/android-ndk-r17b` to your `~/.bashrc` (or `~/.bash_profile` in Mac OS).
+</pre><h3>Make a standalone toolchain:</h3>
+<pre class="fragment"> (Requires python if not previously installed: `sudo apt install python`)
+</pre><div class="fragment"><div class="line"># Create an arm64 API 26 libc++ toolchain.</div><div class="line">$NDK/build/tools/make_standalone_toolchain.py \</div><div class="line"> --arch arm64 \</div><div class="line"> --api 26 \</div><div class="line"> --stl=libc++ \</div><div class="line"> --install-dir=$HOME/armnn-devenv/toolchains/aarch64-android-r17b</div><div class="line">export PATH=$HOME/armnn-devenv/toolchains/aarch64-android-r17b/bin:$PATH</div></div><!-- fragment --> <pre class="fragment"> 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).
+</pre><h2><a class="anchor" id="buildBoost"></a>Build the Boost C++ libraries</h2>
+<h3>Download Boost version 1.64:</h3>
+<div class="fragment"><div class="line">mkdir ~/armnn-devenv/boost</div><div class="line">cd ~/armnn-devenv/boost</div><div class="line">wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2</div><div class="line">tar xvf boost_1_64_0.tar.bz2</div></div><!-- fragment --><h3>Build:</h3>
+<pre class="fragment">(Requires gcc if not previously installed: `sudo apt install gcc`)
+</pre> <div class="fragment"><div class="line">echo &quot;using gcc : arm : aarch64-linux-android-clang++ ;&quot; &gt; $HOME/armnn-devenv/boost/user-config.jam</div><div class="line">cd ~/armnn-devenv/boost/boost_1_64_0</div><div class="line">./bootstrap.sh --prefix=$HOME/armnn-devenv/boost/install</div><div class="line">./b2 install --user-config=$HOME/armnn-devenv/boost/user-config.jam \</div><div class="line"> toolset=gcc-arm link=static cxxflags=-fPIC --with-filesystem \</div><div class="line"> --with-test --with-log --with-program_options -j16</div></div><!-- fragment --><h2><a class="anchor" id="buildCL"></a>Build the Compute Library</h2>
+<h3>Clone the Compute Library:</h3>
+<pre class="fragment">(Requires Git if not previously installed: `sudo apt install git`)
+</pre><div class="fragment"><div class="line">cd ~/armnn-devenv</div><div class="line">git clone https://github.com/ARM-software/ComputeLibrary.git</div></div><!-- fragment --><h3>Build:</h3>
+<pre class="fragment">(Requires SCons if not previously installed: `sudo apt install scons`)
+</pre> <div class="fragment"><div class="line">cd ComputeLibrary</div><div class="line">scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags=&quot;-fPIC&quot; \</div><div class="line"> benchmark_tests=0 validation_tests=0 os=android -j16</div></div><!-- fragment --><h2><a class="anchor" id="buildProtobuf"></a>Build Google's Protobuf library</h2>
+<h3>Clone protobuf:</h3>
+<div class="fragment"><div class="line">mkdir ~/armnn-devenv/google</div><div class="line">cd ~/armnn-devenv/google</div><div class="line">git clone https://github.com/google/protobuf.git</div><div class="line">cd protobuf</div><div class="line">git checkout -b v3.5.2 v3.5.2</div></div><!-- fragment --><h3>Build a native (x86) version of the protobuf libraries and compiler (protoc):</h3>
+<pre class="fragment">(Requires cUrl, autoconf, llibtool, and other build dependencies if not previously installed: `sudo apt install curl autoconf libtool build-essential g++`)
+</pre><div class="fragment"><div class="line">./autogen.sh</div><div class="line">mkdir x86_build</div><div class="line">cd x86_build</div><div class="line">../configure --prefix=$HOME/armnn-devenv/google/x86_pb_install</div><div class="line">make install -j16</div><div class="line">cd ..</div></div><!-- fragment --><h3>Build the arm64 version of the protobuf libraries:</h3>
+<div class="fragment"><div class="line">mkdir arm64_build</div><div class="line">cd arm64_build</div><div class="line">CC=aarch64-linux-android-clang \</div><div class="line"> CXX=aarch64-linux-android-clang++ \</div><div class="line"> CFLAGS=&quot;-fPIE -fPIC&quot; LDFLAGS=&quot;-pie -llog&quot; \</div><div class="line"> ../configure --host=aarch64-linux-android \</div><div class="line"> --prefix=$HOME/armnn-devenv/google/arm64_pb_install \</div><div class="line"> --with-protoc=$HOME/armnn-devenv/google/x86_pb_install/bin/protoc</div><div class="line">make install -j16</div><div class="line">cd ..</div></div><!-- fragment --><h2><a class="anchor" id="downloadTF"></a>Download TensorFlow</h2>
+<h3>Clone TensorFlow source code:</h3>
+<div class="fragment"><div class="line">cd ~/armnn-devenv/google/</div><div class="line">git clone https://github.com/tensorflow/tensorflow.git</div><div class="line">cd tensorflow/</div><div class="line">git checkout a0043f9262dc1b0e7dc4bdf3a7f0ef0bebc4891e</div></div><!-- fragment --> <pre class="fragment">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.
+</pre><h2><a class="anchor" id="buildArmNN"></a>Build ArmNN</h2>
+<h3>Clone ArmNN source code:</h3>
+<div class="fragment"><div class="line">cd ~/armnn-devenv/</div><div class="line">git clone https://github.com/ARM-software/armnn.git</div></div><!-- fragment --><h3>Generate TensorFlow protobuf definitions:</h3>
+<div class="fragment"><div class="line">cd ~/armnn-devenv/google/tensorflow</div><div class="line">~/armnn-devenv/armnn/scripts/generate_tensorflow_protobuf.sh \</div><div class="line"> $HOME/armnn-devenv/google/tf_pb $HOME/armnn-devenv/google/x86_pb_install</div></div><!-- fragment --><h3>Build ArmNN:</h3>
+<pre class="fragment">(Requires CMake if not previously installed: `sudo apt install cmake`)
+</pre><div class="fragment"><div class="line">mkdir ~/armnn-devenv/armnn/build</div><div class="line">cd ~/armnn-devenv/armnn/build</div><div class="line">CXX=aarch64-linux-android-clang++ \</div><div class="line">CC=aarch64-linux-android-clang \</div><div class="line">CXX_FLAGS=&quot;-fPIE -fPIC&quot; \</div><div class="line">cmake .. \</div><div class="line">-DCMAKE_SYSTEM_NAME=Android \</div><div class="line">-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \</div><div class="line">-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=$HOME/armnn-devenv/toolchains/aarch64-android-r17b/ \</div><div class="line">-DCMAKE_EXE_LINKER_FLAGS=&quot;-pie -llog&quot; \</div><div class="line">-DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary/ \</div><div class="line">-DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build \</div><div class="line">-DBOOST_ROOT=$HOME/armnn-devenv/boost/install/ \</div><div class="line">-DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 \</div><div class="line">-DTF_GENERATED_SOURCES=$HOME/armnn-devenv/google/tf_pb/ -DBUILD_TF_PARSER=1 \</div><div class="line">-DPROTOBUF_ROOT=$HOME/armnn-devenv/google/arm64_pb_install/</div><div class="line">make -j16</div></div><!-- fragment --><h2><a class="anchor" id="runArmNNUnitTests"></a>Run the ArmNN unit tests on an Android device</h2>
+<h3>Push the build results to an Android device and make symbolic links for shared libraries:</h3>
+<p>Currently adb version we have used for testing is 1.0.41.</p>
+<div class="fragment"><div class="line">adb push libarmnnTfParser.so /data/local/tmp/</div><div class="line">adb push libarmnn.so /data/local/tmp/</div><div class="line">adb push UnitTests /data/local/tmp/</div><div class="line">adb push $NDK/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so /data/local/tmp/</div><div class="line">adb push $HOME/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so /data/local/tmp/libprotobuf.so.15.0.1</div><div class="line">adb shell &#39;ln -s libprotobuf.so.15.0.1 /data/local/tmp/libprotobuf.so.15&#39;</div><div class="line">adb shell &#39;ln -s libprotobuf.so.15.0.1 /data/local/tmp/libprotobuf.so&#39;</div></div><!-- fragment --><h3>Push the files needed for the unit tests (they are a mix of files, directories and symbolic links):</h3>
+<div class="fragment"><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/testSharedObject</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/testSharedObject/* /data/local/tmp/src/backends/backendsCommon/test/testSharedObject/</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/testDynamicBackend</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/testDynamicBackend/* /data/local/tmp/src/backends/backendsCommon/test/testDynamicBackend/</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath1</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath1/* /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath1/</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath2/Arm_CpuAcc_backend.so /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/</div><div class="line">adb shell ln -s Arm_CpuAcc_backend.so /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/Arm_CpuAcc_backend.so.1</div><div class="line">adb shell ln -s Arm_CpuAcc_backend.so.1 /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/Arm_CpuAcc_backend.so.1.2</div><div class="line">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</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath2/Arm_GpuAcc_backend.so /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/</div><div class="line">adb shell ln -s nothing /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath2/Arm_no_backend.so</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath3</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath5</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath5/* /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath5/</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath6</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath6/* /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath6/</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath7</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath9</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/backendsCommon/test/backendsTestPath9/* /data/local/tmp/src/backends/backendsCommon/test/backendsTestPath9/</div><div class="line"></div><div class="line">adb shell mkdir -p /data/local/tmp/src/backends/dynamic/reference</div><div class="line">adb push -p ~/armnn-devenv/armnn/build/src/backends/dynamic/reference/Arm_CpuRef_backend.so /data/local/tmp/src/backends/dynamic/reference/</div></div><!-- fragment --><h3>Run ArmNN unit tests:</h3>
+<div class="fragment"><div class="line">adb shell &#39;LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/UnitTests&#39;</div></div><!-- fragment --> <pre class="fragment">If libarmnnUtils.a is present in `~/armnn-devenv/armnn/build/` and the unit tests run without failure then the build was successful.
+</pre><p> <br />
+<br />
+<br />
+<br />
+</p>
+<h2><a class="anchor" id="S3_2_cross_compilations_build_guide"></a>
+Cross Compilation Build Guide</h2>
+<ul>
+<li>
+<a href="#introduction">Introduction</a> </li>
+<li>
+<a href="#installCCT">Cross-compiling ToolChain</a> </li>
+<li>
+<a href="#buildProtobuf">Build and install Google's Protobuf library</a> </li>
+<li>
+<a href="#buildCaffe">Build Caffe for x86_64</a> </li>
+<li>
+<a href="#installBaarch">Build Boost library for arm64</a> </li>
+<li>
+<a href="#buildCL">Build Compute Library</a> </li>
+<li>
+<a href="#buildANN">Build ArmNN</a> </li>
+<li>
+<a href="#unittests">Run Unit Tests</a> </li>
+<li>
+<a href="#troubleshooting">Troubleshooting and Errors</a> </li>
+</ul>
+<h2><a class="anchor" id="introduction"></a>Introduction</h2>
+<p>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. The instructions show how to build the ArmNN core library and the Boost, Protobuf, Caffe and Compute Libraries necessary for compilation.</p>
+<h2><a class="anchor" id="installCCT"></a>Cross-compiling ToolChain</h2>
+<h3>Install the standard cross-compilation libraries for arm64:</h3>
+<div class="fragment"><div class="line">sudo apt install crossbuild-essential-arm64</div></div><!-- fragment --><h2><a class="anchor" id="buildProtobuf"></a>Build and install Google's Protobuf library</h2>
+<h3>Get protobuf-all-3.5.1.tar.gz from <a href="https://github.com/protocolbuffers/protobuf/releases/tag/v3.5.1">here</a>.</h3>
+<h3>Extract:</h3>
+<div class="fragment"><div class="line">tar -zxvf protobuf-all-3.5.1.tar.gz</div><div class="line">cd protobuf-3.5.1</div></div><!-- fragment --><h3>Build a native (x86_64) version of the protobuf libraries and compiler (protoc):</h3>
+<p>(Requires cUrl, autoconf, llibtool, and other build dependencies if not previously installed: sudo apt install curl autoconf libtool build-essential g++)</p>
+<div class="fragment"><div class="line">mkdir x86_64_build</div><div class="line">cd x86_64_build</div><div class="line">../configure --prefix=$HOME/armnn-devenv/google/x86_64_pb_install</div><div class="line">make install -j16</div><div class="line">cd ..</div></div><!-- fragment --><h3>Build the arm64 version of the protobuf libraries:</h3>
+<div class="fragment"><div class="line">mkdir arm64_build</div><div class="line">cd arm64_build</div><div class="line">CC=aarch64-linux-gnu-gcc \</div><div class="line">CXX=aarch64-linux-gnu-g++ \</div><div class="line">../configure --host=aarch64-linux \</div><div class="line">--prefix=$HOME/armnn-devenv/google/arm64_pb_install \</div><div class="line">--with-protoc=$HOME/armnn-devenv/google/x86_64_pb_install/bin/protoc</div><div class="line">make install -j16</div><div class="line">cd ..</div></div><!-- fragment --><h2><a class="anchor" id="buildCaffe"></a>Build Caffe for x86_64</h2>
+<h3>Ubuntu 16.04 installation. These steps are taken from the full Caffe installation documentation <a href="http://caffe.berkeleyvision.org/install_apt.html">here</a></h3>
+<h3>Install dependencies:</h3>
+<div class="fragment"><div class="line">sudo apt-get install libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev</div><div class="line">sudo apt-get install --no-install-recommends libboost-all-dev</div><div class="line">sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev</div><div class="line">sudo apt-get install libopenblas-dev</div><div class="line">sudo apt-get install libatlas-base-dev</div></div><!-- fragment --><h3>Download Caffe-Master from <a href="https://github.com/BVLC/caffe">here</a>.</h3>
+<div class="fragment"><div class="line">git clone https://github.com/BVLC/caffe.git</div><div class="line">cd caffe</div><div class="line">cp Makefile.config.example Makefile.config</div></div><!-- fragment --><h3>Adjust Makefile.config as necessary for your environment, for example:</h3>
+<div class="fragment"><div class="line">#CPU only version:</div><div class="line">CPU_ONLY := 1</div><div class="line"></div><div class="line">#Add hdf5 and protobuf include and library directories (Replace $HOME with explicit /home/username dir):</div><div class="line">INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/ $HOME/armnn-devenv/google/x86_64_pb_install/include/</div><div class="line">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/</div></div><!-- fragment --><h3>Setup environment:</h3>
+<div class="fragment"><div class="line">export PATH=$HOME/armnn-devenv/google/x86_64_pb_install/bin/:$PATH</div><div class="line">export LD_LIBRARY_PATH=$HOME/armnn-devenv/google/x86_64_pb_install/lib/:$LD_LIBRARY_PATH</div></div><!-- fragment --><h3>Compilation with Make:</h3>
+<div class="fragment"><div class="line">make all</div><div class="line">make test</div><div class="line">make runtest</div></div><!-- fragment --> <pre class="fragment">These should all run without errors
+</pre> <h3>caffe.pb.h and caffe.pb.cc will be needed when building ArmNN's Caffe Parser</h3>
+<h2><a class="anchor" id="installBaarch"></a>Build Boost library for arm64</h2>
+<h3>Build Boost library for arm64</h3>
+<p>Download Boost version 1.64 from <a href="http://www.boost.org/doc/libs/1_64_0/more/getting_started/unix-variants.html">here</a>. Using any version of Boost greater than 1.64 will fail to build ArmNN, due to different dependency issues.</p>
+<div class="fragment"><div class="line">tar -zxvf boost_1_64_0.tar.gz</div><div class="line">cd boost_1_64_0</div><div class="line">echo &quot;using gcc : arm : aarch64-linux-gnu-g++ ;&quot; &gt; user_config.jam</div><div class="line">./bootstrap.sh --prefix=$HOME/armnn-devenv/boost_arm64_install</div><div class="line">./b2 install toolset=gcc-arm link=static cxxflags=-fPIC --with-filesystem --with-test --with-log --with-program_options -j32 --user-config=user_config.jam</div></div><!-- fragment --><h2><a class="anchor" id="buildCL"></a>Build Compute Library</h2>
+<h3>Building the Arm Compute Library:</h3>
+<div class="fragment"><div class="line">git clone https://github.com/ARM-software/ComputeLibrary.git</div><div class="line">cd ComputeLibrary/</div><div class="line">scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags=&quot;-fPIC&quot; -j8 internal_only=0</div></div><!-- fragment --><h2><a class="anchor" id="buildANN"></a>Build ArmNN</h2>
+<h3>Compile ArmNN for arm64:</h3>
+<div class="fragment"><div class="line">git clone https://github.com/ARM-software/armnn.git</div><div class="line">cd armnn</div><div class="line">mkdir build</div><div class="line">cd build</div></div><!-- fragment --><h3>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:</h3>
+<div class="fragment"><div class="line">#!/bin/bash</div><div class="line">CXX=aarch64-linux-gnu-g++ \</div><div class="line">CC=aarch64-linux-gnu-gcc \</div><div class="line">cmake .. \</div><div class="line">-DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary \</div><div class="line">-DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build/ \</div><div class="line">-DBOOST_ROOT=$HOME/armnn-devenv/boost_arm64_install/ \</div><div class="line">-DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 \</div><div class="line">-DCAFFE_GENERATED_SOURCES=$HOME/armnn-devenv/caffe/build/src \</div><div class="line">-DBUILD_CAFFE_PARSER=1 \</div><div class="line">-DPROTOBUF_ROOT=$HOME/armnn-devenv/google/x86_64_pb_install/ \</div><div class="line">-DPROTOBUF_LIBRARY_DEBUG=$HOME/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so.15.0.1 \</div><div class="line">-DPROTOBUF_LIBRARY_RELEASE=$HOME/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so.15.0.1</div></div><!-- fragment --><h3>Run the build</h3>
+<div class="fragment"><div class="line">make -j32</div></div><!-- fragment --><h2><a class="anchor" id="unittests"></a>Run Unit Tests</h2>
+<h3>Copy the build folder to an arm64 linux machine</h3>
+<h3>Copy the libprotobuf.so.15.0.1 library file to the build folder</h3>
+<h3>cd to the build folder on your arm64 machine and set your LD_LIBRARY_PATH to its current location:</h3>
+<div class="fragment"><div class="line">cd build/</div><div class="line">export LD_LIBRARY_PATH=`pwd`</div></div><!-- fragment --><h3>Create a symbolic link to libprotobuf.so.15.0.1:</h3>
+<div class="fragment"><div class="line">ln -s libprotobuf.so.15.0.1 ./libprotobuf.so.15</div></div><!-- fragment --><h3>Run the UnitTests:</h3>
+<div class="fragment"><div class="line">./UnitTests</div><div class="line">Running 567 test cases...</div><div class="line"></div><div class="line"> No errors detected</div></div><!-- fragment --><h2><a class="anchor" id="troubleshooting"></a>Troubleshooting and Errors:</h2>
+<h2>Error adding symbols: File in wrong format</h2>
+<h3>When building armNN:</h3>
+<div class="fragment"><div class="line">/usr/local/lib/libboost_log.a: error adding symbols: File in wrong format</div><div class="line">collect2: error: ld returned 1 exit status</div><div class="line">CMakeFiles/armnn.dir/build.make:4028: recipe for target &#39;libarmnn.so&#39; failed</div><div class="line">make[2]: *** [libarmnn.so] Error 1</div><div class="line">CMakeFiles/Makefile2:105: recipe for target &#39;CMakeFiles/armnn.dir/all&#39; failed</div><div class="line">make[1]: *** [CMakeFiles/armnn.dir/all] Error 2</div><div class="line">Makefile:127: recipe for target &#39;all&#39; failed</div><div class="line">make: *** [all] Error 2</div></div><!-- fragment --><h3>Boost libraries are not compiled for the correct architecture, try recompiling for arm64</h3>
+<h2>Virtual memory exhausted</h2>
+<h3>When compiling the boost libraries:</h3>
+<div class="fragment"><div class="line">virtual memory exhausted: Cannot allocate memory</div></div><!-- fragment --><h3>Not enough memory available to compile. Increase the amount of RAM or swap space available.</h3>
+<h2>Unrecognized command line option '-m64'</h2>
+<h3>When compiling the boost libraries:</h3>
+<div class="fragment"><div class="line">aarch64-linux-gnu-g++: error: unrecognized command line option ‘-m64’</div></div><!-- fragment --><h3>Clean the boost library directory before trying to build with a different architecture:</h3>
+<div class="fragment"><div class="line">sudo ./b2 clean</div></div><!-- fragment --><h3>It should show the following for arm64:</h3>
+<div class="fragment"><div class="line">- 32-bit : no</div><div class="line">- 64-bit : yes</div><div class="line">- arm : yes</div></div><!-- fragment --><h2>Missing libz.so.1</h2>
+<h3>When compiling armNN:</h3>
+<div class="fragment"><div class="line">/usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: warning: libz.so.1, needed by /home/&lt;username&gt;/armNN/usr/lib64/libprotobuf.so.15.0.0, not found (try using -rpath or -rpath-link)</div></div><!-- fragment --><h3>Missing arm64 libraries for libz.so.1, these can be added by adding a second architecture to dpkg and explicitly installing them:</h3>
+<div class="fragment"><div class="line">sudo dpkg --add-architecture arm64</div><div class="line">sudo apt-get install zlib1g:arm64</div><div class="line">sudo apt-get update</div><div class="line">sudo ldconfig</div></div><!-- fragment --><h3>If apt-get update returns 404 errors for arm64 repos refer to section 5 below.</h3>
+<h3>Alternatively the missing arm64 version of libz.so.1 can be downloaded and installed from a .deb package <a href="https://launchpad.net/ubuntu/wily/arm64/zlib1g/1:1.2.8.dfsg-2ubuntu4">here</a></h3>
+<div class="fragment"><div class="line">sudo dpkg -i zlib1g_1.2.8.dfsg-2ubuntu4_arm64.deb</div></div><!-- fragment --><h2>Unable to install arm64 packages after adding arm64 architecture</h2>
+<h3>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:</h3>
+<h3>From stackoverflow <a href="https://askubuntu.com/questions/430705/how-to-use-apt-get-to-download-multi-arch-library/430718">here</a>.</h3>
+<h3>Open /etc/apt/sources.list with your preferred text editor.</h3>
+<h3>Mark all the current (default) repos as [arch=], e.g.</h3>
+<div class="fragment"><div class="line">deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial main restricted</div></div><!-- fragment --><h3>Then add the following:</h3>
+<div class="fragment"><div class="line">deb [arch=arm64] http://ports.ubuntu.com/ xenial main restricted</div><div class="line">deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates main restricted</div><div class="line">deb [arch=arm64] http://ports.ubuntu.com/ xenial universe</div><div class="line">deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates universe</div><div class="line">deb [arch=arm64] http://ports.ubuntu.com/ xenial multiverse</div><div class="line">deb [arch=arm64] http://ports.ubuntu.com/ xenial-updates multiverse</div><div class="line">deb [arch=arm64] http://ports.ubuntu.com/ xenial-backports main restricted universe multiverse</div></div><!-- fragment --><h3>Update and install again:</h3>
+<div class="fragment"><div class="line">sudo apt-get install zlib1g:arm64</div><div class="line">sudo apt-get update</div><div class="line">sudo ldconfig</div></div><!-- fragment --><h2>Undefined references to google::protobuf:: functions</h2>
+<h3>When compiling armNN there are multiple errors of the following type:</h3>
+<p>``<code> libarmnnCaffeParser.so: undefined reference to</code>google::protobuf:* ``` </p><h3>Missing or out of date protobuf compilation libraries.</h3>
+<p>Use the command 'protoc &ndash;version' to check which version of protobuf is available (version 3.5.1 is required). Follow the instructions above to install protobuf 3.5.1 Note this will require you to recompile Caffe for x86_64</p>
+<h2>Errors on strict-aliasing rules when compiling the Compute Library</h2>
+<h3>When compiling the Compute Library there are multiple errors on strict-aliasing rules:</h3>
+<div class="fragment"><div class="line">cc1plus: error: unrecognized command line option ‘-Wno-implicit-fallthrough’ [-Werror]</div></div><!-- fragment --><h3>Add Werror=0 to the scons command:</h3>
+<div class="fragment"><div class="line">scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags=&quot;-fPIC&quot; -j8 internal_only=0 Werror=0</div></div><!-- fragment --> </div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="footer">Generated on Fri Mar 13 2020 16:09:21 for ArmNN by
+ <a href="http://www.doxygen.org/index.html">
+ <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
+ </ul>
+</div>
+</body>
+</html>