views:

215

answers:

4

I remember reading somewhere about multiproc builds in VS2008, only I can't find the article now. Does anyone know how to turn this on, or even if it is possible?

A: 

which language? Do you mean the multithreaded CRT libraries (ie use the /MD c++ compiler option)?

gbjbaanb
A: 

Open the "Options" dialog. Under "Projects and Solutions", display the "Build and Run" options. There you can set "maximum number of parallel project builds".

Dan
A: 

I suspect you're asking about the new (for VS 2008) multi-proc VC++ build feature. See this.

The /MP option can reduce the total time to compile the source files on the command line. The /MP option causes the compiler to create one or more copies of itself, each in a separate process. Then these copies simultaneously compile the source files. Consequently, the total time to build the source files can be significantly reduced.

This feature was present in older versions of VC++, but was not documented. This is not the multi project building we've had for some time.

Aardvark
+4  A: 

There are two ways to parallelize a build in VS2008.

The first is to run several project builds in parallel. The setting is in Tools->Options->Projects and Solutions->Build and Run, called "Maximum number of parallel project builds". Note that each project will only build one file at a time.

The second is to compile multiple files at a time within a single project. With C++, this is done by setting the /MP compiler flag. Note that this feature interacts rather oddly with precompiled headers, and you'll have to jump through some hoops to combine the two.

Ben Straub
@Ben: Could you elaborate on "interacts rather oddly with precompiled headers"? I tried /MP on our sources and the compiler failed intermittently with permissions errors, presumably because the parallel processes were interfering with each other. Might adjusting my precompiled header settings help, or is this unrelated? Thanks...
RichieHindle
I talk about some other problems with /MP here: http://stackoverflow.com/questions/230298
Aardvark
@Richie: We found that a /MP build would fail magnificently with project-level settings for a precompiled header. If you set /Yu for the *project*, and set /Yc on stdafx.cpp, it seems to work okay.
Ben Straub