On Wed, Dec 12, 2012 at 9:48 AM, Kent R. Spillner <kspill...@acm.org> wrote: > Hey, dude- > > On Dec 12, 2012, at 9:30, Marc Espie <es...@nerim.net> wrote: > >> Anyways, there are TWO distinct points: >> - problems with make -j. >> - cmake not writing correct makefiles for parallel building without gmake. > > > The second one is the problem here. CMake doesn't do anything special for > parallel builds, it just leans on gmake's environment variable fu for > parallel job control. > > >> (besides that, it might be a good idea to have a generator >> that caters a bit more to our make, specifically, include subfile is now >> part of posix. > > > I think that's the right way to fix this problem. > > Best, > Kent >
here is the mail from Brad King On 12/12/2012 08:41 AM, Amit Kulkarni wrote: > On OpenBSD, we want to build cmake and some critical cmake based ports > in parallel using our dpb (distributed ports builder). We pass j=N in > a MAKE_JOBS environment variable when building cmake and cmake based > ports using our Makefile hierarchy. It seems that when we use gmake, > cmake builds in parallel, i.e with -j option. Plain bsd make fails > here... > > http://www.mail-archive.com/ports@openbsd.org/msg44397.html > > Our porters want to track down this issue and have it built in > parallel, so is the environment variable to pass j=N flag called > MAKEFLAGS? A pointer would be appreciated before digging into the > source. CMake does not require GNU make on any platform. The Makefile we generate will work with any make tool, even for parallel builds. For projects other than CMake itself, CMake simply generates the build files. Then it is up to you to run "make -j $N" if you want to build the result in parallel. For CMake itself there is the "bootstrap" script (and a "configure" alias for it). This script's only job is to build a minimal part of CMake with just enough to run on CMake itself to generate build files like any other CMake-based project. After bootstrap is done it is still up to you to run "make -j $N" to build CMake in parallel. What remains is to get the bootstrap build to work in parallel too. That is what the "--parallel" option to the bootstrap script requests. That script tries to detect whether the make tool supports parallel builds. Only if that detection fails would the script choose not to pass "-j $N" to make.