Hi Weidong,
Thank you for your answer.
The SDK is successfully generated when using the "core-image-minimal" and "imx-image-multimedia"; however, it fails with the "imx-image-full" as previously stated.
In previous "imx-linux" versions, I usually use the "imx-image-full" SDK environment for developing preliminary tests with machine learning libraries. For the "gatesgarth" "imx-image-multimedia" SDK environment, I had to include the following lines in the "local.conf" file as described in the i.MX Yocto Project User's Guide:
IMAGE_INSTALL_append = "packagegroup-imx-ml"
TOOLCHAIN_TARGET_TASK_append += " tensorflow-lite-staticdev tensorflow-lite-dev armnn-dev onnxruntime-dev"
When I try to compile the same simple Tensorflow Lite test (developed using the "imx-zeus" environment) within this "gatesgarth" SDK environment, the process fails. The linker seems to complain with a lot of "undefined reference" errors of "ruy" functions even when compiling a very simplified test code. This is one of these errors:
/home/user/GatesgarthSDK_5_10/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/10.2.0/real-ld: /home/user/GatesgarthSDK_5_10/sysroots/cortexa53-crypto-poky-linux/usr/lib/libtensorflow-lite.a(cpu_backend_context.cc.o): in function `tflite::CpuBackendContext::ClearCaches()':
/usr/src/debug/tensorflow-lite/2.4.0-r0/git/tensorflow/lite/kernels/cpu_backend_context.h:51: undefined reference to `ruy::Context::ClearPrepackedCache()'
My thought is that there might be something that I'm missing when generating the SDK with the machine learning package explicitly defined using the "imx-image-multimedia". The official documentation related to machine learning Yocto configuration and TFLite application compilation from both Zeus and Gatesgarth linux versions look identical. Maybe there is something missing that is included in the "imx-image-full" like the static TFLite library compiled with RUY enabled.
As described in the i.MX Machine Learning User's Guide documentation, the compilation command is the following:
LIBS = -ltensorflow-lite -lstdc++ -lpthread -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lm -ldl -lrt
INCLUDE_PATH = -I/home/user/GatesgarthSDK_5_10/sysroots/cortexa53-crypto-poky-linux/usr/include/tensorflow/lite/tools/make/downloads/flatbuffers/include \
-I/home/user/GatesgarthSDK_5_10/sysroots/cortexa53-crypto-poky-linux/usr/include/tensorflow/lite/tools/make/downloads/absl
TFLITE_UTILS = utils.cc
${CC} main.cpp $(TFLITE_UTILS) $(INCLUDE_PATH) -O3 -s DTFLITE_WITHOUT_XNNPACK -DTFLITE_USE_NPU -o $(EXE_NAME) $(LIBS)
Thank you again for your help.