1 # Cross building for Android
3 **Note: To set up a basic build environment on your development PC, please read the [howto.md](../howto.md) document first. The cross build covered in this document assumes that you have an environment in which the native build operates normally without problems.**
5 Supported Architecture : AARCH64 only (ARM32 is not supported yet)
9 Use `tools/cross/install_android_ndk.sh` script to prepare Android NDK. This is recommended way to build Android NDK.
10 You may download it yourself from the offical Android NDK website, but the script does a little more than just downloading and unzipping.
14 ### Host Environment Requirements
16 With Ubuntu 16.04, everything is fine except one. CMake 3.6.0 or later is required for Android NDK CMake support.
17 So if you want to use Docker, please use `infra/docker/Dockerfile.1804` which is based on Ubuntu 18.04. It has CMake 3.10.2.
20 docker build --network host -t nnas1804 -f infra/docker/Dockerfile.1804 infra/docker
23 ### Get prebuilt ARM Compute Library
25 Download prebuilt binary from [github](https://github.com/ARM-software/ComputeLibrary/releases). Check the version we support and platform(Android).
27 Then extract the tarball to the folder indicated as EXT_ACL_FOLDER in the example below. We will use the following file in `lib/android-arm64-v8a-neon-cl`.
30 libarm_compute_core.so
31 libarm_compute_graph.so
35 ### Build and install the runtime
37 Some tools/libs are still not supported and those are not built by default - mostly due to dependency on Boost library.
38 Please refer to `infra/nnfw/cmake/options/options_aarch64-android.cmake` for details.
40 Different from cross build for linux,
42 - `NDK_DIR` is required
44 Here is an example of using Makefile.
49 NDK_DIR=/path/android-tools/r20/ndk \
50 EXT_ACL_FOLDER=/path/arm_compute-v19.11.1-bin-android/lib/android-arm64-v8a-neon-cl \
51 make -f Makefile.template install