Skip to content

Commit 12e0792

Browse files
committed
--with-* overrules default install.sh behavior
1 parent d753b76 commit 12e0792

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ info "-V (--print-version): ${arg_V}"
188188
this_script="$(basename "$0")"
189189
export this_script
190190

191-
export install_path="${arg_i}/${arg_p}"
192-
info "install_path=${arg_i}/${arg_p}"
191+
export install_path="${arg_i}"
192+
info "install_path=${arg_i}"
193193

194194
export num_threads="${arg_j}"
195195
info "num_threads=${arg_j}"

prerequisites/build-functions/download_if_necessary.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# shellcheck source=./ftp-url.sh
2-
source "${opencoarrays_src_dir}/prerequisites/build-functions/ftp-url.sh"
2+
source "${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/ftp-url.sh"
33
# shellcheck source=./set_SUDO_if_needed_to_write_to_directory.sh
4-
source "${opencoarrays_src_dir}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
4+
source "${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
55

66
# Download pkg-config if the tar ball is not already in the present working directory
77
# shellcheck disable=SC2154
88
download_if_necessary()
99
{
10-
download_path="${opencoarrays_src_dir}/prerequisites/downloads"
10+
download_path="${OPENCOARRAYS_SRC_DIR}/prerequisites/downloads"
1111
set_SUDO_if_needed_to_write_to_directory "${download_path}"
1212
if [[ -f "${download_path}/${url_tail}" || -d "${download_path}/${url_tail}" ]] ; then
1313
info "Found '${url_tail}' in ${download_path}."

prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set_SUDO_if_needed_to_write_to_directory()
99
if [[ -z "${LD_LIBRARY_PATH:-}" ]]; then
1010
info "\${LD_LIBRARY_PATH} is empty. Try setting it if the compiler encounters linking problems."
1111
fi
12-
SUDO_COMMAND="sudo env LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-""}"
12+
SUDO_COMMAND="sudo env LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-} PATH=${PATH:-}"
1313
info "Checking whether the directory ${directory_to_create} exists... "
1414
if [[ -d "${directory_to_create}" ]]; then
1515
info "yes"

prerequisites/install-functions/find_or_install.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,18 @@ find_or_install()
134134
stack_push dependency_path "none" "$(./build.sh -P "$package")" "$(./build.sh -P gcc)"
135135
else
136136
printf "yes.\n"
137+
137138
echo -e "$this_script: Checking whether $executable in PATH wraps gfortran version `./build.sh -V gcc` or later... "
138139
$executable acceptable_compiler.f90 -o acceptable_compiler
139140
$executable print_true.f90 -o print_true
140141
acceptable=$(./acceptable_compiler)
141142
is_true=$(./print_true)
142143
rm acceptable_compiler print_true
144+
145+
[ "$acceptable" == "$is_true" ] && printf "yes.\n"
146+
[ ! -z "${arg_f}" ] && printf "no.\n Default compiler installation overridden by --with-fortran/-f=${arg_f}\n"
143147

144-
if [[ "$acceptable" == "$is_true" ]]; then
145-
printf "yes.\n"
148+
if [[ "$acceptable" == "$is_true" || ! -z "${arg_f}" ]]; then
146149
echo -e "$this_script: Using the $executable found in the PATH.\n"
147150
export MPIFC=mpif90
148151
export MPICC=mpicc

0 commit comments

Comments
 (0)