Skip to content

Commit b47afbc

Browse files
authored
Merge pull request #588 from sourceryinstitute/issue-#559-installer-updates
Issue #559 installer updates
2 parents 0b67734 + b7702c9 commit b47afbc

File tree

8 files changed

+49
-29
lines changed

8 files changed

+49
-29
lines changed

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ info "-U (--print-url): ${arg_U}"
169169
info "-v (--version): ${arg_v}"
170170
info "-V (--print-version): ${arg_V}"
171171
info "-y (--yes-to-all): ${arg_y}"
172-
info "-z (--disable-bootstrap):${arg_z}"
172+
info "-Z (--bootstrap): ${arg_Z}"
173173
}
174174
# This file is organized into three sections:
175175
# 1. Command-line argument and environment variable processing.

install.sh-usage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
-h --help Print this page.
1010
-i --install-prefix [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/${version_to_build:-}"
1111
-I --install-version [arg] Install package version (Example: -I 7.2.0).
12-
-j --num-threads [arg] Number of threads to use when invoking make (Example: -j 4). Default="1"
12+
-j --num-threads [arg] Number of threads to use when invoking make (Example: -j 8). Default="4"
1313
-l --list-packages Print packages this script can install.
1414
-m --with-cmake [arg] Use specified CMake installation (Example: -m /usr/local/bin/cmake).
1515
-M --with-mpi [arg] Use specified MPI installation (Examples: -M /usr/local/ or -m /opt/mpich-3.2/).
@@ -22,4 +22,4 @@
2222
-v --version Print OpenCoarrays version number.
2323
-V --print-version [arg] Print version number for specified package (Example: -V mpich).
2424
-y --yes-to-all Build non-interactively by assuming affirmative user responses.
25-
-z --disable-bootstrap Disabling bootstrap build of GCC for speed when a recent GCC is already installed.
25+
-Z --bootstrap Enable bootstrap build for robustness when building the required GCC version with an old GCC version.

prerequisites/build-functions/build_and_install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ build_and_install()
1616

1717
set_SUDO_if_needed_to_write_to_directory "${build_path}"
1818
set_SUDO_if_needed_to_write_to_directory "${install_path}"
19+
if [[ -d "${build_path}" ]]; then
20+
rm -rf "${build_path}"
21+
fi
1922
mkdir -p "${build_path}"
2023
info "pushd ${build_path}"
2124
pushd "${build_path}"

prerequisites/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ info "-l (--list-packages): ${arg_l} "
103103
info "-m (--with-cmake): ${arg_m} "
104104
info "-M (--with-mpi): ${arg_M} "
105105
info "-n (--no-color): ${arg_n} "
106-
info "-p (--package): ${arg_p}"
106+
info "-p (--package): ${arg_p} "
107107
info "-P (--print-path): ${arg_P} "
108108
info "-t (--with-tau): ${arg_t} "
109109
info "-u (--from-url): ${arg_u} "
110110
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} "
114+
info "-Z (--bootstrap): ${arg_Z} "
115115
}
116116

117117
if [[ -z "${arg_B}" ]]; then
@@ -148,8 +148,9 @@ if [[ ${arg_o:-} == "${__flag_present}" ]]; then
148148
exit 0
149149
fi
150150

151-
# If -z or --disable-bootstrap was specified, disable bootstrap configure & build
152-
if [[ ${arg_z:-} == "${__flag_present}" ]]; then
151+
# If -Z or --bootstrap was specified, enable bootstrap configure & build
152+
if [[ ${arg_Z:-} != "${__flag_present}" ]]; then
153+
info "Disabling bootstrap. If the gcc/g++/gfortran build fails, try './install.sh --bootstrap'."
153154
export bootstrap_configure="--disable-bootstrap"
154155
export bootstrap_build=""
155156
else

prerequisites/build.sh-usage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
-h --help This page.
1010
-i --install-prefix [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR%/}/prerequisites/installations/"
1111
-I --install-version [arg] Package version to install. (To see default, use -V or --print-version)
12-
-j --num-threads [arg] Number of threads to use when invoking make. Default="1"
12+
-j --num-threads [arg] Number of threads to use when invoking make. Default="4"
1313
-l --list-packages List the packages this script can install.
1414
-m --with-cmake [arg] Use the specified CMake installation. Default="cmake"
1515
-M --with-mpi [arg] Use the specified MPI installation.
@@ -24,4 +24,4 @@
2424
-v --version Print OpenCoarrays version number.
2525
-V --print-version [arg] Print installation version for package specified in argument.
2626
-y --yes-to-all Build non-interactively by assuming affirmative user responses.
27-
-z --disable-bootstrap Disabling bootstrap build of GCC for speed when a recent GCC is already installed.
27+
-Z --bootstrap Enable bootstrap build for robustness when building the required GCC version with an old GCC version.

