changed: default to use one build thread per core on system, not a hardcoded 4

relies on nproc being available
This commit is contained in:
Arne Morten Kvarving
2017-01-16 11:54:29 +01:00
parent f43bac8efa
commit 69f84075f5

View File

@@ -43,7 +43,18 @@ SCRIPT_PATH=`getAbsPath "$SCRIPT_PATH"`
#Get options #Get options
OPM_DATA= OPM_DATA=
WORKSPACE="$SCRIPT_PATH/.." WORKSPACE="$SCRIPT_PATH/.."
BUILDTHREADS=4
if [ "$OSTYPE" == "linux-gnu" ]
then
if which nproc > /dev/null
then
BUILDTHREADS=`nproc`
fi
else # OSX
BUILDTHREADS=`sysctl hw.ncpu | awk -F ' ' '{print $1}'`
fi
test -z "$BUILDTHREADS" && BUILDTHREADS=1
PULL_REQUESTS= PULL_REQUESTS=
[ $# -eq 0 ] && usage [ $# -eq 0 ] && usage
while getopts "d:w:p:t:h" arg; do while getopts "d:w:p:t:h" arg; do