Ask Your Question
1

Minimizing compiler memory, pcl_ros

asked Feb 24 '11

tom gravatar image tom flag of Poland
849 5 27 51

Hi,

does anybody know, how to minimize the memory needed for gcc/g++ to compile a particular package? I'm trying to compile the pcl_ros package on a BeagleBoard-xM, but the compiler crashes each time because the cc1plus process is being killed due to low memory (BB-xM has 500MB of RAM). I've read a lot about this already, but found no solution. I've already been able to compile openni and flann (which also caused errors).

The only thing I'd like to try out and wasn't still able to is adding a "-finline-limit 600" (the number here may differ) compiler flag, as I don't know how to use the rosbuild_add_compile_flags(target flag) macro in case of flags with values.

Any help would be appreciated. I think being able to use Kinect on an ARM based board would be great and the effort is well worth it. Among small single board computers, ARM based boards cost 10 times less than, for instance, the AscTec Atom with similar capabilities.

Also, if anyone out there has got a PandaBoard and would like to check whether what I've found out so far works with it, please let know.

Cheers, Tom

delete close flag offensive retag edit

Comments

Tom, I've got an IGEPv2 board and would be interested in trying out your patches that got OpenNI to compile. Eric Perko (Feb 24 '11)edit
@Eric: I wrote a simple HowTo here: http://answers.ros.org/question/130/openni-compilation-error-diamondback-version?answer=296#296 . It's still dirty, but worked all right. tom (Feb 25 '11)edit

6 Answers

Sort by ยป oldest newest most voted
2

answered Feb 24 '11

JeffRousseau gravatar image JeffRousseau
1141 15 21 34
http://jeffrousseau.info/

Coming from an embedded systems background, when working with resource-limited embedded systems the usual solution is to cross-compile. You'd gain compilation speed (assuming your desktop has better specs than a 500MB-RAM Cortex ARM) as well as bypass memory problems like the one you're having.

The eros stack was started a while back to help get ROS onto more embedded systems. I'm not sure how far along it is, but there seems to be some helpful tutorials:

http://www.ros.org/wiki/eros/CrossCompileBuildEnvironment

link delete flag offensive edit
1

answered Feb 24 '11

Jochen Sprickerhof gravatar image Jochen Sprickerhof
11 1

use a cross compiler on your workstation

link delete flag offensive edit

Comments

That's one of the possibilities I've forgotten to list above, thanks :). The point is, I don't know how to do it (yet), so maybe there is a simpler way via reducing the memory needed by the compiler. tom (Feb 24 '11)edit
1

answered Feb 24 '11

snorri gravatar image snorri
1136 7 21 27

Jeff's right, if you're investing a serious amount of work in small cpu's (year long project or more), you'll drink far too much coffee waiting for your compiling to complete. Growing a beard and cross compiling can save you a tremendous amount of time.

If you've a toolchain, then eros has cross-compiling tools and support for at least the core ros packages. Getting everything to work all the way out to pcl-land on ros may require some extra work (thats where you can do your bit for eros - patches and information are welcome!). It's definitely a nice target though, specially with the near future looking at running gpu'd pcl on arm+nvidia combination boards.

One area where eros is lacking at the moment is in information on how to roll your own filesystems/toolchains and we'll start looking at remedying that in the near future.

link delete flag offensive edit

Comments

Up until now compiling ROS on the BB directly wasn't too annoying, took not more than 3 hours to build a mobile variant with most of the openNI and its dependencies. But PCL_ROS really causes frustration :(, hope I'll manage to build that after all. I'll read about cross-compilation... tom (Feb 24 '11)edit
How important is the beard? Aside: I don't know of any upcoming boards from nvidia that combine ARM and a gpu that can run CUDA code (which gpu'd pcl will require). e.g. the tegras don't run CUDA code. Straszheim (Feb 24 '11)edit
0

answered Feb 26 '11

enddl22 gravatar image enddl22
97 1 4 8

I think using swap partition gonna be solution for your problem. I'm also trying to run openni on the Gumstix (the same core as BB as far as I know) but haven't compiled PCL yet. How could you get dependent libraries which doesn't exist for ARM core like hull hd5(I can't remember correct lib name). Cheers.

link delete flag offensive edit
0

answered May 19 '11

lexsyn gravatar image lexsyn
46 1 6

I've dealt with a similar issue through using swap partition. For the instructions to configure swap space on Ubuntu click the following link: http://manpages.ubuntu.com/manpages/maverick/en/man8/dphys-swapfile.8.html

Swap space on angstrom: http://www.sakoman.com/GNOME/how-to-enable-linux-swapping.html

link delete flag offensive edit
-1

answered Feb 24 '11

tom gravatar image tom flag of Poland
849 5 27 51

updated Feb 24 '11

Thanks all,

for the time being, I can confirm that it's possible to use Kinect with ROS on a BeagleBoard-xM. As I'm not experienced in the embedded world, I took the easiest way for me and used Nizar's advice to change set (ROS_BUILD_TYPE RelWithDebInfo) to set (ROS_BUILD_TYPE Release) in the CMakefile. It took 3 hours to build this directly on the BB and I also had to turn swap on (which is not healthy for a flash memory), but it worked. I've been able to use dynamic_reconfigure over WiFi and changed to QQVGA@30Hz and then to subscribe to /camera/depth/points2 locally (rostopic hz showed 4,5Hz).

I still wasn't able to use rviz nor even subscribe to a topic on my PC over a WiFi, but this must be an issue with my USB-dongle's drivers.

Do you have any hints on how I can minimize processor's load even more? Basically I'd like my BeagleBoard to work as a Kinect WiFi interface for now. I guess it's possible to switch do UDP, would it be wise in my case?

Naturally I'll work on cross-compiling as soon as I get this one last issue rolling.

Any suggestions welcome, Tom.

link delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: Feb 24 '11

Seen: 271 times

Last updated: May 19 '11