1# Build TensorFlow Lite for ARM64 boards 2 3## Cross compiling 4 5### Installing the toolchain 6 7```bash 8sudo apt-get update 9sudo apt-get install crossbuild-essential-arm64 10``` 11 12> If you are using Docker, you may not use `sudo`. 13 14### Building 15 16Clone this Tensorflow repository. Run this script at the root of the repository 17to download all the dependencies: 18 19> The Tensorflow repository is in `/tensorflow` if you are using 20> `tensorflow/tensorflow:nightly-devel` docker image, just try it. 21 22```bash 23./tensorflow/lite/tools/make/download_dependencies.sh 24``` 25 26Note that you only need to do this once. 27 28Compile: 29 30```bash 31./tensorflow/lite/tools/make/build_aarch64_lib.sh 32``` 33 34This should compile a static library in: 35`tensorflow/lite/gen/gen/aarch64_armv8-a/lib/libtensorflow-lite.a`. 36 37## Native compiling 38 39These steps were tested on HardKernel Odroid C2, gcc version 5.4.0. 40 41Log in to your board, install the toolchain. 42 43```bash 44sudo apt-get install build-essential 45``` 46 47First, clone the TensorFlow repository. Run this at the root of the repository: 48 49```bash 50./tensorflow/lite/tools/make/download_dependencies.sh 51``` 52 53Note that you only need to do this once. 54 55Compile: 56 57```bash 58./tensorflow/lite/tools/make/build_aarch64_lib.sh 59``` 60 61This should compile a static library in: 62`tensorflow/lite/gen/gen/aarch64_armv8-a/lib/libtensorflow-lite.a`. 63