Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make (Parallel Jobs) on Windows

What setup works for GNU make parallel jobs (-j) on Windows?

I have tried setting the shell to cmd.exe using MinGW make 3.81, this works in creating the multiple processes but make fails with the "waiting for job" message.

Can this work and what is the best setup? (MinGW / Cygwin / ???) Can someone point me to a working example to test against?

like image 858
Oliver Avatar asked Oct 07 '09 18:10

Oliver


People also ask

How do you make parallelize?

To start GNU Make in parallel mode it's enough to specify either the -j or --jobs option on the command-line. The argument to the option is the maximum number of processes that GNU Make will run in parallel. For example, typing make --jobs=4 will allow GNU Make to run up to four subprocesses in parallel.

What is parallel job?

A parallel job is: A single task running concurrently on multiple workers that may communicate with each other. On the SCC, this results in one batch job with multiple processors running in parallel. This is also known as a data-parallel job.

What is make J?

The -j option tells make how many jobs (commands) to run in parallel. This is limited by how many physical CPUs and RAM your system has. Many make jobs use as many CPUs as it finds in the system.

How does make J work?

make will build a graph where the targets and prerequisites are vertices and there is a directed edge from the prereqs to their targets. In this way the number of incoming edges tells you how many prereqs a target has. If it has no incoming edges, then it has no prerequisites.


1 Answers

As Far as I can understand, GNU Make's parallel jobs depend on the underlying platform to supply (CPU) load information. This is unfortunately done in a non-Windows-compatible way, and only the "make -j" command does anything scalingwise. That command (without max number of jobs) is potentially quite dangerous, as it will eat memory like a rabid starving dog (I tried it on Qt, and it crashed on QtWebkit, the largest project in Qt, 4GB RAM, Win7).

On second thought, I get the feeling make -j3 runs faster than make, but in light of what I can find on the web (forums, manual...) it seems very POSIX/linux specific functionality.

BTW, I'm surprised your question was voted down.

like image 97
rubenvb Avatar answered Oct 08 '22 09:10

rubenvb