Sign in to follow this  
beebs1

Multithreaded Compilation / MSVS

Recommended Posts

Hiya, I remember a while back Microsoft introduced a 'multithreaded compilation' switch for the C++ compiler in VS. It would let you compile several source files in parallel. It doesn't seem to be available under the project settings, and my searches keep bringing up tutorials on multithreaded programming... Does anyone remember what the switch is or VS2009? My compilation times are hitting 15 minutes or more... :( Cheers, James

Share this post


Link to post
Share on other sites
Quote:
Original post by beebs1
Hiya,

I remember a while back Microsoft introduced a 'multithreaded compilation' switch for the C++ compiler in VS. It would let you compile several source files in parallel.

It doesn't seem to be available under the project settings, and my searches keep bringing up tutorials on multithreaded programming...

Does anyone remember what the switch is or VS2009? My compilation times are hitting 15 minutes or more... :(

Cheers,
James


From what i remember the "multithread" functionality is just a parallel build of multiple projects in the same solution (if they have no dependency relation). It does not need any configuration, it is enabled by default for any multicore machine.
Anyway 15 minutes is really a lot, what are you compiling?

Share this post


Link to post
Share on other sites
Multithreaded building of c/cpp files in one project was officially introduced in VS2008, although it also works in VS2005 (also in Express editions).

You should simply add /MP switch to custom C++ compilation options.

Share this post


Link to post
Share on other sites
Multithreaded I don't know, but there is a switch to make Visual Studio compile source files in multiple processes. The /MP switch. Add that into the Advanced section for compilation and see if that does the trick. There are some other compilation flags that aren't compatible with this one, but I use this for all my builds and it really speeds things up for the big ones.

More info: http://msdn.microsoft.com/en-us/library/bb385193.aspx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this