[CMake] parallel make -j N

Andrea Galeazzi galeazzi at korg.it
Tue Jan 17 04:32:02 EST 2012


Yes but I'm using MinGW make (on Windows machine), the interpreter is

GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

When I launched the make project I also checked the child process 
creation, the parent process is:
c.\...\cs-make.exe -j 2 all
but the child process is:
c:/.../cs-make -f CMakeFiles\Makefile2 all

Than, after a clean, I manually launched:
c:\..\cs-make.exe -j 2 -f CMakeFiles\Makefile2 all
In this way I reduced the build time from 25 min to 14 min.
Could MinGW-make have a different behavior from gmake?

-Andrea

Il 16/01/2012 18.37, Bill Hoffman ha scritto:
> On 1/16/2012 12:10 PM, Andrea Galeazzi wrote:
>> I generated a MakeFile Project (MinGW) and I'd like to speed up the
>> build process using -j N option. So I launched:
>> "make -j 2 all".
>> Unfortunately I noticed that the Makefile, generated by CMake self,
>> contains this row: $(MAKE) -f CMakeFiles\Makefile2 all , so Makefile2
>> won't be executed in parallel mode.
>> How can I pass this option to all build steps?
>> -- 
>>
> gmake will do the right thing.  when you run a toplevel make with -j2 
> it will set an env var that is passed down to the $(MAKE) and it 
> should work.  I use it all the time.
>
> -Bill
>
> -- 
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



More information about the CMake mailing list