Hi there,
I've just successfully built the image and the SDK of the new imx-linux version (gatesgarth) and I'm having an issue compiling Tensorflow-Lite c++ apps within the new SDK environment.
Here is the basic Yocto config I used to build the "imx-image-full" image and its SDK in a docker container:
Build Configuration:
BB_VERSION = "1.48.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-18.04"
TARGET_SYS = "aarch64-poky-linux"
MACHINE = "imx8mpevk"
DISTRO = "fsl-imx-wayland"
DISTRO_VERSION = "5.10-gatesgarth"
TUNE_FEATURES = "aarch64 armv8a crc cortexa53 crypto"
Once I try to compile a custom Tensorflow lite application within the SDK, lots of linker errors show up such as this one:
/home/user/gatesgarth_sdk/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/10.2.0/real-ld: /home/user/gatesgarth_sdk/sysroots/cortexa53-crypto-poky-linux/usr/lib/libtensorflow-lite.a(transpose_conv.cc.o): in function `ruy::Kernel<(ruy::Path)32, signed char, signed char, int, int>::Run(ruy::PMat<signed char> const&, ruy::PMat<signed char> const&, ruy::MulParams<int, int> const&, int, int, int, int, ruy::Mat<int>*) const':
/usr/src/debug/tensorflow-lite/2.4.0-r0/build/ruy/ruy/kernel_arm.h:123: undefined reference to `ruy::Kernel8bitNeonDotprodInOrder(ruy::KernelParams8bit<8, 8> const&)'
Most of the "undefined reference" errors are related to RUY functions that Tensorflow Lite uses so it seems that somehow these functions are missing in the static library (libtensorflow-lite.a - 179M). The app compilation command is based on the indications described in the i.MX Machine Learning User's Guide document:
$CC label_image.cc bitmap_helpers.cc ../../tools/evaluation/utils.cc \
-I=/usr/include/tensorflow/lite/tools/make/downloads/flatbuffers/include \
-I=/usr/include/tensorflow/lite/tools/make/downloads/absl \ -O1 -DTFLITE_WITHOUT_XNNPACK
-ltensorflow-lite -lstdc++ -lpthread -lm -ldl -lrt
Even using a very simplified code, the errors show up when performing this basic declaration:
tflite::ops::builtin::BuiltinOpResolver resolver;
I've checked the "tensorflow-lite_2.4.0.bb" file used to build Tensorflow Lite for the "gatesgarth" yocto distribution and the following flags are explicitly specified:
EXTRA_OECMAKE = "-DTFLITE_ENABLE_XNNPACK=on -DTFLITE_ENABLE_RUY=on -DTFLITE_ENABLE_NNAPI=on ${S}/tensorflow/lite/"
Then, seems that RUY is enabled when compiling the static library but it does not work when compiling apps with it.
Any ideas of what it might be happening? I did not have this issue in the older "zeus" SDK.
Thank you very much.