Skip to content

Commit 0dded25

Browse files
author
Damian Rouson
authored
Treat user-specified install prefix as full path (#213)
* Treat user-specified install prefix as full path previously subdirectories named after the package and version were appended to user-specified install prefixes so ./install.sh -p gcc -i /opt -I 6.1.0 would produce an installation directory named "/opt/gcc/6.1.0". This differs from how most packages interpret the install prefix and can result in redundancy if the user has already included such information in the -i argument. With this commmit, the bare user- -specified install prefix will be used with nothing appended. If no -i argument is present, the default still contains the package name and version: ${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/gcc/6.1.0) * Update MPICH-GCC bottle for Travis-CI testing See #65 (comment) for details
1 parent b1cffa7 commit 0dded25

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ env:
77
- MPICH_URL_HEAD="http://www.mpich.org/static/downloads/$MPICH_VER"
88
- MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
99
- MPICH_DIR="$HOME/.local/usr/mpich"
10-
- MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/303249/"
11-
- MPICH_BOT_URL_TAIL="mpich-3.2_1.yosemite.bottle.1.tar.gz"
10+
- MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/452136/"
11+
- MPICH_BOT_URL_TAIL="mpich-3.2_2.yosemite.bottle.1.tar.gz"
1212

1313
matrix:
1414
include:

install.sh-usage

Lines changed: 1 addition & 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.
99
-h --help Print this page.
10-
-i --install-prefix [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/"
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.
1212
-j --num-threads [arg] Number of threads to use when invoking make. Default="1"
1313
-l --list-packages Print packages this script can install.

prerequisites/build-functions/set_or_print_installation_path.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ 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-
install_path="${arg_i%/}/${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}/${version_to_build}"
10+
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}"
13+
else
14+
install_path="${arg_i%/}"
15+
fi
1116

1217
# If -P is present, print ${install_path} and exit with normal status
1318
if [[ ! -z "${arg_P:-}" ]]; then

prerequisites/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fi
124124
# shellcheck source=./build-functions/set_or_print_downloader.sh
125125
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_or_print_downloader.sh"
126126
# shellcheck disable=SC2119
127-
set_or_print_downloader
127+
set_or_print_downloader $@
128128

129129
# shellcheck source=./build-functions/set_or_print_url.sh
130130
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_or_print_url.sh"

0 commit comments

Comments
 (0)