roboticslab-uc3m / installation-guides

Centralized administration of dependency installation guides.
https://robots.uc3m.es/installation-guides/
70 stars 35 forks source link

Replace `make`arbitrary -j parameter #8

Closed jgvictores closed 7 years ago

jgvictores commented 7 years ago

There are more sophisticated solutions, such as [ref]:

NB_CORES=$(grep -c '^processor' /proc/cpuinfo)
make -j$((NB_CORES+1)) -l${NB_CORES}
PeterBowman commented 7 years ago

Remaining make -j occurrences:

install-speech-recognition.md
install-kdl.md
install-icub.md
install-travislib.md
install-aquila.md
install-openrave.md

Retrieved with: grep -Prl 'make \-j(?!\$)' --exclude-dir=.git.

jgvictores commented 7 years ago

Does the regex you cite include "orphan" makes? (no -j,, should be updated too...).

PeterBowman commented 7 years ago

Hm, no, just looked at the title and forgot about all the plain makes around there. BTW doesn't it feel like too much clutter for such a simple task (compared to -j$(nproc))?

jgvictores commented 7 years ago

Maybe... or maybe... NPROC=$(nproc); make -j$((NPROC+1)) -l${NPROC} ??

PeterBowman commented 7 years ago

IMO the fewer instructions the better - I'd remove NPROC=$(nproc); and inline nproc in following make calls.

jgvictores commented 7 years ago

Yes, i agree. I have not found relevant sources regarding the benefits on -j(n+1) anyway [1][2], so:

make -j$(nproc)

Looks good to me!

jgvictores commented 7 years ago

Done at a03df57603d6686c90d0490a42131e8c87a38729.