Skip to content

Commit f7c52ba

Browse files
author
Damian Rouson
committed
download-all.sh/patched-trunk-install.sh on macOS
Both work on macOS without glitch with either curl or wget present
1 parent d6bb5f6 commit f7c52ba

File tree

3 files changed

+46
-29
lines changed

3 files changed

+46
-29
lines changed

developer-scripts/patched-trunk-install.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,33 @@ fi
142142

143143
# Ensure that the just-installed GCC libraries are used when linking
144144
echo "Setting and exporting LD_LIBRARY_PATH"
145-
if [[ -d "${PWD}/prerequisites/installations/gcc/trunk/lib64" ]]; then
145+
146+
function prepend_to_LD_LIBRARY_PATH() {
147+
: ${1?'set_LD_LIBRARY_PATH: missing path'}
148+
new_path="${1}"
146149
if [[ -z "${LD_LIBRARY_PATH:-}" ]]; then
147-
export LD_LIBRARY_PATH="${patched_GCC_install_path}/lib64/"
150+
export LD_LIBRARY_PATH="${new_path}"
148151
else
149-
export LD_LIBRARY_PATH="${patched_GCC_install_path}/lib64/:${LD_LIBRARY_PATH}"
152+
export LD_LIBRARY_PATH="${new_path}:${LD_LIBRARY_PATH}"
150153
fi
154+
}
155+
156+
old_path="${LD_LIBRARY_PATH:-}"
157+
158+
if [[ -d "${PWD}/prerequisites/installations/gcc/trunk/lib" ]]; then
159+
prepend_to_LD_LIBRARY_PATH "${patched_GCC_install_path}/lib/"
160+
fi
161+
162+
if [[ -d "${PWD}/prerequisites/installations/gcc/trunk/lib64" ]]; then
163+
prepend_to_LD_LIBRARY_PATH "${patched_GCC_install_path}/lib64/"
164+
fi
165+
166+
echo "\${LD_LIBRARY_PATH}=${LD_LIBRARY_PATH:=}"
167+
168+
if [[ "${LD_LIBRARY_PATH}" == "${old_path}" ]]; then
169+
echo "gfortran libraries did not install where expected: ${patched_GCC_install_path}/lib64 or ${patched_GCC_install_path}/lib"
170+
exit 1
151171
fi
152-
echo "\${LD_LIBRARY_PATH}=${LD_LIBRARY_PATH:-}"
153172

154173
# Build MPICH with the patched compilers.
155174
echo "Building MPICH with the patched compilers."
@@ -160,7 +179,7 @@ echo "Building MPICH with the patched compilers."
160179

161180
# Verify that MPICH installed where expected
162181
mpich_install_path=$(./install.sh -P mpich)
163-
if type ! "${mpich_install_path}"/bin/mpif90; then
182+
if ! type "${mpich_install_path}"/bin/mpif90; then
164183
echo "MPICH is not installed in the expected location ${mpich_install_path}."
165184
exit 1
166185
fi
@@ -171,5 +190,5 @@ echo "Building OpenCoarrays with the patched compilers"
171190
./install.sh --yes-to-all \
172191
--with-fortran "${patched_GCC_install_path}/bin/gfortran" \
173192
--with-c "${patched_GCC_install_path}/bin/gcc" \
174-
--with-C "${patched_GCC_install_path}/bin/g++"
193+
--with-C "${patched_GCC_install_path}/bin/g++" \
175194
--with-mpi "${mpich_install_path}"

prerequisites/download-all.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,9 @@ info "__os: ${__os}"
7272
info "__usage: ${__usage}"
7373
info "LOG_LEVEL: ${LOG_LEVEL}"
7474

75-
info "-b (--install-branch): ${arg_b} "
7675
info "-d (--debug): ${arg_d} "
7776
info "-e (--verbose): ${arg_e} "
7877
info "-h (--help): ${arg_h} "
79-
info "-l (--list-branches): ${arg_l} "
8078
}
8179

8280
download_list=( "m4" "bison" "flex" "mpich" "cmake" )
@@ -89,7 +87,7 @@ for package_to_download in "${download_list[@]}" ; do
8987
fi
9088
done
9189

92-
if [[ ! -z ${install_branch:-} ]]; then
90+
if [[ ! -z ${arg_b:-} ]]; then
9391
./install.sh --package gcc --only-download --install-branch "${arg_b}"
9492
else # Download default version
9593
./install.sh --package gcc --only-download

prerequisites/download-all.sh-usage

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
-b --install-branch [arg] Checkout the specified branch.
21
-d --debug Enable debug mode.
32
-e --verbose Enable verbose mode, print script as it is executed.
43
-h --help Print this page.
5-
-l --list-packages List the packages this script will download.
6-
-y --yes-to-all (not used )
7-
-B --list-branches [arg] (not used )
8-
-c --with-c [arg] (not used )
9-
-C --with-cxx [arg] (not used )
10-
-D --print-downloader [arg] (not used )
11-
-f --with-fortran [arg] (not used )
12-
-i --install-prefix [arg] (not used )
13-
-I --install-version [arg] (not used )
14-
-j --num-threads [arg] (not used )
15-
-m --with-cmake [arg] (not used )
16-
-M --with-mpi [arg] (not used )
17-
-n --no-color (not used )
18-
-o --only-download (not used )
19-
-p --package [arg] (not used )
20-
-P --print-path [arg] (not used )
21-
-U --print-url [arg] (not used )
22-
-v --version (not used )
23-
-V --print-version [arg] (not used )
4+
-l --list-branches (not used)
5+
-b --install-branch [arg] (not used)
6+
-y --yes-to-all (not used)
7+
-B --list-branches [arg] (not used)
8+
-c --with-c [arg] (not used)
9+
-C --with-cxx [arg] (not used)
10+
-D --print-downloader [arg] (not used)
11+
-f --with-fortran [arg] (not used)
12+
-i --install-prefix [arg] (not used)
13+
-I --install-version [arg] (not used)
14+
-j --num-threads [arg] (not used)
15+
-m --with-cmake [arg] (not used)
16+
-M --with-mpi [arg] (not used)
17+
-n --no-color (not used)
18+
-o --only-download (not used)
19+
-p --package [arg] (not used)
20+
-P --print-path [arg] (not used)
21+
-U --print-url [arg] (not used)
22+
-v --version (not used)
23+
-V --print-version [arg] (not used)

0 commit comments

Comments
 (0)