gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 76f14f6 1/2: developer-build: number of parall


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 76f14f6 1/2: developer-build: number of parallel jobs calculated at run time
Date: Sun, 26 Jul 2020 17:02:38 -0400 (EDT)

branch: master
commit 76f14f6ce6a74e25710ba663184f900a212b0e53
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    developer-build: number of parallel jobs calculated at run time
    
    Until now, the 'developer-build' script used a hard-coded number for the
    number of parallel jobs. But this isn't generally good, because on
    different systems, we may need a different number of threads.
    
    With this commit, it now reads the number of threads from the system (using
    'nproc') when no value has been given as an option.
---
 developer-build | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/developer-build b/developer-build
index 1a430db..ab8a178 100755
--- a/developer-build
+++ b/developer-build
@@ -36,7 +36,7 @@ set -e
 
 
 # Default values for variables.
-jobs=8
+jobs=0
 dist=0
 debug=0
 clean=0
@@ -306,19 +306,27 @@ done
 
 
 
-# Check if top_build_dir exists
-if [ ! -d $top_build_dir ]; then
-    echo "$top_build_dir doesn't exist. Aborted."
-    exit 1
-fi
+# Keep the address of this source directory (where this script is being run
+# from) which we will need later.
+srcdir=$(pwd)
 
 
 
 
 
-# Keep the address of this source directory (where this script is being run
-# from) which we will need later.
-srcdir=$(pwd)
+# Set the number of jobs.
+if [ $jobs = 0 ]; then
+    jobs=$(nproc)
+fi
+
+
+
+
+# Check if top_build_dir exists
+if [ ! -d $top_build_dir ]; then
+    echo "$top_build_dir doesn't exist. Aborted."
+    exit 1
+fi
 
 
 
@@ -420,7 +428,7 @@ fi
 
 
 # Build Gnuastro in that directory with the specified number of threads
-make -kj$jobs
+make -k -j$jobs
 
 
 
@@ -428,7 +436,7 @@ make -kj$jobs
 
 # If requested, also run 'make check'.
 if [ x$check = x1 ]; then
-    make check -kj$jobs
+    make check -k -j$jobs
 fi
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]