From 65b8ca621511ec34d19dc78d4fc4d645a40da0ad Mon Sep 17 00:00:00 2001 From: Panagiotis Velissariou Date: Wed, 13 Sep 2023 12:06:52 -0500 Subject: [PATCH] added USE_PAHM/NO_PARMETIS functionality in the build scripts for the SCHISM component --- scripts/functions_build | 54 ++++++++++++++++++++++++++++++------- scripts/functions_utilities | 6 ++--- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/scripts/functions_build b/scripts/functions_build index 6129dd67..83dc7802 100644 --- a/scripts/functions_build +++ b/scripts/functions_build @@ -740,16 +740,35 @@ UsageBuild() # by using the --thirdparty="parmetis" option. We issue a warning here to let the user # know that he/she might need to specify this library. if [[ ":${chk_component}:" == *:"SCHISM":* ]]; then - if ! $( checkSUBSTR "${tmp_thirdparty}" PARMETIS ) && \ - [ -z "${PARMETIS_HOME}" ] && [ -z "${PARMETISHOME}" ]; then - procWarn "The PARMETIS library might be needed for the compilation of SCHISM." \ - "Please supply the PARMETIS_HOME or PARMETISHOME environment" \ - "variable that points to the location of the pre-compiled library or use the" \ - "--thirdparty="parmetis" option in the build.sh script to compile the" \ - "library from within CoastalApp (NOTE: need to download first the library" \ - "by running the download_parmetis.sh script found in the scripts directory." \ - "Finally, if the library is not provided, then SCHISM can use its internal" \ - "version of ParMETIS or the NO_PARMETIS option (OFF by default)." + # This block might need to be moved elsewhere in th build system + if [ -n "${USE_PAHM}" ]; then + USE_PAHM="$( getYesNo "${USE_PAHM}" )" + if [ -z "${USE_PAHM}" -o "${USE_PAHM}" == "no" ]; then + export USE_PAHM= + else + export USE_PAHM=ON + fi + + if [ -n "${NO_PARMETIS}" ]; then + NO_PARMETIS="$( getYesNo "${NO_PARMETIS}" )" + if [ -z "${NO_PARMETIS}" -o "${NO_PARMETIS}" == "no" ]; then + export NO_PARMETIS= + else + export NO_PARMETIS=ON + fi + + if [ -z "${NO_PARMETIS}" ]; then + if ! $( checkSUBSTR "${tmp_thirdparty}" PARMETIS ) && \ + [ -z "${PARMETIS_HOME}" ] && [ -z "${PARMETISHOME}" ]; then + procWarn "The PARMETIS library might be needed for the compilation of SCHISM." \ + "Please supply the PARMETIS_HOME or PARMETISHOME environment" \ + "variable that points to the location of the pre-compiled library or use the" \ + "--thirdparty="parmetis" option in the build.sh script to compile the" \ + "library from within CoastalApp (NOTE: need to download first the library" \ + "by running the download_parmetis.sh script found in the scripts directory." \ + "Finally, if the library is not provided, then SCHISM can use its internal" \ + "version of ParMETIS or the NO_PARMETIS option (OFF by default)." + fi fi fi @@ -1883,6 +1902,21 @@ installNems() { done fi ###### + + ###### Extra SCHISM files + if [ "${icmp}" == "SCHISM" ]; then + echo + echo " --- Installing from: ${icmp} to ${instdir} ---" + for iprog in ${APP_DIR}/SCHISM/build/bin/* + do + prog="${iprog}" + + if [ -n "${prog:+1}" ]; then + ${CPBIN} ${prog} ${instdir}/ + fi + done + fi + ###### done ###### Install the NEMS/exe/NEMS* files diff --git a/scripts/functions_utilities b/scripts/functions_utilities index c4a01cbe..ad48ad16 100644 --- a/scripts/functions_utilities +++ b/scripts/functions_utilities @@ -817,9 +817,9 @@ getYesNo() fi case "${param}" in - 1|y|yes|yea|yeah|yep) answer="yes" ;; - 0|n|no|not|nop|nope) answer="no" ;; - *) answer="" ;; # DEFAULT + 1|y|yes|yea|yeah|yep|on) answer="yes" ;; + 0|n|no|not|nop|nope|off) answer="no" ;; + *) answer="" ;; # DEFAULT esac echo -n "${answer}"