arm
arm

Reputation: 117

Tensorflow lite build fails for ARM926 processor

All,

I am trying to build the tensorflow lite for my target processor ARM926EJ-S processor (ARM5te architecture). I've replicated the build script and build settings for my target processor from Rasp PI build script and settings. Here are my build settings for my target processor in arm926_makefile.inc:

# Settings for ARM926.
ifeq ($(TARGET),arm926)
  TARGET_ARCH := armv5te

  ifeq ($(TARGET_ARCH), armv5te)
    TARGET_TOOLCHAIN_PREFIX := //arm-eabi-uclibc/usr/bin/arm-linux-
    CXXFLAGS += \
      -march=armv5te \
      -mcpu=arm926ej-s \
      -funsafe-math-optimizations \
      -ftree-vectorize \
      -fPIC

    CFLAGS += \
      -march=armv5te \
      -mcpu=arm926ej-s \
      -funsafe-math-optimizations \
      -ftree-vectorize \
      -std=c99 \
      -fPIC

    LDFLAGS := \
      -Wl,--no-export-dynamic \
      -Wl,--exclude-libs,ALL \
      -Wl,--gc-sections \
      -Wl,--as-needed
  endif

  LIBS := \
    -latomic \
    -lstdc++ \
    -lpthread \
    -lm \
    -ldl

endif

The build script builds bunch files successfully. But, it complains mostly about math functions like round, atoi, min, max of std namespace. My target processor's toolchain version is arm-linux-g++ (Buildroot 2014.08) 4.9.2. The same tensorflow lite builds successfully using Pi toolchain version arm-linux-gnueabihf-g++ (GCC) 8.3.0.

I do see those math functions declared and defined in my toolchain but they are not being identified by tensorflow-lite build. Btw.. I tried using global ::round() then it needs to be replaced many many places and other math functions too. There must be easy way or passing some configuration to enable those functions from my toolchain.

Can someone point me to right direction to build tensorflow-lite for ARM926?

Here are the build errors from my toolchain:

./tensorflow/lite/kernels/internal/reference/reduce.h:385:71: error: no matching function for call to 'min(double, float)'
./tensorflow/lite/kernels/internal/round.h:34:10: error: 'round' is not a member of 'std'
   return std::round(x);
/tensorflow/tensorflow/lite/tools/make/downloads/eigen/Eigen/src/Core/GlobalFunctions.h:93:36: note:   'Eigen::round'
   EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(round,scalar_round_op,nearest integer,\sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round)
./tensorflow/lite/kernels/internal/reference/concatenation.h:125:36: error: 'round' is not a member of 'std'
./tensorflow/lite/kernels/internal/reference/reduce.h:374:28: error: 'round' is not a member of 'std'

Btw.. I also tried using latest Rasp Pi toolchain to build the tensorflow lite for my target processor using compile options -march=armv5te and -mcpu=arm926ej-s. It builds but does not run - I think the rasp pi toolchain does not generate correct machine code for ARM926 and ARMv5te CPU architecture.

I would appreciate and welcome any pointers or ideas to solve this tensorflow-lite build issues for ARM9 processor.

Thanks, Arm

Upvotes: 0

Views: 271

Answers (0)

Related Questions