summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2015-12-13 12:16:26 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2015-12-13 12:16:26 (GMT)
commit19e17819d03853b51fc202e6d5ade796ec5ce1c5 (patch)
tree53a993672c94e83d6598c6df81b6c99521e2852a /bin
parent4af1699bfca560175cc2b4aa31d7761d58104cc1 (diff)
downloadhdf5-19e17819d03853b51fc202e6d5ade796ec5ce1c5.zip
hdf5-19e17819d03853b51fc202e6d5ade796ec5ce1c5.tar.gz
hdf5-19e17819d03853b51fc202e6d5ade796ec5ce1c5.tar.bz2
[svn-r28610] Merged r28563 from trunk.
HDFFV-9612: added ability to run multiple make commands. Added --njobs option to special number of jobs (-j N) to allow multiple commands during build (cmamke) and testing (ctest). Tested: platypus.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmakehdf529
1 files changed, 25 insertions, 4 deletions
diff --git a/bin/cmakehdf5 b/bin/cmakehdf5
index e8dc691..db7fd55 100755
--- a/bin/cmakehdf5
+++ b/bin/cmakehdf5
@@ -55,7 +55,10 @@ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT=ON # enable zlib filter default on
with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT=OFF # enables szip filter default off
szlib_path="" # szip lib path default off
shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON # enables shared lib; default on
-
+njobs="" # number of jobs (commands) to
+ # run simultaneously; default is
+ # value from $MAKE if defined,
+ # otherwise none (1)
#=============
# Function definitions
@@ -90,13 +93,18 @@ Usage: $progname [<options>]
enable or disable building tools. Default is on.
--enable-testing | --disable-testing:
enable or disable building tests. Default is on.
- --with-zlib | --without-zlib:
+ --with-zlib | --with-zlib=<libpath> | --without-zlib:
Use zlib library for external deflate I/O filter. Default is on.
--with-szlib | --with-szlib=<libpath> | --without-szlib:
Use szlib library for external deflate I/O filter. Default is on.
+ --njobs=<-j N>:
+ number of jobs (commands) to run simultaneously; default is value from
+ $MAKE if defined, otherwise none
--enable-verbose | --disable-verbose:
enable or disable verbose output. Default is on.
--help: shows details help page
+
+ <libpath>: the file path to the library, expect <libpath>/lib and <libpath>/include.
EOF
}
@@ -188,6 +196,12 @@ DUMP_LOGFILE()
# Show a start time stamp
TIMESTAMP
+# Initialize njobs if $AMKE is defined
+if [ -n "$MAKE" ]; then
+ # assume all arguments are for --jobs
+ njobs=`echo $MAKE | cut -s -d' ' -f2-`
+fi
+
# Parse Cmake configure options
# --enable-XXX or --disable-XXX will enable or disable feature XXX.
# XXX can be:
@@ -243,6 +257,10 @@ while [ $# -gt 0 ]; do
--with-zlib)
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
;;
+ --with-zlib=*)
+ xarg=`echo $1 | cut -d= -f2-`
+ with_zlib="-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_ROOT=$xarg"
+ ;;
--without-zlib)
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF
;;
@@ -259,6 +277,9 @@ while [ $# -gt 0 ]; do
with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF
szlib_path="" # reset the path
;;
+ --njobs=*)
+ njobs=`echo $1 | cut -d= -f2-`
+ ;;
--enable-verbose)
vflag=1
;;
@@ -326,10 +347,10 @@ STEP "Configure..." \
cat $config_summary >> $configlog
# 5. Build the C library, tools and tests with this command:
-STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog
+STEP "Build the library, tools and tests, ..." "cmake --build . --config Release -- $njobs" $makelog
# 6. Test the C library and tools with this command:
-STEP "Test the library and tools..." "ctest . -C Release" $testlog
+STEP "Test the library and tools..." "ctest . -C Release $njobs" $testlog
# 7. Create an install image with this command:
STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog