Author Topic: Compile multiple files at a time in parallel  (Read 6561 times)

Offline korDen

  • Single posting newcomer
  • *
  • Posts: 3
Compile multiple files at a time in parallel
« 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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Compile multiple files at a time in parallel
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Compile multiple files at a time in parallel
« Reply #2 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Compile multiple files at a time in parallel
« Reply #3 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:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Compile multiple files at a time in parallel
« Reply #4 on: October 23, 2008, 05:40:57 pm »
How jealous will Yiannis be if I tell him my TV runs on Linux...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compile multiple files at a time in parallel
« Reply #5 on: October 23, 2008, 10:51:18 pm »
How jealous will Yiannis be if I tell him my TV runs on Linux...

:lol:
Be patient!
This bug will be fixed soon...