5
5
#
6
6
# - Build OpenCoarrays prerequisite packages and their prerequisites
7
7
#
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
9
9
#
10
10
# More info:
11
11
#
28
28
# (1) Import several bash3boilerplate helper functions & default settings.
29
29
# (2) Set several variables describing the current file and its usage page.
30
30
# (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.
32
32
33
33
34
34
export OPENCOARRAYS_SRC_DIR=" ${OPENCOARRAYS_SRC_DIR:- ${PWD} / ..} "
@@ -40,9 +40,10 @@ if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
40
40
fi
41
41
export B3B_USE_CASE=" ${B3B_USE_CASE:- ${OPENCOARRAYS_SRC_DIR} / prerequisites/ use-case} "
42
42
if [[ ! -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."
44
44
exit 2
45
45
fi
46
+ # shellcheck source=./use-case/bootstrap.sh
46
47
source " ${B3B_USE_CASE} /bootstrap.sh" " $@ "
47
48
48
49
@@ -59,13 +60,14 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
59
60
60
61
export __flag_present=1
61
62
63
+ # shellcheck disable=SC2154
62
64
if [[ " ${arg_l} " != " ${__flag_present} " && " ${arg_L} " != " ${__flag_present} " &&
63
65
" ${arg_v} " != " ${__flag_present} " && " ${arg_h} " != " ${__flag_present} " &&
64
66
-z " ${arg_D:- ${arg_p:- ${arg_P:- ${arg_U:- ${arg_V} } } } } " ]]; then
65
67
help " ${__base} : Insufficient arguments. Please pass either -D, -h, -l, -L, -p, -P, -U, -v, -V, or a longer equivalent."
66
68
fi
67
69
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:
69
71
[[ " ${arg_l} " == " ${__flag_present} " || ! -z " ${arg_P:- ${arg_U:- ${arg_V:- ${arg_D} } } } " ]] && suppress_info_debug_messages
70
72
71
73
[ -z " ${LOG_LEVEL:- } " ] && emergency " Cannot continue without LOG_LEVEL. "
75
77
[ ! -z " ${arg_P:- } " ] && [ ! -z " ${arg_U:- } " ] && emergency " Only specify one of -P, -U, -V, or their long-form equivalents."
76
78
[ ! -z " ${arg_U:- } " ] && [ ! -z " ${arg_V:- } " ] && emergency " Only specify one of -P, -U, -V, or their long-form equivalents."
77
79
78
- # ## Print bootstrapped magic variables to STDERR when LOG_LEVEL
80
+ # ## Print bootstrapped magic variables to STDERR when LOG_LEVEL
79
81
# ## is at the default value (6) or above.
80
82
# ####################################################################
81
-
83
+ # shellcheck disable=SC2154
84
+ {
82
85
info " __file: ${__file} "
83
86
info " __dir: ${__dir} "
84
87
info " __base: ${__base} "
@@ -87,8 +90,8 @@ info "__usage: ${__usage}"
87
90
info " LOG_LEVEL: ${LOG_LEVEL} "
88
91
89
92
info " -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} "
92
95
info " -d (--debug): ${arg_d} "
93
96
info " -D (--print-downloader): ${arg_D} "
94
97
info " -e (--verbose): ${arg_e} "
@@ -103,33 +106,41 @@ info "-m (--with-cmake): ${arg_m} "
103
106
info " -M (--with-mpi): ${arg_M} "
104
107
info " -n (--no-color): ${arg_n} "
105
108
info " -p (--package): ${arg_p} "
106
- info " -P (--print-path): ${arg_P} "
109
+ info " -P (--print-path): ${arg_P} "
107
110
info " -t (--with-tau): ${arg_t} "
108
111
info " -U (--print-url): ${arg_U} "
109
112
info " -v (--version): ${arg_v} "
110
113
info " -V (--print-version): ${arg_V} "
111
-
114
+ }
115
+ # shellcheck source=./build-functions/set_or_print_default_version.sh
112
116
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_default_version.sh"
113
117
set_or_print_default_version
114
118
export version_to_build=" ${arg_I:- ${default_version} } "
115
119
120
+ # shellcheck source=./build-functions/set_or_print_downloader.sh
116
121
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_downloader.sh"
117
122
set_or_print_downloader
118
123
124
+ # shellcheck source=./build-functions/set_or_print_url.sh
119
125
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_url.sh"
120
126
set_or_print_url
121
127
128
+ # shellcheck source=./build-functions/set_or_print_installation_path.sh
122
129
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_installation_path.sh"
123
130
set_or_print_installation_path
124
131
132
+ # shellcheck source=./build-functions/download_if_necessary.sh
125
133
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/download_if_necessary.sh"
126
134
download_if_necessary
127
135
136
+ # shellcheck source=./build-functions/unpack_if_necessary.sh
128
137
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/unpack_if_necessary.sh"
129
138
unpack_if_necessary
130
139
140
+ # shellcheck source=./build-functions/set_compilers.sh
131
141
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_compilers.sh"
132
142
set_compilers
133
143
144
+ # shellcheck source=./build-functions/build_and_install.sh
134
145
source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/build_and_install.sh"
135
146
build_and_install
0 commit comments