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 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. Change the directory to <the installation root>.
  3. Generate C++ sources and headers using the protobuf compiler. To do this, enter:
    pushd tensorflow
    ${ARMNN_DIR}/armnn/scripts/generate_tensorflow_protobuf.sh <directory where the generated files will be placed> <the protobuf install directory>
    popd
  4. 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> -DTF_GENERATED_SOURCES=<the output directory from step 3> -DBUILD_TF_PARSER=1 -DPROTOBUF_ROOT=<the location of your protobuf install directory>

    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 ArmNN reference support, add this argument to the CMake command:

    -DARMNNREF=1
  5. Enter make.
Previous Next