prerequisites/install-functions/build_opencoarrays.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ build_opencoarrays()
88
info "Invoking find_or_install cmake"
99
find_or_install cmake
1010
build_path="${build_path}"/opencoarrays/$("${opencoarrays_src_dir}"/install.sh -V opencoarrays)
11+
if [[ -d "${build_path}" ]]; then
12+
rm -rf "${build_path}"
13+
fi
1114
mkdir -p "$build_path"
1215
pushd "$build_path"
1316
if [[ -z ${MPIFC:-} || -z ${MPICC:-} ]]; then

prerequisites/install-functions/find_or_install.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,13 @@ find_or_install()
599599
yes_to_all="-y"
600600
fi
601601

602+
if [[ "${arg_Z}" == "${__flag_present}" ]]; then
603+
bootstrap="-Z"
604+
fi
605+
602606
echo -e "$this_script: Downloading, building, and installing $package \n"
603-
echo "$this_script: Build command: FC=$FC CC=$CC CXX=$CXX ./build.sh -p $package -i $package_install_prefix -j $num_threads ${yes_to_all:-}"
604-
FC="$FC" CC="$CC" CXX="$CXX" ./build.sh -p "$package" -i "$package_install_prefix" -j "$num_threads" "${yes_to_all:-}"
607+
echo "$this_script: Build command: FC=$FC CC=$CC CXX=$CXX ./build.sh -p $package -i $package_install_prefix -j $num_threads ${yes_to_all:-} ${bootstrap:-}"
608+
FC="$FC" CC="$CC" CXX="$CXX" ./build.sh -p "$package" -i "$package_install_prefix" -j "$num_threads" "${yes_to_all:-}" "${bootstrap:-}"
605609

606610
if [[ -x "$package_install_path/bin/$executable" ]]; then
607611
echo -e "$this_script: Installation successful.\n"

prerequisites/install-functions/print_header.sh

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,39 @@ print_header() {
1010
m4ver="$("${__file}" -V m4)"
1111
popd >/dev/null
1212
clear
13-
echo ""
14-
echo "*** By default, building OpenCoarrays requires CMake ${cmakever} or later, ***"
15-
echo "*** MPICH ${mpichver}, and GCC Fortran (gfortran) ${gccver} or later. To see ***"
16-
echo "*** options for forcing the use of older or alternative packages, execute ***"
17-
echo "*** this script with the -h flag. This script will recursively traverse ***"
18-
echo "*** the following dependency tree, asking permission to download, build, ***"
19-
echo "*** and install any packages that are required for building another ***"
20-
echo "*** package and are neither in your PATH nor in ***"
21-
echo "*** opencoarrays/prerequisites/installations: ***"
13+
echo "__________ Please read these instructions carefully before proceeding. ___________"
14+
echo "__________________________________________________________________________________"
15+
echo "*** Most end users will find it easier to install OpenCoarrays via the native ***"
16+
echo "*** package manager for the target operating system. Advanced developers will ***"
17+
echo "*** find it best to install via CMake. Please see the OpenCoarrays README.md ***"
18+
echo "*** for a list of supported package installers or for instructions on using ***"
19+
echo "*** CMake to install. The current script offers a fallback when other methods ***"
20+
echo "*** prove infeasible. This script builds any missing prerequisites from source ***"
21+
echo "*** and then builds OpenCoarrays from source. The process might take a few ***"
22+
echo "*** minutes if the script finds all prerequisites or several hours if the ***"
23+
echo "*** script finds no prerequisites. (Run './install.sh --help' without quotes ***"
24+
echo "*** to see the installation options.) This script traverses the following ***"
25+
echo "*** dependency tree and asks permission to install packages that are not in ***"
26+
echo "*** your PATH, not in the prerequisites/installations subdirectory of the ***"
27+
echo "*** OpenCoarrays source tree, or have insufficiently recent version numbers: ***"
2228
echo ""
2329
# Generate the following text using the `tree` command w/ dummy directory structure
2430
cat <<-EOF
2531
opencoarrays
26-
├── cmake-${cmakever}
27-
└── mpich-${mpichver}
28-
└── gcc-${gccver}
29-
├── flex-${flexver}
30-
└── bison-${bisonver}
31-
└── m4-${m4ver}
32-
├── gmp
33-
├── mpc
34-
└── mpfr
32+
|__ cmake-${cmakever}
33+
|__ mpich-${mpichver}
34+
|__ gcc-${gccver}
35+
|__ flex-${flexver}
36+
| |__ bison-${bisonver}
37+
| |__ m4-${m4ver}
38+
|__ gmp
39+
|__ mpc
40+
|__ mpfr
3541
3642
EOF
43+
echo "*** For a non-interactive installation, relaunch this script with the command ***"
44+
echo "*** './install.sh --yes-to-all' without quotes to instruct the script to ***"
45+
echo "*** assume affirmative answers to all user queries. ***"
3746
echo ""
3847
printf "%s will be installed in %s\n" "${arg_p}" "${install_path}"
3948
echo ""

0 commit comments

Comments
 (0)