@@ -109,12 +109,12 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
109109# ## Validation (decide what's required for running your script and error out)
110110# ####################################################################
111111
112- [ -z " ${LOG_LEVEL:- } " ] && emergency " Cannot continue without LOG_LEVEL. "
112+ [[ -z " ${LOG_LEVEL:- } " ] ] && emergency " Cannot continue without LOG_LEVEL. "
113113
114114# shellcheck disable=SC2154
115- if [[ " ${arg_d} " == " ${__flag_present} " ]]; then
115+ if [[ " ${arg_d} " == " ${__flag_present} " ]]; then
116116 print_debug_only=7
117- if [ " $(( LOG_LEVEL < print_debug_only )) " -ne 0 ]; then
117+ if [[ " $(( LOG_LEVEL < print_debug_only )) " -ne 0 ] ]; then
118118 debug " Supressing info and debug messages: one of {-l, -v, -P, -U, -V, -D} present."
119119 suppress_info_debug_messages
120120 fi
@@ -145,7 +145,7 @@ info "-V (--version-number): ${arg_V}"
145145
146146# __________ Process command-line arguments and environment variables _____________
147147
148- this_script=" $( basename " $0 " ) "
148+ this_script=" $( basename " ${0} " ) "
149149export this_script
150150debug " this_script=\" ${this_script} \" "
151151
@@ -157,7 +157,7 @@ info "num_threads=\"${arg_j}\""
157157
158158opencoarrays_version=$( sed -n ' /[0-9]\{1,\}\(\.[0-9]\{1,\}\)\{1,\}/{s/^\([^.]*\)\([0-9]\{1,\}\(\.[0-9]\{1,\}\)\{1,\}\)\(.*\)/\2/p;q;}' " ${OPENCOARRAYS_SRC_DIR%/ } /.VERSION" )
159159
160- export build_path=" ${OPENCOARRAYS_SRC_DIR%/ } " /prerequisites/builds/opencoarrays/$opencoarrays_version
160+ export build_path=" ${OPENCOARRAYS_SRC_DIR%/ } " /prerequisites/builds/opencoarrays/${ opencoarrays_version}
161161info " build_path=\" ${build_path} \" "
162162
163163export CMAKE=" ${arg_m:- cmake} "
@@ -188,10 +188,10 @@ verify_acceptable_release_number()
188188 major_release=" ${release_number%% .* } "
189189 minor_release=" ${release_number##* .} "
190190 info " Release: ${major_release} .${minor_release} "
191- if [[ $major_release -lt 16 ]]; then
191+ if [[ ${ major_release} -lt 16 ]]; then
192192 emergency " Please upgrade to Windows Subsystem for Linux (WSL) Ubuntu 16.04 or later."
193- elif [[ $major_release -eq 16 ]]; then
194- if [[ $minor_release -lt " 04" ]]; then
193+ elif [[ ${ major_release} -eq 16 ]]; then
194+ if [[ ${ minor_release} -lt " 04" ]]; then
195195 emergency " Please upgrade to Windows Subsystem for Linux (WSL) Ubuntu 16.04 or later."
196196 fi
197197 fi
@@ -200,7 +200,7 @@ verify_acceptable_release_number
200200
201201if [[ " ${arg_V} " == " ${__flag_present} " ]]; then
202202 # Print just the version number
203- info " $opencoarrays_version "
203+ info " ${ opencoarrays_version} "
204204
205205elif [[ " ${arg_v} " == " ${__flag_present} " ]]; then
206206
@@ -221,19 +221,19 @@ else
221221 export FC=${arg_f:- gfortran}
222222 export CC=${arg_c:- gcc}
223223 export CXX=${arg_C:- g++}
224-
224+
225225 # Check for and, if necessary, install OpenCoarrays prerequisites
226226
227- if ! type " $CMAKE " >& /dev/null; then
227+ if ! type " ${ CMAKE} " >& /dev/null; then
228228 sudo apt-get install cmake
229229 fi
230- if ! type " $CXX " >& /dev/null; then
230+ if ! type " ${ CXX} " >& /dev/null; then
231231 sudo apt-get install g++
232232 fi
233- if ! type " $FC " >& /dev/null; then
233+ if ! type " ${FC} " >& /dev/null; then
234234 sudo apt-get install gfortran
235235 fi
236-
236+
237237 if ! type mpifort >& /dev/null; then
238238 sudo apt-get install mpich
239239 fi
@@ -265,31 +265,31 @@ else
265265
266266 # Install OpenCoarrays
267267
268- if [[ -d " $build_path " ]]; then
269- rm -rf " $build_path "
268+ if [[ -d " ${ build_path} " ]]; then
269+ rm -rf " ${ build_path} "
270270 fi
271- mkdir -p " $build_path "
272- cd " $build_path " || exit 25
271+ mkdir -p " ${ build_path} "
272+ cd " ${ build_path} " || exit 25
273273 info " Configuring OpenCoarrays with the following command:"
274- info " FC=\" $FC \" CC=\" $CC \" \" $CMAKE \" \" $OPENCOARRAYS_SRC_DIR \" -DCMAKE_INSTALL_PREFIX=\" $install_prefix \" "
275- FC=" $FC " CC=" $CC " " $CMAKE " " $OPENCOARRAYS_SRC_DIR " -DCMAKE_INSTALL_PREFIX=" $install_prefix "
274+ info " FC=\" ${FC} \" CC=\" ${CC} \" \" ${ CMAKE} \" \" ${ OPENCOARRAYS_SRC_DIR} \" -DCMAKE_INSTALL_PREFIX=\" ${ install_prefix} \" "
275+ FC=" ${FC} " CC=" ${CC} " " ${ CMAKE} " " ${ OPENCOARRAYS_SRC_DIR} " -DCMAKE_INSTALL_PREFIX=" ${ install_prefix} "
276276 info " Building OpenCoarrays with the following command:"
277- info " make -j $arg_j "
277+ info " make -j ${ arg_j} "
278278 make -j " ${arg_j} "
279279 info " Installing OpenCoarrays with the following command:"
280280 info " ${SUDO:- } make install"
281281 ${SUDO:- } make install
282- if [[ -f " $install_prefix " /lib/libcaf_mpi.a && -f " ${install_prefix} /bin/caf" && -f " ${install_prefix} /bin/cafrun" ]]; then
282+ if [[ -f " ${ install_prefix} " /lib/libcaf_mpi.a && -f " ${install_prefix} /bin/caf" && -f " ${install_prefix} /bin/cafrun" ]]; then
283283 info " OpenCoarrays has been installed in"
284- info " $install_prefix "
284+ info " ${ install_prefix} "
285285 else
286286 info " Something went wrong. OpenCoarrays is not in the expected location:"
287- emergency " $install_prefix "
287+ emergency " ${ install_prefix} "
288288 fi
289289 # See http://stackoverflow.com/questions/31057694/gethostbyname-fail-after-switching-internet-connections/31222970
290290 loopback_line=$( grep " ${NAME} " /etc/hosts)
291291 if [[ -z " ${loopback_line:- } " ]]; then
292292 info " To ensure the correct functioning of MPI, please add the following line to your /etc/hosts file:"
293- info " 127.0.0.1 $NAME "
293+ info " 127.0.0.1 ${ NAME} "
294294 fi
295295fi
0 commit comments