Deparallelizer

Download Source: Deparallelizer-1.0-src.zip (4.08 kb)

Visual Studio 2008 has a great feature for compiling multi-project solutions in parallel.  If you have a computer that can handle it, Visual Studio will launch cl.exe multiple times during your build process in order to build projects in parallel.  It cannot do this for projects which depend on one another, but it attempts to figure out which projects can safely be built in parallel.

The only problem, a solution which builds as:

Microsoft (R) Visual Studio Version 9.0.21022.8.
Copyright (C) Microsoft Corp. All rights reserved.
------ Build started: Project: ProjectA, Configuration: Release Win32 ------
Compiling...
FileA.cpp
FileB.cpp
Linking...
   Creating library .\Release\ProjectA.lib and object .\Release\ProjectA.exp
Generating code
Finished generating code
Embedding manifest...
Build log was saved at "file://C:\ProjectA\Release\BuildLog.htm"
ProjectA - 0 error(s), 0 warning(s)
------ Build started: Project: ProjectB, Configuration: Release Win32 ------
Compiling...
FileC.cpp
FileD.cpp
Linking...
   Creating library .\Release\ProjectB.lib and object .\Release\ProjectB.exp
Generating code
Finished generating code
Embedding manifest...
Build log was saved at "file://C:\ProjectB\Release\BuildLog.htm"
ProjectB - 0 error(s), 0 warning(s)
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

may build as:

Microsoft (R) Visual Studio Version 9.0.21022.8.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: ProjectA, Configuration: Release Win32 ------
2>------ Build started: Project: ProjectB, Configuration: Release Win32 ------
1>Compiling...
1>FileA.cpp
2>Compiling...
2>FileC.cpp
2>FileD.cpp
1>FileB.cpp
1>Linking...
1>   Creating library .\Release\ProjectA.lib and object .\Release\ProjectA.exp
2>Linking...
2>   Creating library .\Release\ProjectB.lib and object .\Release\ProjectB.exp
1>Generating code
2>Generating code
1>Finished generating code
1>Embedding manifest...
1>Build log was saved at "file://C:\ProjectA\Release\BuildLog.htm"
1>ProjectA - 0 error(s), 0 warning(s)
2>Finished generating code
2>Embedding manifest...
2>Build log was saved at "file://C:\ProjectB\Release\BuildLog.htm"
2>ProjectB - 0 error(s), 0 warning(s)
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

See how the output is mixed between the different projects?  The lines are distinguished by the 1> and 2> at the beginning of each line.  Visual Studio will prepend these markers to help you read the logs.  The problem is that the logs get confusing to read, especially if you have 4 parallel builds going.

Deparallelizer is my attempt at cleaning up this build output.  If you are doing command-line builds, you can do the following:

devenv.exe MySolution.sln /build "Debug" | Deparallelizer.exe

to clean up the output.

Or, if you already have a log file you want to clean up, then specify the file on the command line:

Deparallelizer.exe MyBuild.log 

It will make the log appear as if there was only a single project being compiled at a time.  This makes viewing the log much easier.

I wrote it in C# and I've included the source above.  I did not include binaries at this time.  If I get requests for it, I'll make binaries available for download.

If you have bugs to report, improvements, or feature requests, please feel free to let me know.