colcon / colcon-parallel-executor

Extension for colcon to process packages in parallel
http://colcon.readthedocs.io
Apache License 2.0
2 stars 4 forks source link

--parallel-workers not working as expected #36

Open matteogrechi opened 4 months ago

matteogrechi commented 4 months ago

When running colcon build --parallel-workers 1 on cpp code the number of compiler threads is not 1. To have the "expected" behaviour I should run instead

export MAKEFLAGS=-j1
colcon build --parallel-workers 1

Is this behaviour intended? Is it possible to cite this fact directly in the colcon documentation?

Thank you very much!

christophebedard commented 1 month ago

As far as I know, that is the expected behaviour with colcon. --parallel-workers controls the number of "jobs" (i.e., packages in this case) being built in parallel, but then each package itself may or may not be built in parallel using multiple threads. That part depends on the underlying built system, e.g., CMake. As you've found, using the MAKEFLAGS environment variable is the proper way to control this for CMake packages.

xiaoxiaozengzen commented 1 week ago

I tried using --executor sequential , and the result was the same as above

christophebedard commented 4 days ago

--executor sequential only means that colcon will process (e.g., build or test) 1 package at a time.