MantisBT - CMake
View Issue Details
0012882CMakeCMakepublic2012-01-18 09:482012-07-09 06:52
Galeazzi 
Brad King 
normalminoralways
closedno change required 
WindowsXP
CMake-2-8 
 
0012882: MinGW makefile project cannot be build in parallel mode
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.
On the other hand if I manually launch
make -j 2 -f CMakeFiles\Makefile2 all, the project will be built in parallel mode reducing the needed time from 25 min to 14 min.
1 - Generate a MinGW Makefile on a Windows machine
2 - Build the project launching make -j 2 all
No tags attached.
Issue History
2012-01-18 09:48GaleazziNew Issue
2012-01-18 09:58Brad KingNote Added: 0028353
2012-01-18 10:55Bill HoffmanNote Added: 0028354
2012-01-19 12:33Bill HoffmanNote Added: 0028364
2012-01-20 02:50GaleazziNote Added: 0028369
2012-01-20 08:25Brad KingNote Added: 0028373
2012-01-20 08:25Brad KingStatusnew => resolved
2012-01-20 08:25Brad KingResolutionopen => no change required
2012-01-20 08:25Brad KingAssigned To => Brad King
2012-07-09 06:52David ColeNote Added: 0029957
2012-07-09 06:52David ColeStatusresolved => closed

Notes
(0028353)
Brad King   
2012-01-18 09:58   
GNU make is supposed to pass top-level flags down in the environment (IIRC, it is a variable called "MAKEFLAGS"). At least at one time the MinGW make did not know how to share parallel jobs with child make processes. I do not know if this is still true.

If you have MSYS installed I think the "MSYS Makefiles" generator works in parallel.
(0028354)
Bill Hoffman   
2012-01-18 10:55   
This is a limitation of gmake on windows. See this thread:

http://lists.gnu.org/archive/html/make-w32/2011-07/msg00002.html [^]

The jobserver which handles parallel make for recursive calls to make is just not implemented. The person on the list did an implementation, and I think you can get his patch and build it yourself. However, there are some licenses issues that are being worked out so that it can be part of gmake upstream.
(0028364)
Bill Hoffman   
2012-01-19 12:33   
Looks like this is now in CVS gmake:
http://lists.gnu.org/archive/html/make-w32/2012-01/msg00012.html [^]
I am guessing this has not yet made it into mingw yet, and you would have to build from source.
(0028369)
Galeazzi   
2012-01-20 02:50   
I applied the patch discussed here: http://lists.gnu.org/archive/html/make-w32/2011-07/msg00002.html [^] and it worked fine. As far as I'm concerned this bug can be closed.
(0028373)
Brad King   
2012-01-20 08:25   
Fantastic, thanks for reporting back!
(0029957)
David Cole   
2012-07-09 06:52   
Closing resolved issues that have not been updated in more than 4 months.