Building the environment

To use the Arm NN SDK, you must build the environment on your platform or board.

To build the environment:

  1. Compile the Arm Compute Library using SCons. To do this, change your directory to the Compute Library Git repository on your machine, and enter scons arch=arm64-v8a extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0 for ARMv8-A or scons extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0 for ARMv7-A.

    If you want to enable benchmark tests, set benchmark_tests to 1. If you want to enable validation tests, set validation_tests to 1.

    You can enable support for NEON on the CPU, and support for OpenCL on an Arm Mali GPU if you have one.

    If you want to support OpenCL for your Arm Mali GPU, add these arguments to the SCons command:

    opencl=1 embed_kernels=1

    If you want to support NEON, add this argument to your SCons command:

    neon=1 
  2. Locate the Caffe protobuf files. They are called caffe.pb.h and caffe.pb.cc. These are in a directory called caffe/proto. Make a note of the location of this parent directory, you will need this later.
  3. Configure the Arm NN SDK build using CMake. To do this, change your directory to the Arm NN directory and enter:

    mkdir build
    cd build
    cmake .. -DARMCOMPUTE_ROOT=<the location of your Compute Library source files directory> -DARMCOMPUTE_BUILD_DIR=<the location of your Compute Library source files directory>/build -DBOOST_ROOT=<directory used with the prefix flag> -DCAFFE_GENERATED_SOURCES=<the location of the parent directory of caffe.pb.h and caffe.pb.cc> -DBUILD_CAFFE_PARSER=1 

    If you want to support NEON, add this argument to the CMake command:

    -DARMCOMPUTENEON=1

    If you want to support OpenCL, add this argument to the CMake command:

    -DARMCOMPUTECL=1

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

    -DARMNNREF=1
  4. Enter make.
Previous Next