From f6e863eee206a3eb3d615abe0551bb1b0fbf4c4c Mon Sep 17 00:00:00 2001 From: Fabian Castelli Date: Mon, 7 Jun 2021 19:20:42 +0200 Subject: [PATCH] Replace option --PROCS by --jobs --- README.md | 4 ++- candi.sh | 28 ++++++++++----------- deal.II-toolchain/packages/astyle.package | 2 +- deal.II-toolchain/packages/boost.package | 2 +- deal.II-toolchain/packages/openblas.package | 4 +-- deal.II-toolchain/packages/p4est.package | 8 +++--- deal.II-toolchain/packages/parmetis.package | 4 +-- 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 6961364..46c1b8a 100644 --- a/README.md +++ b/README.md @@ -100,9 +100,11 @@ You can combine the command line options given below. ./candi.sh --prefix=Your/Prefix/Path ``` -#### Multiple build processes: ``[-j ]``, ``[--PROCS=]`` +#### Multiple build processes: ``[-j]``, ``[-j ]``, ``[--jobs=]`` ```bash + ./candi.sh -j ./candi.sh -j + ./candi.sh --jobs= ``` * Example: to use 2 build processes type ``./candi.sh -j 2``. diff --git a/candi.sh b/candi.sh index b161021..7658a24 100755 --- a/candi.sh +++ b/candi.sh @@ -40,7 +40,7 @@ TIC_GLOBAL="$(${DATE_CMD} +%s)" ################################################################################ # Parse command line input parameters PREFIX=~/deal.ii-candi -PROCS=1 +JOBS=1 CMD_PACKAGES="" SKIP_READ=false @@ -54,7 +54,7 @@ while [ -n "$1" ]; do echo "Usage: $0 [options]" echo "Options:" echo " -p , --prefix= set a different prefix path (default $PREFIX)" - echo " -j , -j, --PROCS= compile with N processes in parallel (default $PROCS)" + echo " -j , -j, --jobs= compile with N processes in parallel (default ${JOBS})" echo " --platform= force usage of a particular platform file" echo " --packages=\"pkg1 pkg2\" install the given list of packages instead of the default set in candi.cfg" echo " -y, --yes, --assume-yes automatic yes to prompts" @@ -83,18 +83,18 @@ while [ -n "$1" ]; do ##################################### # Number of maximum processes to use - --PROCS=*) - PROCS="${param#*=}" + --jobs=*) + JOBS="${param#*=}" ;; # Make styled processes with or without space -j) shift - PROCS="${1}" + JOBS="${1}" ;; -j*) - PROCS="${param#*j}" + JOBS="${param#*j}" ;; ##################################### @@ -120,8 +120,8 @@ done PREFIX_PATH=${PREFIX/#~\//$HOME\/} RE='^[0-9]+$' -if [[ ! "$PROCS" =~ $RE || $PROCS<1 ]] ; then - echo "ERROR: invalid number of build processes '$PROCS'" +if [[ ! "${JOBS}" =~ ${RE} || ${JOBS}<1 ]] ; then + echo "ERROR: invalid number of build processes '${JOBS}'" exit 1 fi @@ -523,7 +523,7 @@ package_build() { fi for target in "${TARGETS[@]}"; do - echo make ${MAKEOPTS} -j ${PROCS} $target >>candi_build + echo make ${MAKEOPTS} -j ${JOBS} $target >>candi_build done elif [ ${BUILDCHAIN} = "cmake" ]; then @@ -531,7 +531,7 @@ package_build() { rm -rf ${BUILDDIR}/CMakeFiles echo cmake ${CONFOPTS} -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} ${UNPACK_PATH}/${EXTRACTSTO} >>candi_configure for target in "${TARGETS[@]}"; do - echo make ${MAKEOPTS} -j ${PROCS} $target >>candi_build + echo make ${MAKEOPTS} -j ${JOBS} $target >>candi_build done elif [ ${BUILDCHAIN} = "python" ]; then @@ -541,7 +541,7 @@ package_build() { elif [ ${BUILDCHAIN} = "scons" ]; then echo cp -rf ${UNPACK_PATH}/${EXTRACTSTO}/* . >>candi_configure for target in "${TARGETS[@]}"; do - echo scons -j ${PROCS} ${CONFOPTS} prefix=${INSTALL_PATH} $target >>candi_build + echo scons -j ${JOBS} ${CONFOPTS} prefix=${INSTALL_PATH} $target >>candi_build done elif [ ${BUILDCHAIN} = "custom" ]; then @@ -885,7 +885,7 @@ cecho ${GOOD} "Package configuration in: $(prettify_dir ${CONFIGURATION_PATH})" echo echo "-------------------------------------------------------------------------------" -cecho ${INFO} "Number of (at most) build processes to use: PROCS=${PROCS}" +cecho ${INFO} "Number of (at most) build processes to use: JOBS=${JOBS}" echo echo "-------------------------------------------------------------------------------" @@ -1047,7 +1047,7 @@ EOF # WARNING: do not overwrite this variables! ORIG_INSTALL_PATH=${INSTALL_PATH} ORIG_CONFIGURATION_PATH=${CONFIGURATION_PATH} -ORIG_PROCS=${PROCS} +ORIG_JOBS=${JOBS} guess_architecture @@ -1098,7 +1098,7 @@ for PACKAGE in ${PACKAGES[@]}; do unset CONFIG_FILE unset CHERRYPICKCOMMITS TARGETS=('' install) - PROCS=${ORIG_PROCS} + JOBS=${ORIG_JOBS} INSTALL_PATH=${ORIG_INSTALL_PATH} CONFIGURATION_PATH=${ORIG_CONFIGURATION_PATH} diff --git a/deal.II-toolchain/packages/astyle.package b/deal.II-toolchain/packages/astyle.package index 09784b9..6160ead 100644 --- a/deal.II-toolchain/packages/astyle.package +++ b/deal.II-toolchain/packages/astyle.package @@ -13,7 +13,7 @@ package_specific_setup () { cp -rf ${UNPACK_PATH}/${EXTRACTSTO}/* . cd build/gcc mkdir -p ${INSTALL_PATH} - make -j${PROCS} >> make.output || bdie "Error in make" + make -j${JOBS} >> make.output || bdie "Error in make" cp bin/astyle ${INSTALL_PATH}/ } diff --git a/deal.II-toolchain/packages/boost.package b/deal.II-toolchain/packages/boost.package index a8ee302..8611ad3 100644 --- a/deal.II-toolchain/packages/boost.package +++ b/deal.II-toolchain/packages/boost.package @@ -16,7 +16,7 @@ package_specific_build () { quit_if_fail "boost build ./bootstrap.sh failed" echo "using mpi ;" > user-config.jam - ./b2 -j ${PROCS} --user-config=user-config.jam --build-dir=candi_build_dir link=shared install ${CONFOPTS} + ./b2 -j ${JOBS} --user-config=user-config.jam --build-dir=candi_build_dir link=shared install ${CONFOPTS} quit_if_fail "boost build ./b2 failed" } diff --git a/deal.II-toolchain/packages/openblas.package b/deal.II-toolchain/packages/openblas.package index 00a343e..28ad34d 100644 --- a/deal.II-toolchain/packages/openblas.package +++ b/deal.II-toolchain/packages/openblas.package @@ -20,10 +20,10 @@ package_specific_build () { cd ${BUILDDIR} cp -rf ${UNPACK_PATH}/${EXTRACTSTO}/* . - make -j ${PROCS} PREFIX=${INSTALL_PATH} + make -j ${JOBS} PREFIX=${INSTALL_PATH} quit_if_fail "make failed" - make install -j ${PROCS} PREFIX=${INSTALL_PATH} + make install -j ${JOBS} PREFIX=${INSTALL_PATH} quit_if_fail "make install failed" } diff --git a/deal.II-toolchain/packages/p4est.package b/deal.II-toolchain/packages/p4est.package index ecdfbd2..e357a60 100644 --- a/deal.II-toolchain/packages/p4est.package +++ b/deal.II-toolchain/packages/p4est.package @@ -83,8 +83,8 @@ package_specific_setup () { --prefix="$INSTALL_FAST" CFLAGS="$CFLAGS_FAST" \ CPPFLAGS="-DSC_LOG_PRIORITY=SC_LP_ESSENTIAL" F77="$FF" \ "$@" > config.output || bdie "Error in configure" - make -C sc -j${PROCS} > make.output || bdie "Error in make sc" - make -j${PROCS} >> make.output || bdie "Error in make p4est" + make -C sc -j${JOBS} > make.output || bdie "Error in make sc" + make -j${JOBS} >> make.output || bdie "Error in make p4est" make install >> make.output || bdie "Error in make install" echo "FAST version installed in $INSTALL_FAST" @@ -97,8 +97,8 @@ package_specific_setup () { --prefix="$INSTALL_DEBUG" CFLAGS="$CFLAGS_DEBUG" \ CPPFLAGS="-DSC_LOG_PRIORITY=SC_LP_ESSENTIAL" F77="$FF" \ "$@" > config.output || bdie "Error in configure" - make -C sc -j${PROCS} > make.output || bdie "Error in make sc" - make -j${PROCS} >> make.output || bdie "Error in make p4est" + make -C sc -j${JOBS} > make.output || bdie "Error in make sc" + make -j${JOBS} >> make.output || bdie "Error in make p4est" make install >> make.output || bdie "Error in make install" grep -q "#define P4EST_HAVE_ZLIB" $INSTALL_DEBUG/include/p4est_config.h || bdie "Error: p4est couldn't find zlib" echo "DEBUG version installed in $INSTALL_DEBUG" diff --git a/deal.II-toolchain/packages/parmetis.package b/deal.II-toolchain/packages/parmetis.package index 2a4ec83..56bf695 100644 --- a/deal.II-toolchain/packages/parmetis.package +++ b/deal.II-toolchain/packages/parmetis.package @@ -16,7 +16,7 @@ package_specific_build() { make config prefix=${INSTALL_PATH} shared=1 quit_if_fail "parmetis/metis make config failed" - make -j${PROCS} + make -j${JOBS} quit_if_fail "parmetis/metis make failed" make install @@ -28,7 +28,7 @@ package_specific_build() { make config prefix=${INSTALL_PATH} shared=1 cc=$CC cxx=$CXX quit_if_fail "parmetis make config failed" - make -j${PROCS} + make -j${JOBS} quit_if_fail "parmetis make failed" make install -- 2.39.5