Ask Your Question

Raspberry Pi2 roscpp failed during Indigo installation

asked 2015-10-21 04:21:35 -0600

amof gravatar image

updated 2015-10-21 07:24:22 -0600

Hello everybody,

I cannot install ROS Indigo on the Raspberry Pi 2 model B with Raspbian Jessie(no problem with Wheezy). At each time, it fails when it compiles roscpp with the command :

sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo

I followed the official instructions that are here.

I even tried to compile myself libconsole-bridge-dev and liblz4-dev.

I cannot join the .txt because i'm a new user. So, here is the error :

Have you any idea or solution?

Thanks !


There is also a strange thing that happen : the raspberry pi 2 gets his ram AND swap satured ! And once the Raspberry completely crashed. Before it prints the error, the raspberry is lagging so even if you have another ssh terminal opened, you can't do anything in it. Even the refresh of top doesn't work !

Here is the error :

[ 36%] Building CXX object CMakeFiles/roscpp.dir/src/libros/single_subscriber_publisher.cpp.o
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.9/README.Bugs> for instructions.
CMakeFiles/roscpp.dir/build.make:146: recipe for target 'CMakeFiles/roscpp.dir/src/libros/publisher_link.cpp.o'     failed
make[2]: *** [CMakeFiles/roscpp.dir/src/libros/publisher_link.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:308: recipe for target 'CMakeFiles/roscpp.dir/all' failed
make[1]: *** [CMakeFiles/roscpp.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'roscpp':
Command '['/opt/ros/indigo/', 'make', '-j4', '-l4']' returned non-zero exit status 2

Reproduce this error by running:
==> cd /home/pi/ros_catkin_ws/build_isolated/roscpp && /opt/ros/indigo/ make -j4 -l4

Command failed, exiting.
edit retag flag offensive close merge delete


Please run catkin_make -j1 and copy & paste the error text (and some surrounding lines) into your question. Linking to dropbox is not very nice, as that will make this question (and any possible answers) worthless if / when you delete that file. Use the edit button/link to update your question.

gvdhoorn gravatar imagegvdhoorn ( 2015-10-21 05:27:02 -0600 )edit

Please reformat your copy/paste using the Preformatted text button on the toolbar. It's the one with 101010 on it. That would make this much more readable. Be sure to re-copy/paste the error, as the quotes you used now have changed the lines (inserted formatting characters).

gvdhoorn gravatar imagegvdhoorn ( 2015-10-21 06:41:48 -0600 )edit

Looks like it's asking you to report a GCC bug! Never seen this one. That's very interesting... I bet you can get them to fix it quickly, or at least tell you what happened.

allenh1 gravatar imageallenh1 ( 2015-10-21 07:03:11 -0600 )edit

@gvdhoorn : Done ! Thanks for the advices. @allenh1 : Must I report the GCC bug ??!

amof gravatar imageamof ( 2015-10-21 07:11:07 -0600 )edit

It's possible it's your swap space. I've has problems like this on my Pi's (Although not the early on in the build). Make sure you have about 1Gb of swap avaliable and it active


MarkyMark2012 gravatar imageMarkyMark2012 ( 2015-10-21 08:14:20 -0600 )edit

I just tested it. I put 1Go of swap and it worked ... Strange because the Rpi 2 has 1gb of ram ! It took apparently 1500 mb of ram-swap to compile roscpp ... What can necessite all that memory ?

amof gravatar imageamof ( 2015-10-21 11:00:46 -0600 )edit

To be honest I have no idea. Have put that as the answer though :)

MarkyMark2012 gravatar imageMarkyMark2012 ( 2015-10-21 11:20:36 -0600 )edit

It could be interesting to investigate on it !

amof gravatar imageamof ( 2015-10-21 11:40:45 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2015-10-21 11:20:37 -0600

MarkyMark2012 gravatar image

It's possible it's your swap space. I've has problems like this on my Pi's (Although not the early on in the build). Make sure you have about 1Gb of swap avaliable and it active


edit flag offensive delete link more


Two days going mad until find this answer!! Thanks a lot!

Hobbert Evergreen gravatar imageHobbert Evergreen ( 2017-01-09 20:46:25 -0600 )edit

answered 2016-03-10 12:24:24 -0600

ahendrix gravatar image

If you are willing to install Ubuntu 14.04 on your Raspberry Pi 2, you can install ROS binaries by following: . (this skips the entire compilation process).

Note that this only works on the Pi 2, because it has a more recent processor and supports Ubuntu. This won't work on the original Pi.

edit flag offensive delete link more

answered 2016-03-10 04:06:06 -0600

nishthapa gravatar image

Try increasing your swap space to 1 GB by editing the the dphys-swapfile file in etc/dphys-swapfile and setting CONF_SWAPSIZE=1024. Compiling roscpp can demand large amounts of memory. I faced this problem once but doing so solved it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2015-10-21 04:21:35 -0600

Seen: 3,169 times

Last updated: Mar 10 '16