Build Arm NN

Configure the Arm NN SDK build using CMake. To do this, you will need to change your directory to the Arm NN directory and enter the following parameters to CMake:

-DARMCOMPUTE_ROOT

The location of your Compute Library source files directory.

-DARMCOMPUTE_BUILD_DIR

The location of your Compute Library build directory.

-DBOOST_ROOT

The directory used for Boost (see prefix flag used above).

-DTF_GENERATED_SOURCES

The location of your protobuf generated source files.

-DPROTOBUF_ROOT

The location of your protobuf install directory.

-DBUILD_TF_LITE_PARSER

Set this =1 to ensure the TensorFlow Lite parser is built.

-DTF_LITE_GENERATED_PATH

The location of the TensorFlow Lite schema directory.

-DFLATBUFFERS_ROOT

The root directory where FlatBuffers was installed.

-DFLATBUFFERS_LIBRARY

The path to the built FlatBuffers library.

For example:

$ cd $BASEDIR/armnn
$ mkdir build
$ cd build
$ cmake .. -DARMCOMPUTE_ROOT=$BASEDIR/ComputeLibrary -DARMCOMPUTE_BUILD_DIR=$BASEDIR/ComputeLibrary/build -DBOOST_ROOT=$BASEDIR/boost -DTF_GENERATED_SOURCES=$BASEDIR/tensorflow-protobuf -DPROTOBUF_ROOT=$BASEDIR/protobuf-host -DBUILD_TF_LITE_PARSER=1 -DTF_LITE_GENERATED_PATH=$BASEDIR/tensorflow/tensorflow/lite/schema -DFLATBUFFERS_ROOT=$BASEDIR/flatbuffers -DFLATBUFFERS_LIBRARY=$BASEDIR/flatbuffers/libflatbuffers.a
$ make

Duration: About 12 minutes.

If you are supporting NEON, add this argument to the CMake command:

-DARMCOMPUTENEON=1

If you are supporting OpenCL, add this argument to the CMake command:

-DARMCOMPUTECL=1

If you want to include Arm NN reference support, add this argument to the CMake command:

-DARMNNREF=1

If you want to include standalone sample dynamic backend tests, add the following argument to enable the tests and the 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 following Arm NN library files will be built in the armnn/build directory:

  • libarmnn.so
  • libarmnnTfLiteParser.so
  • libarmnnTfParser.so
  • libarmnnUtils.a
Previous Next