[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 76f14f6 1/2: developer-build: number of parall
[gnuastro-commits] master 76f14f6 1/2: developer-build: number of parallel jobs calculated at run time
Sun, 26 Jul 2020 17:02:38 -0400 (EDT)
Author: Mohammad Akhlaghi <email@example.com>
Commit: Mohammad Akhlaghi <firstname.lastname@example.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
@@ -36,7 +36,7 @@ set -e
# Default values for variables.
@@ -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
+# Keep the address of this source directory (where this script is being run
+# from) which we will need later.
-# Keep the address of this source directory (where this script is being run
-# from) which we will need later.
+# Set the number of jobs.
+if [ $jobs = 0 ]; then
+# Check if top_build_dir exists
+if [ ! -d $top_build_dir ]; then
+ echo "$top_build_dir doesn't exist. Aborted."
+ exit 1
@@ -420,7 +428,7 @@ fi
# Build Gnuastro in that directory with the specified number of threads
+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