0

I built tensorflow-lite.a with cmake using instruction from tensorflow cmake build.

But when trying to use this library in cpp application I'm getting undefined reference errors (mostly from ruy).

  1. My guess is tensorflow-lite.a does not contain all the necessery libraries like ruy, am I correct??
  2. Do I need to build RUY separately ?? to use tensorflow-lite??
  3. Is only way possible to use this static library is by adding sub_directory in your cmake ??

Attaching a log of error:

Init(TfLiteContext*, char const*, unsigned long)':
mfcc.cc:(.text+0x15c0): undefined reference to `flatbuffers::ClassicLocale::instance_'
mfcc.cc:(.text+0x1634): undefined reference to `flatbuffers::ClassicLocale::instance_'
mfcc.cc:(.text+0x16aa): undefined reference to `flatbuffers::ClassicLocale::instance_'
mfcc.cc:(.text+0x1b7b): undefined reference to `flatbuffers::ClassicLocale::instance_'
.
.
.
mirror_pad.cc:(.text+0x138e): undefined reference to `ruy::Context::mutable_thread_pool()'
mirror_pad.cc:(.text+0x13a5): undefined reference to `ruy::ThreadPool::ExecuteImpl(int, int, ruy::Task*)'
mirror_pad.cc:(.text+0x1460): undefined reference to `ruy::Context::mutable_thread_pool()'
mirror_pad.cc:(.text+0x1479): undefined reference to `ruy::ThreadPool::ExecuteImpl(int, int, ruy::Task*)'
mirror_pad.cc:(.text+0x1534): undefined reference to `ruy::Context::mutable_thread_pool()'
mirror_pad.cc:(.text+0x154d): undefined reference to `ruy::ThreadPool::ExecuteImpl(int, int, ruy::Task*)'
mirror_pad.cc:(.text+0x1763): undefined reference to `ruy::Context::mutable_thread_pool()'
mirror_pad.cc:(.text+0x190b): undefined reference to `ruy::Context::mutable_thread_pool()'
mirror_pad.cc:(.text+0x1ab2): undefined reference to `ruy::Context::mutable_thread_pool()'
mirror_pad.cc:(.text+0x1c69): undefined reference to `ruy::Context::mutable_thread_pool()'
mirror_pad.cc:(.text+0x1e3a): undefined reference to `ruy::Context::mutable_thread_pool()'
/path/libtensorflow-lite.a(numeric_verify.cc.o): In function `tflite::ops::custom::numeric_verify::Init(TfLiteContext*, char const*, unsigned long)':
numeric_verify.cc:(.text+0xcd1): undefined reference to `flatbuffers::ClassicLocale::instance_'
numeric_verify.cc:(.text+0x10e7): undefined reference to `flatbuffers::ClassicLocale::instance_'
fad
  • 43
  • 1
  • 9

1 Answers1

1
  1. Microsoft Visual C++ Redistributable latest supported downloads https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170

  2. Python 3.7+ 64-bit release for Windows https://www.python.org/downloads/windows/

  3. Those reading are in the same directory as in the CMakeList at "F:/temp/tflite/tensorflow_src/tflite_build/ruy/ruy/CMakeLists.txt"

  4. Compile using the Lastest C++

General Grievance
  • 4,555
  • 31
  • 31
  • 45