libPocoFoundation.so present but can't be found on Linux arm
Target OS:
Ubuntu 18.04.2 LTS
Target System:
Linux arm 4.14.79-ti-r84 #1 SMP PREEMPT armv7l armv7l armv7l GNU/Linux
I cross-compiled the source for ROS 2 using the following tutorial (on a Ubuntu 16.04 x86_64)
As I am building for a beagle-board (bbb), the examples are only for arm64 so i made these following changes in the cross_compile repository:
4 ARG ARM_ARCH=arm32v7
...
37 RUN sh -c 'echo "deb [arch=amd64,armhf] http://repo.ros2.org/ubuntu/main \
`lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'
and in entry_point.sh:
$ export TARGET_ARCH=arm
$ export TARGET_TRIPLE=arm-linux-gnueabihf
But after the built, I exported the ros build with:
docker cp ros2_cc:/root/cc_ws/ros2_ws .
and send it in the home directory of my board.
Then I tried to test the talker/listener examples:
$ ros2 run demo_nodes_cpp talker
and I received this error:
Failed to load entry point 'launch': libPocoFoundation.so.50: cannot open shared object file: No such file or directory The C extension '/home/ubuntu/ros2_ws/install/lib/python3.6/site-packages/rclpy/_rclpy.cpython-36m-arm-linux-gnueabihf.so' failed to be imported while being present on the system. Please refer to 'https://githu b.com/ros2/ros2/wiki/Rclpy-Import-error-hint' for possible solutions
[...]
/home/ubuntu/ros2_ws/install/lib/demo_nodes_cpp/talker: error while loading shared libraries: libPocoFoundation.so.50: cannot open shared object file: No such file or directory
same for the others entry points (start,status,list,get...).
From the tutorial, there is a known issue with the the Poco pre-built. But these steps are included in the entry_point. Also the provided link didn't help much.
Thank for your help.
[EDIT] Downloading the missing libraries seems to fix the issue as suggested in the comments.
For a long term-fix: Trying to get the fix submitted by alsora:
It returns me:
CMake Error: The source directory "/root/cc_ws/ros2_ws/build/fastcdr/-FORCE_BUILD_VENDOR_PKG=ON" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
---
Failed <<< fastcdr [ Exited with code 1 ]
--- stderr: poco_vendor
CMake Error: The source directory "/root/cc_ws/ros2_ws/build/poco_vendor/-FORCE_BUILD_VENDOR_PKG=ON" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
---
Failed <<< poco_vendor [ Exited with code 1 ]
Aborted <<< ament_cmake_core
Aborted <<< ament_flake8
Summary: 1 package finished [4.06s]
2 packages failed: fastcdr poco_vendor
2 packages aborted: ament_cmake_core ament_flake8
2 packages had stderr output: fastcdr poco_vendor
188 packages not processed
Have you checked that
libPocoFoundation.so.50
exists in your target system? It should be under/home/ubuntu/ros2_ws/install/lib
That library will be compiled only if it is not already found in the system and this could create problems when cross-compiling, since it may be that your sysroot or host system includes it, but the target system does not.
@alsora: you are right, the
libPocoFoundation.so.50
didn't exist in/home/ubuntu/ros2_ws/install/lib
. I installed on the target board and I encountered a new missing library 'libtinyxml2.so.6' which I installed also separately. Now the example works but I still receive the messageFailed to load entry point 'create': No module named 'catkin_pkg'
It raises the following question: why the some libraries are missing from the build I got from the cross compilation ? Is it a question of missing link while building ? Anyway, Thank you, it fixed my current problem.