55#
66# - Build OpenCoarrays prerequisite packages and their prerequisites
77#
8- # Usage: LOG_LEVEL=7 B3B_USE_CASE=/opt/bash3boilerplate/src/use-case ./my-script.sh -f script_input.txt
8+ # Usage: LOG_LEVEL=7 B3B_USE_CASE=/opt/bash3boilerplate/src/use-case ./my-script.sh -f script_input.txt
99#
1010# More info:
1111#
2828# (1) Import several bash3boilerplate helper functions & default settings.
2929# (2) Set several variables describing the current file and its usage page.
3030# (3) Parse the usage information (default usage file name: current file's name with -usage appended).
31- # (4) Parse the command line using the usage information.
31+ # (4) Parse the command line using the usage information.
3232
3333
3434export OPENCOARRAYS_SRC_DIR=" ${OPENCOARRAYS_SRC_DIR:- ${PWD} / ..} "
@@ -40,9 +40,10 @@ if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
4040fi
4141export B3B_USE_CASE=" ${B3B_USE_CASE:- ${OPENCOARRAYS_SRC_DIR} / prerequisites/ use-case} "
4242if [[ ! -f " ${B3B_USE_CASE:- } /bootstrap.sh" ]]; then
43- echo " Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
43+ echo " Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
4444 exit 2
4545fi
46+ # shellcheck source=./use-case/bootstrap.sh
4647source " ${B3B_USE_CASE} /bootstrap.sh" " $@ "
4748
4849
@@ -59,13 +60,14 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
5960
6061export __flag_present=1
6162
63+ # shellcheck disable=SC2154
6264if [[ " ${arg_l} " != " ${__flag_present} " && " ${arg_L} " != " ${__flag_present} " &&
6365 " ${arg_v} " != " ${__flag_present} " && " ${arg_h} " != " ${__flag_present} " &&
6466 -z " ${arg_D:- ${arg_p:- ${arg_P:- ${arg_U:- ${arg_V} } } } } " ]]; then
6567 help " ${__base} : Insufficient arguments. Please pass either -D, -h, -l, -L, -p, -P, -U, -v, -V, or a longer equivalent."
6668fi
6769
68- # Suppress info and debug messages if -l, -P, -U, -V, -D, or their longer equivalent is present:
70+ # Suppress info and debug messages if -l, -P, -U, -V, -D, or their longer equivalent is present:
6971[[ " ${arg_l} " == " ${__flag_present} " || ! -z " ${arg_P:- ${arg_U:- ${arg_V:- ${arg_D} } } } " ]] && suppress_info_debug_messages
7072
7173[ -z " ${LOG_LEVEL:- } " ] && emergency " Cannot continue without LOG_LEVEL. "
7577[ ! -z " ${arg_P:- } " ] && [ ! -z " ${arg_U:- } " ] && emergency " Only specify one of -P, -U, -V, or their long-form equivalents."
7678[ ! -z " ${arg_U:- } " ] && [ ! -z " ${arg_V:- } " ] && emergency " Only specify one of -P, -U, -V, or their long-form equivalents."
7779
78- # ## Print bootstrapped magic variables to STDERR when LOG_LEVEL
80+ # ## Print bootstrapped magic variables to STDERR when LOG_LEVEL
7981# ## is at the default value (6) or above.
8082# ####################################################################
81-
83+ # shellcheck disable=SC2154
84+ {
8285info " __file: ${__file} "
8386info " __dir: ${__dir} "
8487info " __base: ${__base} "
@@ -87,8 +90,8 @@ info "__usage: ${__usage}"
8790info " LOG_LEVEL: ${LOG_LEVEL} "
8891
8992info " -b (--branch): ${arg_b} "
90- info " -c (--with-c): ${arg_c} "
91- info " -C (--with-cpp): ${arg_C} "
93+ info " -c (--with-c): ${arg_c} "
94+ info " -C (--with-cpp): ${arg_C} "
9295info " -d (--debug): ${arg_d} "
9396info " -D (--print-downloader): ${arg_D} "
9497info " -e (--verbose): ${arg_e} "
@@ -103,33 +106,41 @@ info "-m (--with-cmake): ${arg_m} "
103106info " -M (--with-mpi): ${arg_M} "
104107info " -n (--no-color): ${arg_n} "
105108info " -p (--package): ${arg_p} "
106- info " -P (--print-path): ${arg_P} "
109+ info " -P (--print-path): ${arg_P} "
107110info " -t (--with-tau): ${arg_t} "
108111info " -U (--print-url): ${arg_U} "
109112info " -v (--version): ${arg_v} "
110113info " -V (--print-version): ${arg_V} "
111-
114+ }
115+ # shellcheck source=./build-functions/set_or_print_default_version.sh
112116source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_default_version.sh"
113117set_or_print_default_version
114118export version_to_build=" ${arg_I:- ${default_version} } "
115119
120+ # shellcheck source=./build-functions/set_or_print_downloader.sh
116121source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_downloader.sh"
117122set_or_print_downloader
118123
124+ # shellcheck source=./build-functions/set_or_print_url.sh
119125source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_url.sh"
120126set_or_print_url
121127
128+ # shellcheck source=./build-functions/set_or_print_installation_path.sh
122129source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_installation_path.sh"
123130set_or_print_installation_path
124131
132+ # shellcheck source=./build-functions/download_if_necessary.sh
125133source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/download_if_necessary.sh"
126134download_if_necessary
127135
136+ # shellcheck source=./build-functions/unpack_if_necessary.sh
128137source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/unpack_if_necessary.sh"
129138unpack_if_necessary
130139
140+ # shellcheck source=./build-functions/set_compilers.sh
131141source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_compilers.sh"
132142set_compilers
133143
144+ # shellcheck source=./build-functions/build_and_install.sh
134145source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/build_and_install.sh"
135146build_and_install
0 commit comments