[CMake] How would I use parallel make on ExternalProjects?
Bill Hoffman
bill.hoffman at kitware.com
Thu Oct 7 12:29:11 EDT 2010
On 10/7/2010 12:13 PM, kent williams wrote:
> On Thu, Oct 7, 2010 at 11:05 AM, Bill Hoffman<bill.hoffman at kitware.com> wrote:
>>
>> What you want is for make to treat the external projects just like any other
>> library or executable in a build.
>>
>> so, if you run this at the top of the build:
>>
>> make -j4
>>
>> It should run at most 4 concurrent things at once for the whole thing. By
>> using $(MAKE) in the makefiles make will do that.
>>
>
> There is one problem with that, which is what I'm trying to address:
> load balancing. If your project builds ITK, VTK, and sundry other
> prerequisite libraries, it will spawn 4 sequential builds. In
> practice this means everything except ITK (which we build with
> wrapping on) finishes, and then ITK chugs along doing its sequential
> build.
>
> If I do what I'm talking about, I'd sequentially conduct parallel
> builds of ITK VTK etc. In which case the big hairy libraries, like
> ITK with wrapping, get built in parallel.
>
>
ITK will not do a sequential build. The -j N gets passed down to all
the sub projects as well. It will run N build rules at the same time
from VTK, ITK and everything else. Just like it was all one big
project...
-Bill
More information about the CMake
mailing list