I am working on a project where I need to distribute a shared library that loads a TensorFlow Lite model and performs inference on input data provided by the user. My goal is for the users to be able to use my library without having to install any additional dependencies, which means I need to build TensorFlow Lite as a self-contained library.
I am currently using CMake according to the official TensorFlow Lite documentation, and both the C++ and C APIs work well when building an test executable. However, when I try to build a shared library using add_library
, I encounter a large number of undefined symbols.
I have also attempted to pack all the .a files under build/_deps together using ar
command, but that did not resolve the issue either.
Has anyone else faced a similar requirement? If so, could you please provide guidance or a solution?