ROS2 Simulation launch doesnt start becuase of undefined symbol: ATL_dgeset

Hi,

I just created a snapcraft for a ROS2 simulation in Foxy. It built correctly (although had some warnings ) But when launching it gives this error:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[INFO] [launch]: All log files can be found below /home/tgrip/snap/box-bot-ros2/x1/.ros/log/2021-02-18-16-58-18-779835-tgrip-laptop-46672
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gzserver-1]: process started with pid [46708]
[INFO] [gzclient -2]: process started with pid [46710]
[INFO] [spawn_box_bot.py-3]: process started with pid [46712]
[spawn_box_bot.py-3] Traceback (most recent call last):
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/lib/box_bot_description/spawn_box_bot.py”, line 41, in
[spawn_box_bot.py-3] main()
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/lib/box_bot_description/spawn_box_bot.py”, line 11, in main
[spawn_box_bot.py-3] cli = node.create_client(SpawnEntity, ‘/spawn_entity’)
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/opt/ros/foxy/lib/python3.8/site-packages/rclpy/node.py”, line 1248, in create_client
[spawn_box_bot.py-3] check_for_type_support(srv_type)
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/opt/ros/foxy/lib/python3.8/site-packages/rclpy/type_support.py”, line 29, in check_for_type_support
[spawn_box_bot.py-3] msg_type.class.import_type_support()
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/opt/ros/foxy/lib/python3.8/site-packages/gazebo_msgs/srv/_spawn_entity.py”, line 369, in import_type_support
[spawn_box_bot.py-3] _spawn_entity.Metaclass_SpawnEntity_Request.import_type_support()
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/opt/ros/foxy/lib/python3.8/site-packages/gazebo_msgs/srv/_spawn_entity.py”, line 43, in import_type_support
[spawn_box_bot.py-3] from geometry_msgs.msg import Pose
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/opt/ros/foxy/lib/python3.8/site-packages/geometry_msgs/msg/init.py”, line 3, in
[spawn_box_bot.py-3] from geometry_msgs.msg._accel_with_covariance import AccelWithCovariance # noqa: F401
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/opt/ros/foxy/lib/python3.8/site-packages/geometry_msgs/msg/_accel_with_covariance.py”, line 9, in
[spawn_box_bot.py-3] import numpy # noqa: E402, I100
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/usr/lib/python3/dist-packages/numpy/init.py”, line 145, in
[spawn_box_bot.py-3] from . import lib
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/usr/lib/python3/dist-packages/numpy/lib/init.py”, line 9, in
[spawn_box_bot.py-3] from .index_tricks import *
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/usr/lib/python3/dist-packages/numpy/lib/index_tricks.py”, line 13, in
[spawn_box_bot.py-3] import numpy.matrixlib as matrixlib
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/usr/lib/python3/dist-packages/numpy/matrixlib/init.py”, line 6, in
[spawn_box_bot.py-3] from .defmatrix import *
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/usr/lib/python3/dist-packages/numpy/matrixlib/defmatrix.py”, line 13, in
[spawn_box_bot.py-3] from numpy.linalg import matrix_power
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/usr/lib/python3/dist-packages/numpy/linalg/init.py”, line 51, in
[spawn_box_bot.py-3] from .linalg import *
[spawn_box_bot.py-3] File “/snap/box-bot-ros2/x1/usr/lib/python3/dist-packages/numpy/linalg/linalg.py”, line 35, in
[spawn_box_bot.py-3] from numpy.linalg import lapack_lite, _umath_linalg
[spawn_box_bot.py-3] ImportError: /snap/box-bot-ros2/x1/usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3: undefined symbol: ATL_dgeset
[ERROR] [spawn_box_bot.py-3]: process has died [pid 46712, exit code 1, cmd ‘/snap/box-bot-ros2/x1/lib/box_bot_description/spawn_box_bot.py /snap/box-bot-ros2/x1/share/box_bot_description/robot/box_bot.urdf --ros-args’].

Here you have the git with everything: GIT

I compiled using the command:

snapcraft --enable-experimental-extensions

Installed:

sudo snap install box-bot-ros2_0.1_amd64.snap --devmode --dangerous

Any ideas?

I think this comes down to the alternatives issue. Read through this approach, see if that helps. @sergiusens, @cjp256 this has been coming up a lot lately, would be nice to have a better solution there.

Hi,

I tried the install solution but I dont see where it has to go in order to build, it always keeps giving issues:

parts: ros-demos: plugin: colcon source: https://bitbucket.org/theconstructcore/box_bot.git source-branch: foxy build-packages: [make, gcc, g++] stage-packages: [ros-foxy-gazebo-ros-pkgs, ros-foxy-ros2launch, ros-foxy-urdf, libatlas-base-dev]

