From 19e17819d03853b51fc202e6d5ade796ec5ce1c5 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sun, 13 Dec 2015 07:16:26 -0500 Subject: [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. --- bin/cmakehdf5 | 29 +++++++++++++++++++++++++---- 1 file 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 [] 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= | --without-zlib: Use zlib library for external deflate I/O filter. Default is on. --with-szlib | --with-szlib= | --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 + + : the file path to the library, expect /lib and /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 -- cgit v0.12