Skip to content

Commit 91a1488

Browse files
author
Damian Rouson
committed
./install.sh --only-download now downloads all prerequisites
1 parent b3a0f5f commit 91a1488

File tree

4 files changed

+57
-142
lines changed

4 files changed

+57
-142
lines changed

install.sh

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,31 @@ elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}" || "${arg_l}" =
288288
fi
289289

290290
elif [[ "${arg_p:-}" == "opencoarrays" ]]; then
291+
292+
if [[ "${arg_o}" == "${__flag_present}" ]]; then
293+
294+
# Download all prerequisites and exit
295+
info "source ${OPENCOARRAYS_SRC_DIR}/prerequisites/install-functions/download-all-prerequisites.sh"
296+
source "${OPENCOARRAYS_SRC_DIR}/prerequisites/install-functions/download-all-prerequisites.sh"
297+
info "download_all_prerequisites"
298+
download_all_prerequisites
299+
300+
else
301+
302+
# Install OpenCoarrays
303+
cd prerequisites || exit 1
304+
installation_record=install-opencoarrays.log
305+
# shellcheck source=./prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh
306+
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
307+
version="$("${opencoarrays_src_dir}/install.sh" -V opencoarrays)"
308+
set_SUDO_if_needed_to_write_to_directory "${install_path}"
291309

292-
cd prerequisites || exit 1
293-
installation_record=install-opencoarrays.log
294-
# shellcheck source=./prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh
295-
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
296-
version="$("${opencoarrays_src_dir}/install.sh" -V opencoarrays)"
297-
set_SUDO_if_needed_to_write_to_directory "${install_path}"
298-
299-
# Using process substitution "> >(...) -" instead of piping to tee via "2>&1 |" ensures that
300-
# report_results gets the FC value set in build_opencoarrays
301-
# Source: http://stackoverflow.com/questions/8221227/bash-variable-losing-its-value-strange
302-
build_opencoarrays > >( tee ../"${installation_record}" ) -
303-
report_results 2>&1 | tee -a ../"${installation_record}"
310+
# Using process substitution "> >(...) -" instead of piping to tee via "2>&1 |" ensures that
311+
# report_results gets the FC value set in build_opencoarrays
312+
# Source: http://stackoverflow.com/questions/8221227/bash-variable-losing-its-value-strange
313+
build_opencoarrays > >( tee ../"${installation_record}" ) -
314+
report_results 2>&1 | tee -a ../"${installation_record}"
315+
fi
304316

305317
elif [[ "${arg_p:-}" == "ofp" ]]; then
306318

@@ -316,4 +328,3 @@ elif [[ ! -z "${arg_p:-}" ]]; then
316328

317329
fi
318330
# ____________________________________ End of Main Body ____________________________________________
319-

prerequisites/download-all.sh

Lines changed: 0 additions & 106 deletions
This file was deleted.

prerequisites/download-all.sh-usage

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
function download_all_prerequisites()
2+
{
3+
pushd ${OPENCOARRAYS_SRC_DIR}
4+
5+
download_list=( "m4" "bison" "flex" "mpich" "cmake" )
6+
7+
for package_to_download in "${download_list[@]}" ;
8+
do
9+
./install.sh --package ${package_to_download} --only-download
10+
done
11+
12+
if [[ ! -z ${arg_b:-} ]]; then
13+
./install.sh --package gcc --only-download --install-branch "${arg_b}"
14+
cd prerequisites/downloads/${arg_b:-}
15+
else # Download default version
16+
./install.sh --package gcc --only-download
17+
gcc_version=$(./install.sh -V gcc)
18+
cd prerequisites/downloads/
19+
tar xf gcc-${gcc_version}.tar.bz2 || emergency "tar didn't work"
20+
listing=$(ls -lt)
21+
cd gcc-${gcc_version}
22+
fi
23+
24+
source ${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/set_or_print_downloader.sh
25+
set_or_print_downloader
26+
27+
source ${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/edit_GCC_download_prereqs_file_if_necessary.sh
28+
edit_GCC_download_prereqs_file_if_necessary
29+
30+
./contrib/download_prerequisites
31+
32+
popd
33+
}

0 commit comments

Comments
 (0)