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 6 months ago

matteogrechi commented 6 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 3 months 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 2 months ago

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

christophebedard commented 2 months ago

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