[cmake-developers] issues with parallel building on OpenBSD

Brad King brad.king at kitware.com
Wed Dec 12 09:03:18 EST 2012


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.

-Brad



More information about the cmake-developers mailing list