Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: korDen on October 22, 2008, 01:25:35 pm

Title: Compile multiple files at a time in parallel
Post by: korDen on October 22, 2008, 01:25:35 pm
Does C::B support running multiple compilation processes in parallel, similar to Gentoo MAKEOPTS flag? With my current settings, C::B compiles on file at a time and this is suboptimal nowadays. Compiling multiple files in parallel would decrease compilation time up to 2 times for dual core and up to 4 time for quad core processors. I think it is a nice feature to have. Thank you
Title: Re: Compile multiple files at a time in parallel
Post by: MortenMacFly on October 22, 2008, 02:47:11 pm
Does C::B support running multiple compilation processes in parallel,
Yes: Settings -> Compiler and Debugger -> [select your compiler] -> Tab "Other settings" -> Choose "number of processes..."

The question is whether the compiler framework supports it. I once tried with VC6 and it produced very strange errors utiul I realised it was a problem with the multiple processes.
Title: Re: Compile multiple files at a time in parallel
Post by: thomas on October 22, 2008, 02:59:16 pm
I use MinGW/gcc with 5 compile processes on a quadcore, which works just fine and is the sweet spot for my system. This leaves about 10-12% of idle CPU time, because writing out object files starts making the build process I/O bound.

What does not work, funnily, is compiling makefiles with -j 5, although make has been supporting this for much, much longer and should be much, much more mature than Code::Blocks. However, make regularly messes up with several processes, whenever it has to prepare a file that's used later.
Title: Re: Compile multiple files at a time in parallel
Post by: MortenMacFly on October 22, 2008, 03:04:29 pm
I use MinGW/gcc with 5 compile processes on a quadcore
Braggart! :lol:
...you know how to make other devs jealous, right?! :cry:
Title: Re: Compile multiple files at a time in parallel
Post by: thomas on October 23, 2008, 05:40:57 pm
How jealous will Yiannis be if I tell him my TV runs on Linux...
Title: Re: Compile multiple files at a time in parallel
Post by: mandrav on October 23, 2008, 10:51:18 pm
How jealous will Yiannis be if I tell him my TV runs on Linux...

:lol: