From 69f84075f59d2d085601dd79ccb19dd31abe5bd1 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 16 Jan 2017 11:54:29 +0100 Subject: [PATCH] changed: default to use one build thread per core on system, not a hardcoded 4 relies on nproc being available --- tests/update_helper.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/update_helper.sh b/tests/update_helper.sh index ca579cd90..5599e98a6 100755 --- a/tests/update_helper.sh +++ b/tests/update_helper.sh @@ -43,7 +43,18 @@ SCRIPT_PATH=`getAbsPath "$SCRIPT_PATH"` #Get options OPM_DATA= 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= [ $# -eq 0 ] && usage while getopts "d:w:p:t:h" arg; do