ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Building ros1_bridge fails in Docker container (Noetic & Foxy) [closed]

asked 2020-10-13 11:10:22 -0500

tgaspar gravatar image

I am trying to build ros1_bridge under Docker with Noetic as the ROS1 distro and Foxy as the ROS2 distro. I have tried many different approaches but none seemed to work, or better, they all ended with the same error (described bellow).

For this post I tried to take similar steps as in here. I am trying to build a Docker image using the following Dockerfile:

FROM ros:foxy-ros1-bridge

RUN apt-get update \
  && apt-get install -y ssh \
    build-essential \
    gcc \
    g++ \
    gdb \
    clang \
    cmake \
    rsync \
    nano \
    tar \
    python3 \
    ros-foxy-launch* \
  && apt-get clean

ENTRYPOINT ["/ros_entrypoint.sh"]

WORKDIR "/home/workspace"

CMD /bin/bash

Once the image is build I run the following commands (inside the container):

Clone the repo at the appropriate brench

git clone --single-branch --branch foxy https://github.com/ros2/ros1_bridge src/ros1_bridge

Build everything but the ros1_bridge

colcon build --symlink-install --packages-skip ros1_bridge

Source both environments

source /opt/ros/noetic/setup.bash
source /opt/ros/foxy/setup.bash

and finally

colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure --event-handlers console_direct+

After a bit (almost 20 minutes) the compilation stops with the following error:

[ 98%] Linking CXX shared library libros1_bridge.so
[Processing: ros1_bridge]
[Processing: ros1_bridge]
[Processing: ros1_bridge]
[Processing: ros1_bridge]
[Processing: ros1_bridge]
[Processing: ros1_bridge]
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
make[2]: *** [CMakeFiles/ros1_bridge.dir/build.make:5157: libros1_bridge.so] Error 1
make[2]: *** Deleting file 'libros1_bridge.so'
make[1]: *** [CMakeFiles/Makefile2:260: CMakeFiles/ros1_bridge.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
--- stderr: ros1_bridge
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
make[2]: *** [CMakeFiles/ros1_bridge.dir/build.make:5157: libros1_bridge.so] Error 1
make[2]: *** Deleting file 'libros1_bridge.so'
make[1]: *** [CMakeFiles/Makefile2:260: CMakeFiles/ros1_bridge.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< ros1_bridge [19min 22s, exited with code 2]

Summary: 0 packages finished [19min 22s]
  1 package failed: ros1_bridge
  1 package had stderr output: ros1_bridge

Since the error is not really descriptive, I don't know how to proceed from here and I need some help. Are there any other flags besides --event-handlers console_direct+ that I can add to colcon for an even more verbose output?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by tgaspar
close date 2020-11-04 02:48:03.797769

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-11-02 10:38:52 -0500

Victor Lopez gravatar image

updated 2020-11-02 10:39:05 -0500

I ran the same steps and could finish compilation successfully.

Is it possible you are running out of memory? The linking phase of this pkg seems to be quite heavy on the memory.

edit flag offensive delete link more

Comments

That was it, thank you! I ran the whole thing again on a different machine and same as you had no issues with building. The fact that memory was an issue never crossed my mind also because there were no hints from colcon regarding this.

tgaspar gravatar image tgaspar  ( 2020-11-04 02:47:12 -0500 )edit

It's just that the linker dies. Glad I could help.

Victor Lopez gravatar image Victor Lopez  ( 2020-11-04 02:48:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-10-13 11:10:22 -0500

Seen: 1,003 times

Last updated: Nov 02 '20