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:
|
The location of your Compute Library source files directory. |
|
The location of your Compute Library build directory. |
|
The directory used for Boost (see prefix flag used above). |
|
The location of your protobuf generated source files. |
|
The location of your protobuf install directory. |
|
Set this =1 to ensure the TensorFlow Lite parser is built. |
|
The location of the TensorFlow Lite schema directory. |
|
The root directory where FlatBuffers was installed. |
|
The path to the schema compiler. |
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 \ -DFLATC_DIR=$BASEDIR/flatbuffers-1.12.0/build $ make
Note
Please remove the old CMakeCache.txt
file before creating a new build. To remove the file, enter the following command:
rm -f CMakeCache.txt
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
libgatordMockService.a
libtimelineDecoderJson.so
libtimelineDecoder.so