Closed qdlmcfresh closed 5 months ago
Maybe I need to add TENSORFLOW_TARGET_ARCH to the recipe, but I don't know the details.
Please share the detailed steps.
Maybe I need to add TENSORFLOW_TARGET_ARCH to the recipe, but I don't know the details.
* https://github.com/NobuoTsukamoto/meta-tensorflow-lite/blob/langdale/recipes-framework/tensorflow-lite/libtensorflow-lite_2.10.1.bb#L35
Please share the detailed steps.
Since it already fails at cloning i doubt it would be that... The board im using has an arm cortex a9 https://digilent.com/reference/programmable-logic/zybo-z7/start What steps would you need exactly?
I managed to get around the git clone error by linking /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-petalinux-linux/etc/ssl/certs/ca-certificates.crt
to an existing ca-certificates.crt
file
now the build fails with:
| /home/qdl/thanna/thannaOS/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/python3-tensorflow-lite/2.10.1-r0/recipe-sysroot-native/usr/bin/arm-xilinx-linux-gnueabi/../../libexec/arm-xilinx-linux-gnueabi/gcc/arm-xilinx-linux-gnueabi/12.2.0/ld: _deps/cpuinfo-build/libcpuinfo.a(init.c.o): in function `cpuinfo_initialize':
| /usr/src/debug/python3-tensorflow-lite/2.10.1-r0/cpuinfo/src/init.c:58: undefined reference to `cpuinfo_arm_linux_init'
| /home/qdl/thanna/thannaOS/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/python3-tensorflow-lite/2.10.1-r0/recipe-sysroot-native/usr/bin/arm-xilinx-linux-gnueabi/../../libexec/arm-xilinx-linux-gnueabi/gcc/arm-xilinx-linux-gnueabi/12.2.0/ld: _pywrap_tensorflow_interpreter_wrapper.so: hidden symbol `cpuinfo_arm_linux_init' isn't defined
| /home/qdl/thanna/thannaOS/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/python3-tensorflow-lite/2.10.1-r0/recipe-sysroot-native/usr/bin/arm-xilinx-linux-gnueabi/../../libexec/arm-xilinx-linux-gnueabi/gcc/arm-xilinx-linux-gnueabi/12.2.0/ld: final link failed: bad value
| collect2: error: ld returned 1 exit status
| ninja: build stopped: subcommand failed.
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/qdl/repos/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.10.1.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4833 tasks of which 4831 didn't need to be rerun and 2 failed.
Summary: 2 tasks failed:
/home/qdl/repos/meta-tensorflow-lite/recipes-framework/tensorflow-lite/libtensorflow-lite_2.10.1.bb:do_compile
/home/qdl/repos/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.10.1.bb:do_compile
Summary: There was 1 WARNING message.
Summary: There were 2 ERROR messages, returning a non-zero exit code.
ERROR: Failed to build project. Check the /home/qdl/thanna/thannaOS/build/build.log file for more details...
qdl@thanna-dev:~/thanna/thannaOS$
I would like to know the procedure for which layer is used when bitbake.
I'm new to Petalinux.
Are the following layers required?
git://github.com/openembedded/meta-openembedded.git
git://git.linaro.org/openembedded/meta-linaro.git
git://github.com/meta-qt5/meta-qt5.git
git://github.com/xilinx/meta-xilinx
or https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842475/PetaLinux+Yocto+Tips
# WARNING: this configuration has been automatically generated and in
# most cases should not be edited. If you need more flexibility than
# this configuration provides, it is strongly suggested that you set
# up a proper instance of the full build system and use that instead.
BBPATH = "${TOPDIR}"
SDKBASEMETAPATH = "/home/qdl/thanna/thannaOS/components/yocto"
BBLAYERS := " \
${SDKBASEMETAPATH}/layers/poky/meta \
${SDKBASEMETAPATH}/layers/poky/meta-poky \
${SDKBASEMETAPATH}/layers/meta-xilinx/meta-microblaze \
${SDKBASEMETAPATH}/layers/meta-xilinx/meta-xilinx-core \
${SDKBASEMETAPATH}/layers/meta-xilinx/meta-xilinx-standalone \
${SDKBASEMETAPATH}/layers/meta-xilinx/meta-xilinx-bsp \
${SDKBASEMETAPATH}/layers/meta-xilinx/meta-xilinx-vendor \
${SDKBASEMETAPATH}/layers/meta-xilinx-tools \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-perl \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-python \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-filesystems \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-gnome \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-multimedia \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-networking \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-webserver \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-xfce \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-initramfs \
${SDKBASEMETAPATH}/layers/meta-openembedded/meta-oe \
${SDKBASEMETAPATH}/layers/meta-xilinx/meta-xilinx-contrib \
${SDKBASEMETAPATH}/layers/meta-virtualization \
${SDKBASEMETAPATH}/layers/meta-openamp \
${SDKBASEMETAPATH}/layers/meta-kria \
${SDKBASEMETAPATH}/layers/meta-security \
${SDKBASEMETAPATH}/layers/meta-security/meta-tpm \
${SDKBASEMETAPATH}/layers/meta-xilinx-tsn \
${SDKBASEMETAPATH}/layers/meta-petalinux \
${SDKBASEMETAPATH}/layers/meta-qt5 \
${SDKBASEMETAPATH}/layers/meta-aws \
${SDKBASEMETAPATH}/layers/meta-ros/meta-ros-common \
${SDKBASEMETAPATH}/layers/meta-ros/meta-ros2 \
${SDKBASEMETAPATH}/layers/meta-ros/meta-ros2-humble \
${SDKBASEMETAPATH}/layers/meta-jupyter \
${SDKBASEMETAPATH}/layers/meta-system-controller \
${SDKBASEMETAPATH}/layers/meta-vitis \
/home/qdl/thanna/thannaOS/project-spec/meta-user \
/home/qdl/repos/meta-tensorflow-lite \
/home/qdl/thanna/thannaOS/components/yocto/workspace \
"
this is the autogenerated bblayers.conf i get after starting a build.
In my environment, by adding TENSORFLOW_TARGET_ARCH
to the recipe, I was able to build successfully without any download errors.
Is it possible for you to share changes to your recipe?
$ MACHINE=zc706-zynq7 bitbake libtensorflow-lite
NOTE: Started PRServer with DBfile: /home/nobuo/Data/yocto/petalinux/build/cache/prserv.sqlite3, Address: 127.0.0.1:41091, PID: 791874
WARNING: Host distribution "fedora-39" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |##########################################################################################################################################################################################################################################################################################| Time: 0:00:03
Loaded 6345 entries from dependency cache.
Parsing recipes: 100% |########################################################################################################################################################################################################################################################################################| Time: 0:00:02
Parsing of 4412 .bb files complete (4401 cached, 11 parsed). 6355 targets, 394 skipped, 1 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "2.2.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "fedora-39"
TARGET_SYS = "arm-xilinx-linux-gnueabi"
MACHINE = "zc706-zynq7"
DISTRO = "petalinux"
DISTRO_VERSION = "2023.2+snapshot-9b5053b49a808cbb3136c40900da8f9126d46e5e"
TUNE_FEATURES = "arm vfp cortexa9 neon thumb callconvention-hard"
TARGET_FPU = "hard"
SOC_VARIANT = "7z"
XILINX_RELEASE_VERSION = "v2023.2"
XILINX_XSCT_VERSION = "2023.2"
DISTRO_NAME = "PetaLinux"
ROS_DISTRO = "humble"
ROS_VERSION = "2"
ROS_PYTHON_VERSION = "3"
meta
meta-poky = "HEAD:c572c1a1e0ea573e64a2864d8893800104d36a67"
meta-microblaze
meta-xilinx-core
meta-xilinx-standalone
meta-xilinx-bsp
meta-xilinx-vendor = "HEAD:0879fa02f63a815a38ee404f285e5da3d48fedf2"
meta-xilinx-tools = "HEAD:351d5790c96b0da5ebc42a672d1debdcea6d0b0e"
meta-perl
meta-python
meta-filesystems
meta-gnome
meta-multimedia
meta-networking
meta-webserver
meta-xfce
meta-initramfs
meta-oe = "HEAD:4c7ef6548bc26754243547b55d6d5844563e39a2"
meta-xilinx-contrib = "HEAD:0879fa02f63a815a38ee404f285e5da3d48fedf2"
meta-virtualization = "HEAD:3eafe79389cb0a58a9c7fbeebcf215aad8903910"
meta-openamp = "HEAD:aa1edd482265f0a29f3c269590da54141ceb228a"
meta-kria = "HEAD:b91adefecf6e5d6e6c8be558900d5f7249c95e54"
meta-security
meta-tpm = "HEAD:a4562b19126ab655869da6db40e8eff49f84c490"
meta-xilinx-tsn = "HEAD:54d9d3801979451fc413d6dc6c09525c3fe9bb2a"
meta-petalinux = "HEAD:9b5053b49a808cbb3136c40900da8f9126d46e5e"
meta-qt5 = "HEAD:1a917695e439d602ec85e1db4e0478533cfbfaa8"
meta-aws = "HEAD:0b47914b4465257295dbf13f54f4026c5830cbbe"
meta-ros-common
meta-ros2
meta-ros2-humble = "HEAD:b937872e702d325e83b7b466783a5702ecec0f60"
meta-jupyter = "HEAD:ad54a81a36e2734284709cee118c1944e6d510e7"
meta-system-controller = "HEAD:1023dd58807522cab7f068d161ffce5788a7efa5"
meta-vitis = "HEAD:83a6ec4fa3f54974ea5eae4502baa172140cf82f"
meta-tensorflow-lite = "langdale:ccd912ebbf256537302da40ae5390f61e0b6b01e"
WARNING: Your host glibc version (2.38) is newer than that in uninative (2.37). Disabling uninative so that sstate is not corrupted.
Initialising tasks: 100% |#####################################################################################################################################################################################################################################################################################| Time: 0:00:06
Sstate summary: Wanted 5 Local 0 Mirrors 0 Missed 5 Current 159 (0% match, 96% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 675 tasks of which 666 didn't need to be rerun and all succeeded.
Summary: There were 2 WARNING messages.
TENSORFLOW_TARGET_ARCH
Great, thanks for your efforts!! Where exactly did you make changes? So i can try to replicate that?
diff --git a/recipes-framework/tensorflow-lite/libtensorflow-lite_2.10.1.bb b/recipes-framework/tensorflow-lite/libtensorflow-lite_2.10.1.bb
index c6f048d..550b204 100644
--- a/recipes-framework/tensorflow-lite/libtensorflow-lite_2.10.1.bb
+++ b/recipes-framework/tensorflow-lite/libtensorflow-lite_2.10.1.bb
@@ -41,6 +41,7 @@ TENSORFLOW_TARGET_ARCH:raspberrypi2 = "armv7"
TENSORFLOW_TARGET_ARCH:raspberrypi3 = "armv7"
TENSORFLOW_TARGET_ARCH:raspberrypi4 = "armv7"
TENSORFLOW_TARGET_ARCH:raspberrypi-cm3 = "armv7"
+TENSORFLOW_TARGET_ARCH:zc706-zynq7 = "armv7"
TENSORFLOW_TARGET_ARCH:raspberrypi0-2w-64 = "aarch64"
TUNE_CCARGS:raspberrypi0-2w-64 = ""
interesting,,,
petalinux-build
still fails with
| /home/qdl/thanna/thannaOS/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/python3-tensorflow-lite/2.10.1-r0/recipe-sysroot-native/usr/bin/arm-xilinx-linux-gnueabi/../../libexec/arm-xilinx-linux-gnueabi/gcc/arm-xilinx-linux-gnueabi/12.2.0/ld: _deps/cpuinfo-build/libcpuinfo.a(init.c.o): in function `cpuinfo_initialize':
| /usr/src/debug/python3-tensorflow-lite/2.10.1-r0/cpuinfo/src/init.c:58: undefined reference to `cpuinfo_arm_linux_init'
| /home/qdl/thanna/thannaOS/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/python3-tensorflow-lite/2.10.1-r0/recipe-sysroot-native/usr/bin/arm-xilinx-linux-gnueabi/../../libexec/arm-xilinx-linux-gnueabi/gcc/arm-xilinx-linux-gnueabi/12.2.0/ld: _pywrap_tensorflow_interpreter_wrapper.so: hidden symbol `cpuinfo_arm_linux_init' isn't defined
| /home/qdl/thanna/thannaOS/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/python3-tensorflow-lite/2.10.1-r0/recipe-sysroot-native/usr/bin/arm-xilinx-linux-gnueabi/../../libexec/arm-xilinx-linux-gnueabi/gcc/arm-xilinx-linux-gnueabi/12.2.0/ld: final link failed: bad value
| collect2: error: ld returned 1 exit status
| ninja: build stopped: subcommand failed.
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/qdl/repos/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.10.1.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4840 tasks of which 4551 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/qdl/repos/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.10.1.bb:do_compile
Summary: There was 1 WARNING message.
Summary: There was 1 ERROR message, returning a non-zero exit code.
ERROR: Failed to build project. Check the /home/qdl/thanna/thannaOS/build/build.log file for more details...
petalinux-build -c libtensorflow-lite
seems to compile though
qdl@thanna-dev:~/thanna/thannaOS$ petalinux-build -c libtensorflow-lite
[INFO] Sourcing buildtools
[INFO] Building libtensorflow-lite
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating workspace directory
INFO: bitbake libtensorflow-lite
NOTE: Started PRServer with DBfile: /home/qdl/thanna/thannaOS/build/cache/prserv.sqlite3, Address: 127.0.0.1:37097, PID: 138436
Loading cache: 100% |#################################################################| Time: 0:00:02
Loaded 6347 entries from dependency cache.
Parsing recipes: 100% |###############################################################| Time: 0:00:02
Parsing of 4413 .bb files complete (4404 cached, 9 parsed). 6356 targets, 392 skipped, 1 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |############################################################| Time: 0:00:04
Sstate summary: Wanted 81 Local 5 Mirrors 76 Missed 0 Current 165 (100% match, 100% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 832 tasks of which 832 didn't need to be rerun and all succeeded.
INFO: Failed to copy built images to tftp dir: /tftpboot
[INFO] Successfully built libtensorflow-lite
Only the libtensorflow-lite
recipe was modified from the first comment.
Please add TENSORFLOW_TARGET_ARCH:zc706-zynq7 = "armv7"
to other recipes as well.
Only the
libtensorflow-lite
recipe was modified from the first comment.Please add
TENSORFLOW_TARGET_ARCH:zc706-zynq7 = "armv7"
to other recipes as well.* tensorflow-lite-benchmark * tensorflow-lite-label-image * tensorflow-lite-minimal * libtensorflow-lite-c * python3-tensorflow-lite
this did the trick, thanks again!
Hi, im trying to integrate this in a petalinux project. Im getting the following error while compiling:
somehow it fails to clone abseil-cpp. Can you make anything of this? (yocto version is langdale)