|
ONE - On-device Neural Engine
|
Note: To set up a basic build environment on your development PC, please read the how-to-build-runtime.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.
Supported Architecture : AARCH64 only
There are two ways to get Android NDK: install Android NDK on your PC or use docker image which already has Android NDK installed.
You can use tools/cross/install_android_sdk.sh script to prepare Android SDK including NDK.
If --install-dir is not specified, Android SDK will be installed in tools/cross/android_sdk.
You can find NDK in {android-sdk-dir}/ndk/{ndk-version} directory.
You can check default install NDK version by running tools/cross/install_android_sdk.sh -h command.
Installed NDK version can be changed by specifying --ndk-version option like below:
If you want to install NDK version in existing android sdk directory, you can use --update option like below:
CMake 3.6.0 or later is required for Android NDK r27d CMake support.
If you want to use docker image, please use infra/docker/android-sdk/Dockerfile of our repository or pull the image nnfw/one-devtools:android-sdk from DockerHub. It includes Android SDK and NDK.
You can build the docker image with following command:
Some tools/libs are still not supported and those are not built by default - mostly due to dependency on HDF5 library.
Different from cross build for linux,
runtime/infra/cmake/buildtool/cross/toolchain_aarch64-android.cmakeANDROID_NDK environment variable or CMAKE_ANDROID_NDK cmake variable is requiredIf you are using docker image nnfw/one-devtools:android-sdk, you don't need to specify above variable because environment variable is already set in the image.
Here is an example of using Makefile.
Otherwise, you can use command