I was reading GNU make manual and I got a question..
我正在阅读GNU制作手册,我有一个问题。
Regarding the parallel execution, I don't get the differece between -j
option and -l
options.
关于并行执行,我没有得到-j选项和-l选项之间的区别。
As I understand, they have the same role to limit the jobs number. But the manual tells me that two options are different.
据我所知,他们的职责是限制工作数量。但是手册告诉我,有两个选项是不同的。
Please answer. Thanks!
请回答。谢谢!
2
As said above, man make
is pretty explicit, if you know what load-average
means, which is for instance summarized in this superuser question. To paraphrase the documentation,
如上所述,man make是非常明确的,如果你知道load-average是什么意思,例如在这个超级用户问题中总结出来的。套用的文档,
-j N
will let make
attempt to launch up to N
commands in parallel, regardless of what else might be running on the system.-l N
will let make
attempt to launch new commands only if the load-average
, i.e. the average number of processes trying to obtain some CPU time during the last few moments, is less than N
. It's thus more friendly towards other tasks that are running in parallel to your compilation.0
Make by default starts 1 job. If you want to use all your CPUs/Cores use -j X. If you are afraid your machine gets overloaded add -l Y
使默认启动1个作业。如果您想使用所有cpu /内核,请使用-j x
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2015/08/07/6a52483490bab31aadf54b4784fd93a6.html。