Steve
Steve

Reputation: 551

Is there a way to speed up C++ compilation times in Solaris Sun Studio 12?

Since I am compiling my C++ code on a very server box (32 or 64 cores in total), is there a way of tweaking compiler options to speed up the compilation times? E.g. to tell compiler to compile independent .cpp files using multiple threads.

Upvotes: 4

Views: 1032

Answers (4)

Asgeir S. Nilsen
Asgeir S. Nilsen

Reputation: 1137

Sun's C++ compiler also has an -xjobs option that makes the compiler fork multiple threads internally. For this to be efficient you would probably have to pass all .cc files to a single invocation of CC.

Upvotes: 0

alanc
alanc

Reputation: 4180

Sun Studio includes parallel build support in the included dmake version of make. See the dmake manual for details.

Upvotes: 4

Michael Dorgan
Michael Dorgan

Reputation: 12515

Use something like Boost JAM which does this sort of multithreading for you - and from my experience much more efficiently than multi-threaded make.

Upvotes: 3

Josh Kelley
Josh Kelley

Reputation: 58392

This depends on what toolchain you're using.

If you're using GNU Make, then add -j 32 to your make invocation to tell Make to start 32 jobs (for example) in parallel. Just make sure that you're not exhausting RAM and thrashing your swap file as a result.

Upvotes: 4

Related Questions