Skip to content

Add install.sh/build.sh option --disable-bootstrap #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ info "-U (--print-url): ${arg_U}"
info "-v (--version): ${arg_v}"
info "-V (--print-version): ${arg_V}"
info "-y (--yes-to-all): ${arg_y}"
info "-z (--disable-bootstrap):${arg_z}"
}
# This file is organized into three sections:
# 1. Command-line argument and environment variable processing.
Expand Down Expand Up @@ -293,14 +294,14 @@ elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}" || "${arg_l}" =
elif [[ "${arg_p:-}" == "opencoarrays" ]]; then

if [[ "${arg_o}" == "${__flag_present}" ]]; then

# Download all prerequisites and exit
info "source ${OPENCOARRAYS_SRC_DIR}/prerequisites/install-functions/download-all-prerequisites.sh"
source "${OPENCOARRAYS_SRC_DIR}/prerequisites/install-functions/download-all-prerequisites.sh"
info "download_all_prerequisites"
download_all_prerequisites

else
else

# Install OpenCoarrays
cd prerequisites || exit 1
Expand All @@ -309,7 +310,7 @@ elif [[ "${arg_p:-}" == "opencoarrays" ]]; then
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
version="$("${opencoarrays_src_dir}/install.sh" -V opencoarrays)"
set_SUDO_if_needed_to_write_to_directory "${install_path}"

# Using process substitution "> >(...) -" instead of piping to tee via "2>&1 |" ensures that
# report_results gets the FC value set in build_opencoarrays
# Source: http://stackoverflow.com/questions/8221227/bash-variable-losing-its-value-strange
Expand Down
1 change: 1 addition & 0 deletions install.sh-usage
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
-v --version Print OpenCoarrays version number.
-V --print-version [arg] Print version number for specified package.
-y --yes-to-all Build non-interactively by assuming affirmative user responses.
-z --disable-bootstrap Disabling bootstrap build of GCC for speed when a recent GCC is already installed.
13 changes: 7 additions & 6 deletions prerequisites/build-functions/build_and_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source "${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/edit_GCC_download_

build_and_install()
{

num_threads=${arg_j}
build_path="${OPENCOARRAYS_SRC_DIR}/prerequisites/builds/${package_to_build}-${version_to_build}"

Expand Down Expand Up @@ -52,17 +53,17 @@ build_and_install()

# Switch download mechanism, if wget is not available
edit_GCC_download_prereqs_file_if_necessary

# Download GCC prerequisities
"${PWD}"/contrib/download_prerequisites

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

fi # end if [[ "${package_to_build}" != "gcc" ]]; then

info "popd"
popd
}
12 changes: 11 additions & 1 deletion prerequisites/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ info "-U (--print-url): ${arg_U} "
info "-v (--version): ${arg_v} "
info "-V (--print-version): ${arg_V} "
info "-y (--yes-to-all): ${arg_y} "
info "-z (--disable-bootstrap):${arg_z} "
}

if [[ -z "${arg_B}" ]]; then
Expand Down Expand Up @@ -147,6 +148,15 @@ if [[ ${arg_o:-} == "${__flag_present}" ]]; then
exit 0
fi

# If -z or --disable-bootstrap was specified, disable bootstrap configure & build
if [[ ${arg_z:-} == "${__flag_present}" ]]; then
export bootstrap_configure="--disable-bootstrap"
export bootstrap_build=""
else
export bootstrap_configure=""
export bootstrap_build="bootstrap"
fi

if [[ -z "${arg_B}" ]]; then
# shellcheck source=./build-functions/unpack_if_necessary.sh
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/unpack_if_necessary.sh"
Expand All @@ -155,7 +165,7 @@ if [[ -z "${arg_B}" ]]; then
# shellcheck source=./build-functions/set_compilers.sh
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_compilers.sh"
set_compilers

# shellcheck source=./build-functions/build_and_install.sh
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/build_and_install.sh"
build_and_install
Expand Down
1 change: 1 addition & 0 deletions prerequisites/build.sh-usage
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
-v --version Print OpenCoarrays version number.
-V --print-version [arg] Print installation version for package specified in argument.
-y --yes-to-all Build non-interactively by assuming affirmative user responses.
-z --disable-bootstrap Disabling bootstrap build of GCC for speed when a recent GCC is already installed.