Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get VisualStudio 2010 to use more than one processor core when compiling?

My workstation has an AMD Phenom II x6, 4GB DDR3 ram, and Windows XP 32-bit (yes, still XP and still 32 bit).

When I am compiling projects using VS2010, I've noticed that it doesn't use more than 1 core (at least this is what task manager is telling me).

Is there a way to get it to compile the individual files using multiple cores? -- Or is it XP?

Thanks in advance for any answers.

Edit:

Damien pointed me to this link regarding the /MP option for C++ projects.

like image 691
defube Avatar asked Sep 02 '10 07:09

defube


2 Answers

MSBUild can use multiple processes, which can compile separate projects in parallel (see the /maxcpucount switch), but there's no ability as yet for the compilers (other than the C++ one) to use multiple processes within a single project.

like image 53
Damien_The_Unbeliever Avatar answered Sep 28 '22 09:09

Damien_The_Unbeliever


I don't think this is directly possible.

However, there are some alternative solutions:

  • Write your own compiler front end. It should look up the files that need to be compiled, and then spawns multiple compiler processes. This approach seems strange, but we have done this (mainly because we switched between different platforms over the last 15 years and we wanted a consistent, multi-platform build-process)
  • Consider applications like Electric Build or Incredibuild. They can even spread your compilations over multiple machines. It's like having 20 cores in your machine.
like image 38
Patrick Avatar answered Sep 28 '22 09:09

Patrick