From 4c3c1f486ab775eacb1f6455f8468f9be2c3e4f7 Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Mon, 17 Feb 2020 13:49:54 +0000 Subject: IVGCVSW-4403 Add standalone backend build steps to BuildGuideAndroidNDK Signed-off-by: Narumol Prangnawarat Change-Id: I339511938ca1356581ffac96baa642d4299d3240 --- BuildGuideAndroidNDK.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/BuildGuideAndroidNDK.md b/BuildGuideAndroidNDK.md index 0f9953f3f1..701dcdb78a 100644 --- a/BuildGuideAndroidNDK.md +++ b/BuildGuideAndroidNDK.md @@ -178,9 +178,50 @@ All downloaded or generated files will be saved inside the `~/armnn-devenv` dire -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMNNREF=1 \ -DTF_GENERATED_SOURCES=$HOME/armnn-devenv/google/tf_pb/ -DBUILD_TF_PARSER=1 \ -DPROTOBUF_ROOT=$HOME/armnn-devenv/google/arm64_pb_install/ - make -j16 ``` + To include standalone sample dynamic backend tests, add the argument to enable the tests and the dynamic backend path to the CMake command: + + ```bash + -DSAMPLE_DYNAMIC_BACKEND=1 \ + -DDYNAMIC_BACKEND_PATHS=$SAMPLE_DYNAMIC_BACKEND_PATH + ``` + Where $SAMPLE_DYNAMIC_BACKEND_PATH is the path where libArm_SampleDynamic_backend.so library file is pushed + + * Run the build + ```bash + make -j16 + ``` + +#### Build Standalone Sample Dynamic Backend +* The sample dynamic backend is located in armnn/src/dynamic/sample + ```bash + mkdir build + cd build + ``` + +* Use CMake to configure the build environment, update the following script and run it from the armnn/src/dynamic/sample/build directory to set up the armNN build: + ```bash + #!/bin/bash + CXX=aarch64-linux-android-clang++ \ + CC=aarch64-linux-android-clang \ + CXX_FLAGS="-fPIE -fPIC" \ + cmake \ + -DCMAKE_SYSTEM_NAME=Android \ + -DCMAKE_CXX_FLAGS=--std=c++14 \ + -DCMAKE_EXE_LINKER_FLAGS="-pie -llog" \ + -DCMAKE_MODULE_LINKER_FLAGS="-llog" \ + -DBOOST_ROOT=$HOME/armnn-devenv/boost/install \ + -DBoost_SYSTEM_LIBRARY=$HOME/armnn-devenv/boost/install/lib/libboost_system.a \ + -DBoost_FILESYSTEM_LIBRARY=$HOME/armnn-devenv/boost/install/lib/libboost_filesystem.a \ + -DARMNN_PATH=$HOME/armnn-devenv/armnn/build/libarmnn.so .. + ``` + +* Run the build + ```bash + make + ``` + #### Run the ArmNN unit tests on an Android device @@ -234,6 +275,14 @@ All downloaded or generated files will be saved inside the `~/armnn-devenv` dire adb push -p ~/armnn-devenv/armnn/build/src/backends/dynamic/reference/Arm_CpuRef_backend.so /data/local/tmp/src/backends/dynamic/reference/ ``` + If the standalone sample dynamic tests are enabled, also push libArm_SampleDynamic_backend.so library file to the folder specified as $SAMPLE_DYNAMIC_BACKEND_PATH when ArmNN is built. + This is the example when $SAMPLE_DYNAMIC_BACKEND_PATH is specified as /data/local/tmp/dynamic/sample/: + + ```bash + adb shell mkdir -p /data/local/tmp/dynamic/sample/ + adb push -p ${WORKING_DIR}/armnn/src/dynamic/sample/build/libArm_SampleDynamic_backend.so /data/local/tmp/dynamic/sample/ + ``` + * Run ArmNN unit tests: ```bash -- cgit v1.2.1