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

"c++: internal compiler error: Killed" while building Universal Robots ROS Driver

asked 2020-04-01 09:43:33 -0500

Vuro H gravatar image

updated 2020-04-01 11:40:56 -0500

gvdhoorn gravatar image

I am attempting to build the Universal Robots ROS Driver on ROS Melodic Ubutnu 18.04, but when I try to build the workspace with catkin_make I get the error below. What can I do to solve this? Thank you

[ 77%] Building CXX object fmauch_universal_robot/ur_kinematics/CMakeFiles/ur10_moveit_plugin.dir/src/ur_moveit_plugin.cpp.o
In file included from /home/<user>/catkin_ws/src/fmauch_universal_robot/ur_kinematics/src/ur_moveit_plugin.cpp:75:0:
/opt/ros/melodic/include/class_loader/class_loader.h:36:2: warning: #warning Including header <class_loader/class_loader.h> is deprecated, include <class_loader/class_loader.hpp> instead. [-Wcpp]
 #warning Including header <class_loader/class_loader.h> is deprecated, \
  ^~~~~~~
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.

See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
fmauch_universal_robot/ur_kinematics/CMakeFiles/ur10_moveit_plugin.dir/build.make:62: recipe for target 
'fmauch_universal_robot/ur_kinematics/CMakeFiles/ur10_moveit_plugin.dir/src/ur_moveit_plugin.cpp.o' failed
make[2]: *** 
[fmauch_universal_robot/ur_kinematics/CMakeFiles/ur10_moveit_plugin.dir/src/ur_moveit_plugin.cpp.o] Error 4
CMakeFiles/Makefile2:4448: recipe for target 
'fmauch_universal_robot/ur_kinematics/CMakeFiles/ur10_moveit_plugin.dir/all' failed
make[1]: *** [fmauch_universal_robot/ur_kinematics/CMakeFiles/ur10_moveit_plugin.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j1 -l1" failed
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2020-04-01 11:40:32 -0500

gvdhoorn gravatar image

updated 2020-04-01 11:41:47 -0500

Are you building this in a VM? Because this error message:

c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.

is typically printed when the compiler runs out of memory while trying to compile the code.

On VMs, this is rather common. Other platforms this happens often on are Raspberry PIs and similar SBCs (as they typically don't have swap and limited amounts of RAM).

It's likely this is not a problem with the code.

edit flag offensive delete link more

Comments

Thanks a lot for your help. You were right, it was an issue with memory. Increasing the memory of my VM meant that I could build this workspace without a problem. Thank you again

Vuro H gravatar image Vuro H  ( 2020-04-19 15:58:01 -0500 )edit

Please note that running ur_robot_driver in a VM is not recommended, due to the way a VM interferes with the determinism required for the driver to work correctly.

It's likely you will run into performance issues with the driver.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-19 16:00:10 -0500 )edit

Ok, thank you, that's very good to know. What would be the best way to run it?

Vuro H gravatar image Vuro H  ( 2020-04-19 16:03:16 -0500 )edit
1

answered 2021-03-05 14:31:18 -0500

This is a classic gcc error, it happens when the system runs out of memory.

The most conservative way I found to make it work (almost always) in those situations is decreasing the number of threads of the compiler and also configuring the parameter "ggc-min-expand" to some convenient value.

Specifically this would translate to colcon as the following example command line:

colcon build --parallel-workers 1 --cmake-args -DCMAKE_CXX_FLAGS="--param ggc-min-expand=20"

This will make the compilation slower but it maximum memory it takes will be lower.

Generalizing the answer to ROS1 the example would be:

 catkin_make -j 1 -DCMAKE_CXX_FLAGS="--param ggc-min-expand=20"
edit flag offensive delete link more

Comments

Hello! A similar error happened to me. Is the command you've given universal for any application? If not could you tell me where can I find out more about this matter. Thank you

Marco Luís gravatar image Marco Luís  ( 2021-11-17 04:43:36 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-04-01 09:43:33 -0500

Seen: 2,092 times

Last updated: Mar 05 '21