Skip to content

Commit 5f7c5a1

Browse files
Damian Rousonzbeekman
authored andcommitted
Fixed start-up of install-ofp.sh; adjusted args
1 parent 2addcb4 commit 5f7c5a1

File tree

2 files changed

+31
-30
lines changed

2 files changed

+31
-30
lines changed

prerequisites/install-ofp.sh

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22
# BASH3 Boilerplate
33
#
4-
# install-binary.sh
4+
# install-ofp.sh
55
#
6-
# - Build OpenCoarrays prerequisite packages and their prerequisites
6+
# - Build the Open Fortran Parser
77
#
8-
# Usage: LOG_LEVEL=7 B3B_USE_CASE=/opt/bash3boilerplate/src/use-case ./install-opfp.sh
8+
# Usage: ./install-ofp.sh -i /opt
99
#
1010
# More info:
1111
#
@@ -28,25 +28,21 @@
2828
# (1) Import several bash3boilerplate helper functions & default settings.
2929
# (2) Set several variables describing the current file and its usage page.
3030
# (3) Parse the usage information (default usage file name: current file's name with -usage appended).
31-
# (4) Parse the command line using the usage information.
32-
33-
export __usage="${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh-usage"
31+
# (4) Parse the command line using the usage information.
3432

3533
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD}/..}"
34+
export __usage="${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh-usage"
3635
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
37-
echo "Please run this script inside the OpenCoarrays "prerequisites" subdirectory "
38-
echo "or set OPENCOARRAYS_SRC_DIR to the OpenCoarrays source directory path."
36+
echo "Please run this script inside the OpenCoarrays source \"prerequisites\" subdirectory"
37+
echo "or set OPENCOARRAYS_SRC_DIR to the top-level OpenCoarrays source directory path."
3938
exit 1
4039
fi
41-
42-
### Import bash3boilerplate functionality
4340
export B3B_USE_CASE="${B3B_USE_CASE:-${OPENCOARRAYS_SRC_DIR}/prerequisites/use-case}"
4441
if [[ ! -f "${B3B_USE_CASE:-}/bootstrap.sh" ]]; then
45-
echo "Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
42+
echo "Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
4643
exit 2
47-
else
48-
source "${B3B_USE_CASE}/bootstrap.sh" "$@"
4944
fi
45+
source "${B3B_USE_CASE}/bootstrap.sh" "$@"
5046

5147
# Set up a function to call when receiving an EXIT signal to do some cleanup. Remove if
5248
# not needed. Other signals can be trapped too, like SIGINT and SIGTERM.
@@ -115,14 +111,17 @@ info "__os: ${__os}"
115111
info "__usage: ${__usage}"
116112
info "LOG_LEVEL: ${LOG_LEVEL}"
117113

118-
info "-d (--debug): ${arg_d}"
119-
info "-D (--print-downloaders): ${arg_D}"
120-
info "-e (--verbose): ${arg_e}"
121-
info "-h (--help): ${arg_h}"
122-
info "-n (--no-color): ${arg_n}"
123-
info "-P (--print-paths): ${arg_P}"
124-
info "-U (--print-URLs): ${arg_U}"
125-
info "-V (--print-versions): ${arg_V}"
114+
info "-d (--debug): ${arg_d}"
115+
info "-D (--print-downloader): ${arg_D}"
116+
info "-e (--verbose): ${arg_e}"
117+
info "-h (--help): ${arg_h}"
118+
info "-i (--install-dir): ${arg_i}"
119+
info "-I (--install-version): ${arg_i}"
120+
info "-j (--num-threads): ${arg_j}"
121+
info "-n (--no-color): ${arg_n}"
122+
info "-P (--print-path): ${arg_P}"
123+
info "-U (--print-url): ${arg_U}"
124+
info "-V (--print-version): ${arg_V}"
126125

127126
# Set OFP installation path to the value of the -i argument if present.
128127
# Otherwise, install OFP in the OpenCoarrays prerequisites/installations directory.

prerequisites/install-ofp.sh-usage

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
-d --debug Enable debug mode.
2-
-D --print-downloaders Print the name of the download programs for OFP and its prerequisites.
3-
-e --verbose Enable verbose mode, print script as it is executed.
4-
-h --help This page.
5-
-i --installation-path [arg] Specify installation path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations"
6-
-n --no-color Disable color output.
7-
-P --print-paths Print the default installation paths for OFP and its prerequisites.
8-
-U --print-URLs Print the URLs for OFP and its prerequisites.
9-
-V --print-versions Print the default installation versions for OFP and its prerequisites.
1+
-d --debug Enable debug mode.
2+
-D --print-downloader Print default download program.
3+
-e --verbose Enable verbose mode, print script as it is executed.
4+
-h --help This page.
5+
-i --install-dir [arg] Install OFP in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/"
6+
-I --install-version [arg] OFP version to install. (To see default, use -V or --print-version)
7+
-j --num-threads [arg] Number of threads to use when invoking make. Default="1"
8+
-n --no-color Disable color output.
9+
-P --print-path Print OFP installation path.
10+
-U --print-url Print OFP URL.
11+
-V --print-version Print OFP version.

0 commit comments

Comments
 (0)