[build] Set number of job slots automatically to the number of CPU cores

Started by eumagga0x2a, September 06, 2016, 06:15:39 PM

Previous topic - Next topic

eumagga0x2a

Currently the max. number of make recipes executed in parallel is hardcoded as 2 in bootStrap.bash:19. I guess it is safe to set this limit automatically to the number of CPU cores, isn't it?

diff --git a/bootStrap.bash b/bootStrap.bash
index d4ea659..ce4e8d9 100644
--- a/bootStrap.bash
+++ b/bootStrap.bash
@@ -16,7 +16,7 @@ debug=0
qt_ext=Qt5
QT_FLAVOR="-DENABLE_QT5=True"
export QT_SELECT=5 # default for ubuntu, harmless for others
-export O_PARAL="-j 2"
+export O_PARAL="-j $(nproc)"
fail()
{
         echo "** Failed at $1**"