please verify: parallel builds are working now

Brad King brad.king at kitware.com
Wed Mar 29 17:49:50 CEST 2006


Thiago Macieira wrote:
> Alexander Neundorf wrote:
> 
>>I just successfully compiled kdelibs/ from trunk with "make -j4" on my
>>single processor machine.
>>Could you please verify that it also works for your setups ?
>>If there are problems, let me know.
> 
> I tried a make -j25 on the compile farm here at Trolltech and suddenly 
> realised my machine was grinding to a halt. It appears that cmake 
> runs "/usr/bin/gcc" no matter which gcc is found first in PATH.
> 
> How can I tell cmake to generate Makefiles that run "gcc" and 
> not "/usr/bin/gcc"? I don't want to erase the whole cache every time I 
> want to switch compilers.

When a build tree is first created by CMake it becomes locked to the 
compiler specified the first time.  If the compiler is not specified 
with a full path then the PATH is searched to find it, and then that 
full path is used.  It is not safe to build some of a tree with one 
compiler and then the rest with another in C++ anyway.  Even if the 
compilers share an ABI the try-compile results may be different.

If you want to switch compilers just create another build tree.  I 
frequently use a layout like this:

Foo           # Source tree
Foo-gcc-3.3   # Build tree with GCC 3.3
Foo-gcc-4.0   # Build tree with GCC 4.0
Foo-icc-8.1   # Build tree with Intel C++ 8.1

-Brad


More information about the Kde-buildsystem mailing list