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

Revision history [back]

click to hide/show revision 1
initial version

It's very likely this is caused by C++ template instantiation.

rclcpp is template heavy, and the type support code is as well.

By default, Colcon will ask CMake to use all CPU cores available for a build. On embedded systems, especially without any swap, this will typically lead to memory becoming the bottleneck (ie: there is not enough memory to let the compiler 'comfortably' use all the cores).

You have various ways to reduce parallelism (and thereby most likely also work around the limited available memory) with Colcon. See #q368249 and #q304300 for previous discussions.

Adding some swap also typically helps, but you may not have that possibility.

Edit:

What I've already tried

Building with

$ MAKEFLAGS="-j1 -l1"
$ colcon build --executor sequential

apologies, as I only now noticed you'd already configured Colcon to reduce/disable build parallelism.

I'm a bit uncertain whether MAKEFLAGS="-j1 -l1" on its own line like that would work though. I would at least expect you to have to run export MAKEFLAGS="-j1 -l1", or otherwise MAKEFLAGS="-j1 -l1" colcon build --executor sequential.

If you're still running into this problem, it's likely there isn't anything at the Colcon/CMake level you can do about this.

Note that an A53 has about 1/100th of the performance of a typical desktop processor. So things taking a little longer would not be unexpected I believe.


Original answer:

It's very likely this is caused by C++ template instantiation.

rclcpp is template heavy, and the type support code is as well.

By default, Colcon will ask CMake to use all CPU cores available for a build. On embedded systems, especially without any swap, this will typically lead to memory becoming the bottleneck (ie: there is not enough memory to let the compiler 'comfortably' use all the cores).

You have various ways to reduce parallelism (and thereby most likely also work around the limited available memory) with Colcon. See #q368249 and #q304300 for previous discussions.

Adding some swap also typically helps, but you may not have that possibility.