News for hackers. Stuff that matters.
Re:GNU make insanity: finding the value of the -j parameter by foxhill on Saturday March 28, 2015 @03:09PM (#9282400)
i think the true insanity lies within the mind of the developer whose build system depends on the number of jobs being ran in parallel..!

interesting academic exercise though. unless i'm mistaken, this will only detect up to 32 build jobs? i'd hate to see the Makefile that works for arbitrary values..

Re:GNU make insanity: finding the value of the -j parameter by pavpanchekha on Sunday March 29, 2015 @02:49AM (#9284109)
Say one of your build rules generates a data file by performing some expensive computations. The parallelism is internal to the code (say, it's a Monte-Carlo simulation), so it should run on a lot of cores, but if you're doing it multiple times (with, say, different parameters) in parallel, you don't want the total number of threads spawned to be more than the machine has.
Re:GNU make insanity: finding the value of the -j parameter by rlpb on Monday March 30, 2015 @06:15AM (#9288612)
Why would you want to do it multiple times with different parameters in parallel? If your code can already scale to multiple cores, then just have each parameter set run one at a time, and you're already maximizing your CPU use.

Or integrate with make's jobserver as someone else has described.

Re:GNU make insanity: finding the value of the -j parameter by foxhill on Sunday March 29, 2015 @11:33AM (#9285156)
true, however my only complaint -

> you don't want the total number of threads spawned to be more than the machine has

that may not be necessarily true, and regardless, it might be a sane decision for yourself, but it might not be for others.

Re:GNU make insanity: finding the value of the -j parameter by chaosfactor on Saturday March 28, 2015 @03:26PM (#9282456)
It makes some sense to want to know this. You might know that your build process doesn't benefit from more than 4 jobs, and want to alert this to the developer who tries to use more.
Re:GNU make insanity: finding the value of the -j parameter by moonbug on Saturday March 28, 2015 @03:41PM (#9282515)
Not all problems need a solution in code.
Re:GNU make insanity: finding the value of the -j parameter by nsajko on Saturday March 28, 2015 @04:09PM (#9282597)
Awesome! This goes in my fortune file :D
Re:GNU make insanity: finding the value of the -j parameter by stormbrew on Saturday March 28, 2015 @04:38PM (#9282667)
I really have to echo the person who replied to you on a different thread and ask.. why? What do you think you're saving the user from exactly?
Re:GNU make insanity: finding the value of the -j parameter by xorcist on Sunday March 29, 2015 @03:20AM (#9284141)
Please avoid such things. Useless warnings just create noise that mask real ones. Just this one may not matter, but the same rationality would apply to hundreds more.