ROS2 beta on Ubuntu 16.04 fails

I downloaded and installed ROS2 beta on Ubuntu 16.04, 64 bits as explained here:


When I start to execute the talker I get the following error message:
ufechner@tuxedo:~ . ~/ros2_install/ros2-linux/setup.bash ufechner@tuxedo:~ talker
talker: error while loading shared libraries: librclcpp.so: cannot open shared object file: No such file or directory
ufechner@tuxedo:~$

Any idea?

Uwe

I would try to replace the first command with:
source ~/ros2_install/ros2-linux/setup.bash

Thanks for the hint, but it didn’t help:
ufechner@tuxedo:~$ source ~/ros2_install/ros2-linux/setup.bash
ufechner@tuxedo:~$ talker
talker: error while loading shared libraries: librclcpp.so: cannot open shared object file: No such file or directory
ufechner@tuxedo:~$ locate librclcpp.so
/home/ufechner/ros2_install/ros2-linux/lib/librclcpp.so
ufechner@tuxedo:~$

The file librclcpp.so does exist, though.

Any more tips?

The following changes solved two problems:

Firstly, the environment variable LD_LIBRARY_PATH is deleted by
Ubuntu for security reasons. Additional paths have to be added
to a new file in the directory /etc/ld.so.conf.d

For example by doing

sudo gedit /etc/ld.so.conf.d/ros2.conf

and adding the line:

/home/<username>/ros2_install/ros2-linux/lib

Replace <username> with your own username.

and executing

sudo ldconfig

Furthermore, one package was missing:

sudo apt-get install libpocofoundation9v5


Now I get a different error message:

ufechner@tuxedo:~$ talker
terminate called after throwing an instance of 'std::runtime_error'
  what():  could not create publisher: type support not from this implementation, at /home/rosbuild/ci_scripts/ws/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/functions.cpp:782, at /home/rosbuild/ci_scripts/ws/src/ros2/rcl/rcl/src/rcl/publisher.c:81
Aborted (core dumped)
ufechner@tuxedo

Any idea, how to fix this?

Uwe

That’s surprising since we’ve never run into this on our Xenial machines. Perhaps you have a flavor of Ubuntu that is setting some additional security settings? According to their wiki you can set LD_LIBRARY_PATH so long as it is in an interactive shell:

https://help.ubuntu.com/community/EnvironmentVariables#File-location_related_variables

This sounds like one of the features macOS’s SIP system (which we have to disable to get our binaries to work on macOS):

Furthermore, one package was missing:

sudo apt-get install libpocofoundation9v5

We should probably add this to the prerequisites list (at least) on the binary installation wiki page: GitHub - ros2/ros2: The Robot Operating System, is a meta operating system for robots.

Any idea, how to fix this?

As for the new error you’re seeing, that’s something we’ve seen before, basically for some reason it is trying to use two different backends for ROS 2 at the same time (one for message passing and a different one for type support) which results in that error. This usually doesn’t happen in the binaries (unless I’m just unfamiliar with this problem with beta 1 on Linux) since we only build for Fast-RTPS in our binaries.

Can you double check you are not mixing the binaries and older binaries or builds of ROS 2?

@dirk-thomas can you confirm this is the right package to install?

For use from binary libpocofoundation9v5 looks correct. For building from source you will likely need libpoco-dev.

I ran into this reference suggesting that if you’re in the group utmp it will be removed?

@ufechner7 are you running your tests inside a temporary user account or have you turned on higher than usual security?

In the man for ld.so(8)

       LD_LIBRARY_PATH
              A  list  of  directories  in  which to search for ELF libraries at execution-time.  The items in the list are separated by
              either colons or semicolons.  Similar to the PATH environment variable.  This  variable  is  ignored  in  secure-execution
              mode.
1 Like