Skip to content

Commit 8977be3

Browse files
authored
Merge pull request #410 from sourceryinstitute/add-disable-bootstrap
Add install.sh/build.sh option --disable-bootstrap
2 parents cb85018 + 3163116 commit 8977be3

File tree

5 files changed

+24
-10
lines changed

5 files changed

+24
-10
lines changed

install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ info "-U (--print-url): ${arg_U}"
168168
info "-v (--version): ${arg_v}"
169169
info "-V (--print-version): ${arg_V}"
170170
info "-y (--yes-to-all): ${arg_y}"
171+
info "-z (--disable-bootstrap):${arg_z}"
171172
}
172173
# This file is organized into three sections:
173174
# 1. Command-line argument and environment variable processing.
@@ -293,14 +294,14 @@ elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}" || "${arg_l}" =
293294
elif [[ "${arg_p:-}" == "opencoarrays" ]]; then
294295

295296
if [[ "${arg_o}" == "${__flag_present}" ]]; then
296-
297+
297298
# Download all prerequisites and exit
298299
info "source ${OPENCOARRAYS_SRC_DIR}/prerequisites/install-functions/download-all-prerequisites.sh"
299300
source "${OPENCOARRAYS_SRC_DIR}/prerequisites/install-functions/download-all-prerequisites.sh"
300301
info "download_all_prerequisites"
301302
download_all_prerequisites
302303

303-
else
304+
else
304305

305306
# Install OpenCoarrays
306307
cd prerequisites || exit 1
@@ -309,7 +310,7 @@ elif [[ "${arg_p:-}" == "opencoarrays" ]]; then
309310
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
310311
version="$("${opencoarrays_src_dir}/install.sh" -V opencoarrays)"
311312
set_SUDO_if_needed_to_write_to_directory "${install_path}"
312-
313+
313314
# Using process substitution "> >(...) -" instead of piping to tee via "2>&1 |" ensures that
314315
# report_results gets the FC value set in build_opencoarrays
315316
# Source: http://stackoverflow.com/questions/8221227/bash-variable-losing-its-value-strange

install.sh-usage

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
-v --version Print OpenCoarrays version number.
2222
-V --print-version [arg] Print version number for specified package.
2323
-y --yes-to-all Build non-interactively by assuming affirmative user responses.
24+
-z --disable-bootstrap Disabling bootstrap build of GCC for speed when a recent GCC is already installed.

prerequisites/build-functions/build_and_install.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ source "${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/edit_GCC_download_
66

77
build_and_install()
88
{
9+
910
num_threads=${arg_j}
1011
build_path="${OPENCOARRAYS_SRC_DIR}/prerequisites/builds/${package_to_build}-${version_to_build}"
1112

@@ -52,17 +53,17 @@ build_and_install()
5253

5354
# Switch download mechanism, if wget is not available
5455
edit_GCC_download_prereqs_file_if_necessary
55-
56+
5657
# Download GCC prerequisities
5758
"${PWD}"/contrib/download_prerequisites
5859

5960
info "popd"
6061
popd
6162
info "Configuring gcc/g++/gfortran builds with the following command:"
62-
info "${download_path}/${package_source_directory}/configure --prefix=${install_path} --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror"
63-
"${download_path}/${package_source_directory}/configure" --prefix="${install_path}" --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror
64-
info "Building with the following command: 'make -j${num_threads} bootstrap'"
65-
make "-j${num_threads}" bootstrap
63+
info "${download_path}/${package_source_directory}/configure --prefix=${install_path} --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror ${bootstrap_configure}"
64+
"${download_path}/${package_source_directory}/configure" --prefix="${install_path}" --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror ${bootstrap_configure}
65+
info "Building with the following command: 'make -j${num_threads} ${bootstrap_build}'"
66+
make "-j${num_threads}" ${bootstrap_build}
6667
if [[ ! -z "${SUDO:-}" ]]; then
6768
info "You do not have write permissions to the installation path ${install_path}"
6869
info "If you have administrative privileges, enter your password to install ${package_to_build}"
@@ -71,7 +72,7 @@ build_and_install()
7172
${SUDO:-} make install
7273

7374
fi # end if [[ "${package_to_build}" != "gcc" ]]; then
74-
75+
7576
info "popd"
7677
popd
7778
}

prerequisites/build.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ info "-U (--print-url): ${arg_U} "
111111
info "-v (--version): ${arg_v} "
112112
info "-V (--print-version): ${arg_V} "
113113
info "-y (--yes-to-all): ${arg_y} "
114+
info "-z (--disable-bootstrap):${arg_z} "
114115
}
115116

116117
if [[ -z "${arg_B}" ]]; then
@@ -147,6 +148,15 @@ if [[ ${arg_o:-} == "${__flag_present}" ]]; then
147148
exit 0
148149
fi
149150

151+
# If -z or --disable-bootstrap was specified, disable bootstrap configure & build
152+
if [[ ${arg_z:-} == "${__flag_present}" ]]; then
153+
export bootstrap_configure="--disable-bootstrap"
154+
export bootstrap_build=""
155+
else
156+
export bootstrap_configure=""
157+
export bootstrap_build="bootstrap"
158+
fi
159+
150160
if [[ -z "${arg_B}" ]]; then
151161
# shellcheck source=./build-functions/unpack_if_necessary.sh
152162
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/unpack_if_necessary.sh"
@@ -155,7 +165,7 @@ if [[ -z "${arg_B}" ]]; then
155165
# shellcheck source=./build-functions/set_compilers.sh
156166
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_compilers.sh"
157167
set_compilers
158-
168+
159169
# shellcheck source=./build-functions/build_and_install.sh
160170
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/build_and_install.sh"
161171
build_and_install

prerequisites/build.sh-usage

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
-v --version Print OpenCoarrays version number.
2424
-V --print-version [arg] Print installation version for package specified in argument.
2525
-y --yes-to-all Build non-interactively by assuming affirmative user responses.
26+
-z --disable-bootstrap Disabling bootstrap build of GCC for speed when a recent GCC is already installed.

0 commit comments

Comments
 (0)