install: | set -ex for dir in $SNAPCRAFT_PART_INSTALL/usr/lib//; do (cd $dir; if [ -f blas/libblas.so.3. ]; then ln -s blas/libblas.so.3.* libblas.so.3 fi) done

This just doesn’t work. Is there a way to put a script file ? How? Because it keeps giving the error:

Issues while validating snapcraft.yaml: The ‘parts/install’ property does not match the required schema: ‘./fix_install.sh’ is not of type ‘object’, ‘null’

Any insight here? Because I don’t find documentation examples on how to use this install tag insid ethe parts.

Ah yes, try that this way:

override-build: |
  snapcraftctl build
  for dir in $SNAPCRAFT_PART_INSTALL/usr/lib/<em>/; do
  # ... you get the idea

Hi,

It keeps giving this issue:

Issues while validating snapcraft.yaml: could not find expected ‘:’ on line 22, column 3

Screenshot from 2021-02-18 21-22-59

Am I indenting someting wrong?

Yeah indent everything under override-build. Looks like the rest of the file is using two spaces.

Now gives this errros:

Issues while validating snapcraft.yaml: The ‘parts/override-build’ property does not match the required schema: ‘snapcraftctl build\nset -ex\nfor dir in $SNAPCRAFT_PART_INSTALL/usr/lib//; do\n (cd $dir;\n if [ -f blas/libblas.so.3. ]; then\n ln -s blas/libblas.so.3.* libblas.so.3\n fi)\ndone\n’ is not of type ‘object’, ‘null’

Checked that I indented it two spaces, dont quite understand that error about schema

Oh you need to indent the override-build itself to be under the ros-demos part. Put it at the same level as stage-packages (of course you’ll need to indent the snapcraftctl build bits even more).

It compiled but when launching the app, same exact error…

apps:
box-bot-ros2-sim:
command: opt/ros/foxy/bin/ros2 launch box_bot_gazebo box_bot_launch.py
environment:
LD_LIBRARY_PATH: “$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/blas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/atlas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack”
extensions: [ros2-foxy]

Same error:

ImportError: /snap/box-bot-ros2/x1/usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3: undefined symbol: ATL_dgeset

If anyone want to have a try at the repo, you are more than welcomed: GIT

@Duckfrost @kyrofa

libatlas ships a competing version of libblas and LD_LIBRARY_PATH is choosing the wrong one. Change to:
LD_LIBRARY_PATH: "$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/atlas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack"

This also removes the $LD_LIBRARY_PATH which is undesirable.

With this, I get:
[spawn_box_bot.py-3] [INFO] [1613744496.674511769] [minimal_client]: service not available, waiting again…

on loop

[gzclient -2] gzclient: error while loading shared libraries: libpulsecommon-13.99.so: cannot open shared object file: No such file or directory [gzserver-1] gzserver: error while loading shared libraries: libpulsecommon-13.99.so: cannot open shared object file: No such file or directory [ERROR] [gzclient -2]: process has died [pid 22492, exit code 127, cmd 'gzclient ']. [ERROR] [gzserver-1]: process has died [pid 22490, exit code 127, cmd 'gzserver /snap/box-bot-ros2/x1/share/box_bot_gazebo/worlds/box_bot_empty.world -s libgazebo_ros_init.so -s libgazebo_ros_factory.so ']. [spawn_box_bot.py-3] [INFO] [1613752552.641937586] [minimal_client]: service not available, waiting again…

That is the error, it doesnt find now the library: libpulsecommon-13.99.so

I just replaced as you indicated:

LD_LIBRARY_PATH: “$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/atlas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack”

Any ideas ? @cjp256 did you have this issue?

Hrm, can you try adding the path for pulseaudio libs as well?

LD_LIBRARY_PATH: "$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/atlas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"

Yeah,

Now I’m getting also this waiting issue… It seems :slight_smile:

[gzserver-1] libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri) [gzserver-1] libGL error: failed to load driver: iris [gzserver-1] libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri) [gzserver-1] libGL error: failed to load driver: iris [gzserver-1] libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri) [gzserver-1] libGL error: failed to load driver: swrast [gzserver-1] X Error: GLXBadContext [gzserver-1] Request Major code 152 (GLX) [gzserver-1] Request Minor code 6 () [gzserver-1] Error Serial #41 [gzserver-1] Current Serial #40

There is some issue when launching the gazebo GUI and that seems to crash stuff. Outside the sncraft works… Do snaps need access somehow the Xs ?

Can you try your snap with confinement: devmode?

Its already in that mode defined in the snapcraft.yaml I’m affraid