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.

-DBUILD_TF_PARSER

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

-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 -DBUILD_TF_PARSER=1 -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

The following Arm NN library files will be built in the armnn/build directory:

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