From fb8c399548d636a1a7de949f4b27c5f001096a33 Mon Sep 17 00:00:00 2001 From: Fabian Castelli <50630942+gfcas@users.noreply.github.com> Date: Thu, 27 May 2021 10:56:55 +0200 Subject: [PATCH] Unification ON|OFF (#176) * Option CLEAN_BUILD * Option native optimizations * Option build examples * Option stable build * Update comments --- candi.cfg | 29 ++++++++++--------- candi.sh | 14 ++++----- deal.II-toolchain/packages/dealii.package | 16 +++++----- deal.II-toolchain/packages/petsc.package | 2 +- .../platforms/deprecated/ubuntu14.platform | 2 +- 5 files changed, 31 insertions(+), 32 deletions(-) diff --git a/candi.cfg b/candi.cfg index fd67358..75ad77e 100644 --- a/candi.cfg +++ b/candi.cfg @@ -2,7 +2,9 @@ # Meta-project to build PROJECT=deal.II-toolchain -CLEAN_BUILD=false + +# Option {ON|OFF}: Use fresh build directory by remove existing ones? +CLEAN_BUILD=OFF ######################################################################### @@ -25,14 +27,14 @@ INSTALL_PATH=${PREFIX_PATH} MIRROR="https://tjhei.info/candi-mirror/ https://cecas.clemson.edu/dealii/mirror/" ######################################################################### -#Choose configuration and components of deal.II +# Choose additional configuration and components of deal.II DEAL_CONFOPTS="" -# enable machine-specific optimizations (implies -march=native etc.)? -#NATIVE_OPTIMIZATIONS=true +# Option {ON|OFF}: Enable machine-specific optimizations (e.g. -march=native)? +NATIVE_OPTIMIZATIONS=OFF -# enable building of dealii examples -BUILD_EXAMPLES=true +# Option {ON|OFF}: Enable building of dealii examples? +BUILD_EXAMPLES=ON # Choose the python interpreter to use. We pick python2, python3, # python in that order by default. If you want to override this @@ -77,13 +79,12 @@ PACKAGES="${PACKAGES} dealii" # Install the following deal.II version: DEAL_II_VERSION=v9.2.0 -# Would you like to build stable version of deal.II? -# If STABLE_BUILD=false, then the development version of deal.II will be +# Option {ON|OFF}: Would you like to build stable version of deal.II? +# If STABLE_BUILD=OFF, then the development version of deal.II will be # installed. -STABLE_BUILD=true -#STABLE_BUILD=false +STABLE_BUILD=ON -if [ ${STABLE_BUILD} = "false" ]; then +if [ ${STABLE_BUILD} = OFF ]; then DEAL_II_VERSION=master fi @@ -96,7 +97,7 @@ TRILINOS_MAJOR_VERSION=AUTO ######################################################################### -# Do you want to use MKL? +# Option {ON|OFF}: Do you want to use MKL? MKL=OFF # MKL_DIR= # BLAS_DIR= @@ -111,8 +112,8 @@ MKL=OFF ######################################################################### -# If you want to change the source code of one or multiple packages -# switch on the developer mode to avoid a package fetch and unpack. +# Option {ON|OFF}: If you want to change the source code of one or multiple +# packages switch on the developer mode to avoid a package fetch and unpack. # Note: a previous run of candi with the same settings must be done without # this mode! DEVELOPER_MODE=OFF diff --git a/candi.sh b/candi.sh index d008646..8ebe5af 100755 --- a/candi.sh +++ b/candi.sh @@ -350,7 +350,7 @@ package_fetch () { cd .. fi - if [ ${STABLE_BUILD} = true ]; then + if [ ${STABLE_BUILD} = ON ]; then cd ${EXTRACTSTO} git checkout ${VERSION} --force quit_if_fail "candi: git checkout ${VERSION} --force failed" @@ -458,7 +458,7 @@ package_build() { default BUILDDIR=${BUILD_PATH}/${NAME} # Clean the build directory if specified - if [ -d ${BUILDDIR} ] && [ ${CLEAN_BUILD} = "true" ]; then + if [ -d ${BUILDDIR} ] && [ ${CLEAN_BUILD} = ON ]; then rm -rf ${BUILDDIR} fi @@ -671,8 +671,8 @@ default BUILD_PATH=${PREFIX_PATH}/tmp/build default INSTALL_PATH=${PREFIX_PATH} default CONFIGURATION_PATH=${INSTALL_PATH}/configuration -default CLEAN_BUILD=false -default STABLE_BUILD=true +default CLEAN_BUILD=OFF +default STABLE_BUILD=ON default DEVELOPER_MODE=OFF default PACKAGES_OFF="" @@ -847,7 +847,7 @@ elif [ ${DEVELOPER_MODE} = "ON" ]; then cecho ${BAD} "source files from: $(prettify_dir ${UNPACK_PATH})" echo else - cecho ${BAD} "candi: bad variable: DEVELOPER_MODE={OFF|ON}; (your specified option is = ${DEVELOPER_MODE})" + cecho ${BAD} "candi: bad variable: DEVELOPER_MODE={ON|OFF}; (your specified option is = ${DEVELOPER_MODE})" exit 1 fi @@ -869,7 +869,7 @@ echo echo "-------------------------------------------------------------------------------" -if [ ${STABLE_BUILD} = true ]; then +if [ ${STABLE_BUILD} = ON ]; then cecho ${INFO} "Building stable releases of ${PROJECT} packages." else cecho ${WARN} "Building development versions of ${PROJECT} packages." @@ -1096,7 +1096,7 @@ for PACKAGE in ${PACKAGES[@]}; do # Turn to a stable version of the package if that's what the user # wants and it exists - if [ ${STABLE_BUILD} = true ] && [ -e ${PROJECT}/packages/${PACKAGE}-stable.package ]; then + if [ ${STABLE_BUILD} = ON ] && [ -e ${PROJECT}/packages/${PACKAGE}-stable.package ]; then source ${PROJECT}/packages/${PACKAGE}-stable.package fi diff --git a/deal.II-toolchain/packages/dealii.package b/deal.II-toolchain/packages/dealii.package index 54991a9..0ef317c 100644 --- a/deal.II-toolchain/packages/dealii.package +++ b/deal.II-toolchain/packages/dealii.package @@ -10,10 +10,10 @@ BUILDDIR=${BUILD_PATH}/deal.II-${VERSION} INSTALL_PATH=${ORIG_INSTALL_PATH}/deal.II-${VERSION} ################################################################################ -# Please do not change the line below! +# Please do not change the lines below! ################################################################################ -#Choose general configuration and components of deal.II +# Choose general configuration and components of deal.II CONFOPTS=" \ -D CMAKE_BUILD_TYPE=DebugRelease \ @@ -27,18 +27,16 @@ CONFOPTS=" \ -D DEAL_II_WITH_ZLIB:BOOL=ON" # Choice of whether to build the dealii examples -if [ "${BUILD_EXAMPLES}" = "true" ]; then +if [ ${BUILD_EXAMPLES} = ON ] || [ ${BUILD_EXAMPLES} = OFF ]; then CONFOPTS="${CONFOPTS} \ - -D DEAL_II_COMPONENT_EXAMPLES:BOOL=ON" -elif [ "${BUILD_EXAMPLES}" = "false" ]; then - CONFOPTS="${CONFOPTS} \ - -D DEAL_II_COMPONENT_EXAMPLES:BOOL=OFF" + -D DEAL_II_COMPONENT_EXAMPLES:BOOL=${BUILD_EXAMPLES}" else - cecho ${BAD} "candi: bad variable: BUILD_EXAMPLES={false|true}; (your specified option is = ${BUILD_EXAMPLES})" + cecho ${BAD} "candi: bad variable: BUILD_EXAMPLES={ON|OFF}; (your specified option is = ${BUILD_EXAMPLES})" exit 1 fi -if [ "${NATIVE_OPTIMIZATIONS}" = "true" ]; then +# Choice of whether native compiler optimizations should be enabled +if [ ${NATIVE_OPTIMIZATIONS} = ON ]; then CONFOPTS="${CONFOPTS} \ -D CMAKE_CXX_FLAGS='-march=native'" fi diff --git a/deal.II-toolchain/packages/petsc.package b/deal.II-toolchain/packages/petsc.package index e54dad9..bc48cbf 100644 --- a/deal.II-toolchain/packages/petsc.package +++ b/deal.II-toolchain/packages/petsc.package @@ -30,7 +30,7 @@ CONFOPTS=" --with-64-bit-indices=0 " -if [ "${NATIVE_OPTIMIZATIONS}" = "true" ]; then +if [ ${NATIVE_OPTIMIZATIONS} = ON ]; then CONFOPTS="${CONFOPTS} \ COPTFLAGS='-O3 -march=native -mtune=native' \ CXXOPTFLAGS='-O3 -march=native -mtune=native' \ diff --git a/deal.II-toolchain/platforms/deprecated/ubuntu14.platform b/deal.II-toolchain/platforms/deprecated/ubuntu14.platform index 1ffa4ff..1fc6f06 100644 --- a/deal.II-toolchain/platforms/deprecated/ubuntu14.platform +++ b/deal.II-toolchain/platforms/deprecated/ubuntu14.platform @@ -20,7 +20,7 @@ # version number is not set to AUTO. # The last point is due to own compilers (e.g. intel) which support # Trilinos 12. -if [ ${STABLE_BUILD} == "true" ] && [ ${DEAL_II_VERSION} == "v8.3.0" ] && [ ${TRILINOS_MAJOR_VERSION} == "AUTO" ]; then +if [ ${STABLE_BUILD} = ON ] && [ ${DEAL_II_VERSION} == "v8.3.0" ] && [ ${TRILINOS_MAJOR_VERSION} == "AUTO" ]; then TRILINOS_MAJOR_VERSION=11 fi -- 2.39.5