Skip to content

Commit 380dc01

Browse files
author
Damian Rouson
authored
Merge pull request #592 from sourceryinstitute/fix-#591-installer-updates
Fix #591 installer updates
2 parents b47afbc + dab2bfc commit 380dc01

File tree

9 files changed

+119
-73
lines changed

9 files changed

+119
-73
lines changed

install.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ info "-n (--no-color): ${arg_n}"
164164
info "-o (--only-download): ${arg_o}"
165165
info "-p (--package): ${arg_p}"
166166
info "-P (--print-path): ${arg_P}"
167+
info "-r (--prefix-root): ${arg_r}"
167168
info "-u (--from-url): ${arg_u}"
168169
info "-U (--print-url): ${arg_U}"
169170
info "-v (--version): ${arg_v}"
@@ -197,8 +198,8 @@ info "-Z (--bootstrap): ${arg_Z}"
197198
this_script="$(basename "$0")"
198199
export this_script
199200

200-
export install_path="${arg_i%/}"
201-
info "install_path=\"${install_path}\""
201+
export install_path=${arg_i%/}
202+
export prefix_root="${arg_r:-}"
202203

203204
export num_threads="${arg_j}"
204205
info "num_threads=\"${arg_j}\""
@@ -316,7 +317,12 @@ elif [[ "${arg_p:-}" == "opencoarrays" ]]; then
316317
# shellcheck source=./prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh
317318
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
318319
version="$("${opencoarrays_src_dir}/install.sh" -V opencoarrays)"
319-
set_SUDO_if_needed_to_write_to_directory "${install_path}"
320+
321+
if [[ -z "${prefix_root:-}" ]]; then
322+
set_SUDO_if_needed_to_write_to_directory "${install_path}"
323+
else
324+
set_SUDO_if_needed_to_write_to_directory "${prefix_root}"
325+
fi
320326

321327
if grep -s -q Microsoft /proc/version ; then
322328
info "Windows Subsystem for Linux detected. Invoking windows-install.sh with the following command:"

install.sh-usage

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-e --verbose Enable verbose mode, print script as it is executed.
88
-f --with-fortran [arg] Use specified Fortran compiler (Example: -f /usr/local/bin/gfortran).
99
-h --help Print this page.
10-
-i --install-prefix [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/${version_to_build:-}"
10+
-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).
1212
-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.
@@ -17,6 +17,7 @@
1717
-o --only-download Download (without building) the source for the package specified by -p or --package.
1818
-p --package [arg] Install specified package (Examples: -p gcc or -p mpich). Default="opencoarrays"
1919
-P --print-path [arg] Print installation directory for specified package (Example: -P gcc).
20+
-r --prefix-root [arg] Installation path to which package name/version will be appended. (Example: -r /opt).
2021
-u --from-url [arg] Specify a URL to use for downloading a package (Example: -u https://github.com/sourceryinstitute/gcc/archive/teams-rc3.tar.gz).
2122
-U --print-url [arg] Print download location for specified package (Example: -U gcc).
2223
-v --version Print OpenCoarrays version number.

prerequisites/acceptable_compiler.f90

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,19 @@
3535
program main
3636
use iso_fortran_env, only : compiler_version
3737
implicit none
38-
print *,(compiler_version() >= "GCC version 6.1.0 ")
38+
integer, parameter :: first_argument=1
39+
integer stat
40+
character(len=9) version_number
41+
call get_command_argument(first_argument,version_number,status=stat)
42+
select case(stat)
43+
case(-1)
44+
error stop "acceptable_compiler.f90: insufficient string length in attempt to read command argument"
45+
case(0)
46+
! successful command argument read
47+
case(1:)
48+
error stop "acceptable_compiler.f90: no version-number supplied"
49+
case default
50+
error stop "invalid status"
51+
end select
52+
print *,(compiler_version() >= "GCC version "//adjustl(trim(version_number))//" ")
3953
end program

prerequisites/build-functions/set_or_print_default_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set_or_print_default_version()
2727
# See http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash
2828
package_version=(
2929
"cmake:3.4.0"
30-
"gcc:7.3.0"
30+
"gcc:8.2.0"
3131
"mpich:3.2"
3232
"wget:1.16.3"
3333
"flex:2.6.0"

prerequisites/build-functions/set_or_print_installation_path.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@ set_or_print_installation_path()
77
[ ! -z "${arg_P}" ] && [ ! -z "${arg_p:-${arg_D:-${arg_U:-${arg_V}}}}" ] &&
88
emergency "Please pass only one of {-D, -p, -P, -U, -V} or a longer equivalent (multiple detected)."
99

10+
if [[ $arg_p == "opencoarrays" ]]; then
11+
export version_to_build=$(${OPENCOARRAYS_SRC_DIR}/install.sh -V opencoarrays)
12+
export package_name="opencoarrays"
13+
fi
1014
arg_i_default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/"
11-
if [[ "${arg_i:-}" == "${arg_i_default}" ]]; then
12-
install_path="${arg_i%/}/${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}/${version_to_build}"
15+
if [[ "${arg_i%/}" == "${arg_i_default}" ]]; then
16+
if [[ -z "${arg_r}" ]]; then
17+
export install_path="${arg_i%/}/${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}/${version_to_build}"
18+
else
19+
export install_path="${arg_r%/}/${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}/${version_to_build}"
20+
fi
1321
else
22+
[ ! -z "${arg_r}" ] &&
23+
emergency "Please pass only one of {-i,-r} or a longer equivalent (multiple detected). [exit 105]"
1424
install_path="${arg_i%/}"
1525
fi
1626

prerequisites/build.sh-usage

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
-o --only-download Download (without building) the package source specified by -p or --package.
1818
-p --package [arg] Package to install.
1919
-P --print-path [arg] Print installation path for package specified in argument.
20+
-r --prefix-root [arg] Installation path to which package name/version will be appended. (Example: -r /opt).
2021
-t --with-tau [arg] Use the specified TAU parallel performance utilities installation. Default="tauf90"
2122
-T --install-tau [arg] Install TAU in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/${version_to_build:-}/"
2223
-u --from-url [arg] Specify a URL from which to download a package.

prerequisites/install-functions/build_opencoarrays.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ build_opencoarrays()
3939
else
4040
MPIEXEC="${MPIEXEC_CANDIDATES[0]}"
4141
fi
42+
43+
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_or_print_installation_path.sh"
44+
set_or_print_installation_path
45+
4246
info "Configuring OpenCoarrays in ${PWD} with the command:"
4347
info "CC=\"${CC}\" FC=\"${FC}\" $CMAKE \"${opencoarrays_src_dir}\" \"${WDEVFLAG}\" -DCMAKE_INSTALL_PREFIX=\"${install_path}\" -DMPIEXEC=\"${MPIEXEC}\" -DMPI_C_COMPILER=\"${MPICC}\" -DMPI_Fortran_COMPILER=\"${MPIFC}\""
4448
CC="${CC}" FC="${FC}" $CMAKE "${opencoarrays_src_dir}" "${WDEVFLAG}" -DCMAKE_INSTALL_PREFIX="${install_path}" -DMPIEXEC="${MPIEXEC}" -DMPI_C_COMPILER="${MPICC}" -DMPI_Fortran_COMPILER="${MPIFC}"

0 commit comments

Comments
 (0)