Closed satoru-i closed 11 months ago
Are you sure Qt5Widgets
is properly set up in the sysroot? How have you verified it? If properly set in the sysroot, then, in principle, you wouldn't have this issue.
@vmayoral, It seems QT is not set by default in rootfs, so can you confirm that in the KR260 firmware, did you enabled QT explicitly ? If not, then there might not be any QT libs. Can you guide on how to create a new firmware with QT enabled in sysroot?
@vmayoral, It seems QT is not set by default in rootfs, so can you confirm that in the KR260 firmware, did you enabled QT explicitly ? If not, then there might not be any QT libs. Can you guide on how to create a new firmware with QT enabled in sysroot?
QT's not part-of (or generally needed) an embedded ROS rootfs. It implies a significant amount of deps. and adds unnecessary weight, unless you need it, as it seems the case above. This can of course be added by re-creating the firmware artifacts again.
Happy to work together with you and the team @jasvinderkhurana to recreate the firmware artifacts and include what's needed. Let's take this offline to a separate channel. Very excited and discuss this in a next collaboration.
Hi @vmayoral, @jasvinderkhurana, Thank you both for your comments. As you've probably noticed, I installed KRS exactly as instructed, so I'm using the sysroot found in the firmware below.
I would appreciate it if you could point me to "how to create a new firmware with QT enabled in sysroot".
@satoru-i , Can you please confirm whether you are using Ubuntu flow or Petalinux/Yocto flow ? I will check this.
Hi @jasvinderkhurana, I'm using Ubuntu flow(Ubuntu 22.04, Cross-compilation development) found here. https://xilinx.github.io/KRS/sphinx/build/html/docs/install.html
@satoru-i, Thanks for confirming.. I also find this strange because I can see the Qt5Widgets cmake at .../krs_ws/acceleration/firmware/kr260/sysroots/aarch64-xilinx-linux/usr/lib/aarch64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake , but the environment is not picking up. I am looking at this and will update you as soon as I get any solution.
@satoru-i, QT is acting differently here, though all the dependencies are available in sysroot it is somehow not able to find it. I have found one workaround to fix the cmake find problem, add dependencies(Qt5Core, Qt5Gui, Qt5Widgets) before Qt5 in CMakelists.txt of turtlesim see below:
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Widgets)
Even after fixing Qt5Widgets error, it gives another issue:
aarch64-binfmt-P: Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory
gmake[2]: *** [CMakeFiles/turtlesim_node.dir/build.make:74: include/turtlesim/moc_turtle_frame.cpp] Error 255
gmake[1]: *** [CMakeFiles/Makefile2:598: CMakeFiles/turtlesim_node.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< turtlesim [3.70s, exited with code 2]
Hi @jasvinderkhurana, thank you for looking into it. Applying that workaround to CMakelists.txt of turtlesim worked around the cmake find problem, and got the same error.
So I did "sudo ln -s ~/krs_ws/install/../acceleration/firmware/kr260/sysroots/aarch64-xilinx-linux/lib/ld-linux-aarch64.so.1 /lib/ld-linux-aarch64.so.1", but I got another error.
Starting >>> turtlesim
--- stderr: turtlesim
/home/satorui/krs_ws/acceleration/firmware/kr260/sysroots/aarch64-xilinx-linux/usr/lib/qt5/bin/moc: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
gmake[2]: *** [CMakeFiles/turtlesim_node.dir/build.make:74: include/turtlesim/moc_turtle_frame.cpp] Error 127
gmake[1]: *** [CMakeFiles/Makefile2:598: CMakeFiles/turtlesim_node.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< turtlesim [7.66s, exited with code 2]
This looks like the same issue as the workaround for installing KRS.
https://xilinx.github.io/KRS/sphinx/build/html/docs/install.html
@satoru-i , that's right, the workaround you did is correct! And regarding your latest error, I also faced the same issue and I observed that "/home/satorui/krs_ws/acceleration/firmware/kr260/sysroots/aarch64-xilinx-linux/usr/lib/qt5/bin/moc" is an Arm binary and it is trying to be executed on x86 machine which is causing the trouble.
The cmake is trying to create a .cpp file from QT. So, as a workaround I compiled the package for x86 first and this creates a moc_turtle_frame.cpp file in build folder. Take that file compile it with turtlesime source code. This is succeeding for me. I have attached the file here and see the changes done in CMakelists.txt of turtlesim below:
Let me know if this is working for you as well.
Hi @jasvinderkhurana, Thanks for letting me know the workaround. I also built it and was able to run it on the KR260. With this information, I'm going to try out some user apps using HLS. Thank you. :)
I tried cross-compiling turtlesim for KR260 to get used to using the KRS. https://github.com/ros/ros_tutorials/tree/humble-devel/turtlesim
However, when I try to build with the following command, I get an error.
Qt5Widgets exists in sysroot, but how can I build an app that uses Qt5Widgets?