Build Arm NN

Configure the Arm NN SDK build using CMake. To configure the Arm NN SDK, you must change your directory to the Arm NN directory and enter the required parameters to CMake.

The following table lists the parameters that apply to all APIs:

Parameter  Description
 -DARMCOMPUTE_ROOT The location of your Arm Compute Library source files directory
 -DARMCOMPUTE_BUILD_DIR The location of your Arm Compute Library build directory
 -DBOOST_ROOT The directory you used for Boost. This parameter is the value you used for the prefix flag during Boost build process. Or, if you installed libboost-all-dev package in your environment instead of building the boost library, use the -DSHARED_BOOST=ON flag.
 -DARMCOMPUTENEON=1 Add this argument if you are supporting the Arm Neon architecture. We recommend enabling this option on the Raspberry Pi.
 -DARMCOMPUTECL=1 Add this argument if you are supporting OpenCL.
 -DARMNNREF=1 Add this argument if you want to include Arm NN reference support.

The following table lists the parameters for the ONNX parser. You must use these parameters with this parser: 

Parameter  Description
 -DTF_GENERATED_SOURCES  The location of your protobuf generated source files
 -DPROTOBUF_ROOT  The location of your protobuf install directory
 -DBUILD_ONNX_PARSER=1  Ensures the ONNX parser builds

The following table lists the parameters for the TensorFlow Lite parser. You must use these parameters with this parser:

Parameter  Description
 -DBUILD_TF_LITE_PARSER=1  To ensure the TensorFlow Lite parser builds, include this argument.
 -DTF_LITE_GENERATED_PATH  The location of the TensorFlow Lite schema directory
 -DFLATBUFFERS_ROOT  The root directory where FlatBuffers is installed.
 -DFLATC_DIR  The path to the schema compiler

 For example, the following commands build the TensorFlow Lite parser:

$ cd $BASEDIR/armnn
$ mkdir build
$ cd build
$ cmake .. -DARMCOMPUTE_ROOT=$BASEDIR/ComputeLibrary \ -DARMCOMPUTE_BUILD_DIR=$BASEDIR/ComputeLibrary/build \ -DSHARED_BOOT=ON \\ -DTF_GENERATED_SOURCES=$BASEDIR/tensorflow-protobuf \ -DBUILD_TF_LITE_PARSER=1 \ -DTF_LITE_GENERATED_PATH=$BASEDIR/tensorflow/tensorflow/lite/schema \ -DFLATBUFFERS_ROOT=$BASEDIR/flatbuffers \ -DFLATC_DIR=$BASEDIR/flatbuffers-1.12.0/build \ -DARMCOMPUTENEON=1 \ -DARMNNREF=1 
$ make

If you want to include standalone sample dynamic backend tests, add the following arguments to enable the tests and dynamic backend path to the CMake command:

-DSAMPLE_DYNAMIC_BACKEND=1 -DDYNAMIC_BACKEND_PATHS=<the location of the sample dynamic backend>

Also, after building Arm NN, build the standalone sample dynamic backend using the guide in the following path, $BASEDIR/armnn/src/dynamic/README.md#standalone-dynamic-backend-build.

The executables are in the armnn/build directory.

Check that following binaries are in the armnn/build folder for all parsers:

  • libarmnn.so
  • libarmnnBasePipeServer.so
  • libtimelineDecoderJson.so
  • libtimelineDecoder.so

Check that the following binaries are in the armnn/build folder for the following specific parsers:

ONNX parser:

libarmnnOnnxParser.so

TensorFlow Lite:

libarmnnTfLiteParser.so

TensorFlow:

libarmnnTfParser.so
Previous Next