NXP mx8 Platform tensorflow-lite build error [How to Solve]

Solutions provided by NXP
Compiling L5.4.3_1.0.0 BSP On Ubuntu 180.4 LTS – NXP Community
1. Compile tensorflow-lite with bitbake
bitbake tensorflow-lite -c do_configure -v -f
The following error occurs, at this time you can see the download of the wrong package
FAILED: ruy-populate-prefix/src/ruy-populate-stamp/ruy-populate-download
The specific path is
tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/_deps/ruy-subbuild/ruy-populate-prefix/src/ruy-populate-stamp/ruy-populate-download

tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/_deps/ruy-subbuild/ruy-populate-prefix/src/

Check whether there is a corresponding zip package in the modified directory, and copy it to the tensorflow pack folder created in the corresponding root directory.

| FAILED: ruy-populate-prefix/src/ruy-populate-stamp/ruy-populate-download
| cd /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build && /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/recipe-sysroot-native/usr/bin/cmake -P /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/_deps/ruy-subbuild/ruy-populate-prefix/src/ruy-populate-stamp/download-ruy-populate.cmake && /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/recipe-sysroot-native/usr/bin/cmake -P /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/_deps/ruy-subbuild/ruy-populate-prefix/src/ruy-populate-stamp/verify-ruy-populate.cmake && /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/recipe-sysroot-native/usr/bin/cmake -P /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/_deps/ruy-subbuild/ruy-populate-prefix/src/ruy-populate-stamp/extract-ruy-populate.cmake && /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/recipe-sysroot-native/usr/bin/cmake -E touch /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/_deps/ruy-subbuild/ruy-populate-prefix/src/ruy-populate-stamp/ruy-populate-download
| ninja: build stopped: subcommand failed.
|
| CMake Error at /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/FetchContent.cmake:989 (message):
|   Build step for ruy failed: 1
| Call Stack (most recent call first):
|   /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/FetchContent.cmake:1118:EVAL:2 (__FetchContent_directPopulate)
|   /work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/FetchContent.cmake:1118 (cmake_language)
|   tools/cmake/modules/OverridableFetchContent.cmake:531 (FetchContent_Populate)
|   tools/cmake/modules/ruy.cmake:30 (OverridableFetchContent_Populate)
|   tools/cmake/modules/Findruy.cmake:16 (include)
|   CMakeLists.txt:197 (find_package)
|
|
| -- Configuring incomplete, errors occurred!
| See also "/work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/CMakeFiles/CMakeOutput.log".
| See also "/work/code/temp/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/CMakeFiles/CMakeError.log".
| + bb_sh_exit_handler
| + ret=1
| + [ 1 != 0 ]
| + echo WARNING: exit code 1 from a shell command.
| WARNING: exit code 1 from a shell command.
| + exit 1

The second error;

tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/pthreadpool-download

Check whether there is a zip in this directory, and in the copy to tensorflow pack folder

ninja: build stopped: subcommand failed.
-- Downloading pthreadpool to /work/code/test/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/pthreadpool-source (define PTHREADPOOL_SOURCE_DIR to avoid it)
-- Configuring done
-- Generating done
-- Build files have been written to: /work/code/test/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/pthreadpool-download
[1/9] Creating directories for 'pthreadpool'
[2/9] Performing download step (download, verify and extract) for 'pthreadpool'
-- Downloading...
   dst='/work/code/test/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/pthreadpool-download/pthreadpool-prefix/src/545ebe9f225aec6dca49109516fac02e973a3de2.zip'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/Maratyszcza/pthreadpool/archive/545ebe9f225aec6dca49109516fac02e973a3de2.zip'
-- [download 100% complete]
-- verifying file...
       file='/work/code/test/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/pthreadpool-download/pthreadpool-prefix/src/545ebe9f225aec6dca49109516fac02e973a3de2.zip'
-- Downloading... done
-- extracting...
     src='/work/code/test/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/pthreadpool-download/pthreadpool-prefix/src/545ebe9f225aec6dca49109516fac02e973a3de2.zip'
     dst='/work/code/test/ver/build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/pthreadpool-source'
-- extracting... [tar xfz]

3. Subsequent errors change in turn.

4. Execute this../cp.sh script during bitmake tensorflow Lite – C compile – V – f compilation, and tensorflow Lite will be compiled successfully.

#!/bin/bash
mkdir -p ./../build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/_deps/ruy-subbuild/ruy-populate-prefix/src/
cp 54774a7a2cf85963777289193629d4bd42de4a59.zip  ./../build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/_deps/ruy-subbuild/ruy-populate-prefix/src/


mkdir -p ./../build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/cpuinfo-download/cpuinfo-prefix/src/
cp 5916273f79a21551890fd3d56fc5375a78d1598d.zip ../build-imx-robot/tmp/work/cortexa53-crypto-poky-linux/tensorflow-lite/2.5.0-r0/build/cpuinfo-download/cpuinfo-prefix/src/

Read More: