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

Building mavros fail

asked 2015-10-26 09:48:51 -0600

pcler gravatar image

updated 2015-10-26 10:43:46 -0600

gvdhoorn gravatar image

Hi, all

I am having trouble with catkin_make mavros package error recently. It kept failing and saying:

c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[3]: *** [mavros/mavros/CMakeFiles/mavros.dir/src/lib/uas_stringify.cpp.o] Error 4
make[3]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[3]: *** [mavros/mavros/CMakeFiles/mavros.dir/src/lib/uas_data.cpp.o] Error 4
make[2]: *** [mavros/mavros/CMakeFiles/mavros.dir/all] Error 2
make[1]: *** [mavros/mavros/CMakeFiles/mavros.dir/rule] Error 2
make: *** [mavros] Error 2
Invoking "make mavros -j4 -l4" failed

I am using an armv7l embed platform.

The mavros package is clone from https://github.com/mavlink/mavros , master branch.

Using ROS Indigo and Ubuntu 14.04

I would be really grateful if somebody can do any help. Thank you so much!

edit retag flag offensive close merge delete

Comments

"Internal compiler error" suggests a bug in your compiler.

joq gravatar image joq  ( 2015-10-26 10:32:46 -0600 )edit

Thank you so much! It does be the problem of memory limited! This error came out on different object file, so at first I was not sure whether it was the problem of compiler.

pcler gravatar image pcler  ( 2015-10-27 02:21:49 -0600 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2015-10-26 10:44:32 -0600

gvdhoorn gravatar image

.. or a compiler running out of memory. @pcler: are you running this on an embedded platform with (very) limited RAM? If so, that could be the issue.

edit flag offensive delete link more

Comments

That was my first thought, but wouldn't the compiler print a better message in that situation?

joq gravatar image joq  ( 2015-10-26 11:10:14 -0600 )edit
1
gvdhoorn gravatar image gvdhoorn  ( 2015-10-26 11:32:42 -0600 )edit

I have seen the same when running out of memory. First make sure you're not compiling with multiple threads. And if that doesn't work you should add swap space. The easiest is to put it on an USB thumb driver temporarily.

tfoote gravatar image tfoote  ( 2015-10-27 01:12:58 -0600 )edit

Thank you so much! After I add 2G more swap then this error disappeared. The platform already owns 2G memory. I think the linking job of the package is really heavy

pcler gravatar image pcler  ( 2015-10-27 02:25:43 -0600 )edit
0

answered 2021-03-05 14:32:32 -0600

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 convinient 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

Question Tools

1 follower

Stats

Asked: 2015-10-26 09:48:51 -0600

Seen: 1,146 times

Last updated: Mar 05 '21