|
1 | 1 | #!/usr/bin/env bash |
2 | 2 | # BASH3 Boilerplate |
3 | 3 | # |
4 | | -# install-binary.sh |
| 4 | +# install-ofp.sh |
5 | 5 | # |
6 | | -# - Build OpenCoarrays prerequisite packages and their prerequisites |
| 6 | +# - Build the Open Fortran Parser |
7 | 7 | # |
8 | | -# Usage: LOG_LEVEL=7 B3B_USE_CASE=/opt/bash3boilerplate/src/use-case ./install-opfp.sh |
| 8 | +# Usage: ./install-ofp.sh -i /opt |
9 | 9 | # |
10 | 10 | # More info: |
11 | 11 | # |
|
28 | 28 | # (1) Import several bash3boilerplate helper functions & default settings. |
29 | 29 | # (2) Set several variables describing the current file and its usage page. |
30 | 30 | # (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. |
34 | 32 |
|
35 | 33 | export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD}/..}" |
| 34 | +export __usage="${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh-usage" |
36 | 35 | 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." |
39 | 38 | exit 1 |
40 | 39 | fi |
41 | | - |
42 | | -### Import bash3boilerplate functionality |
43 | 40 | export B3B_USE_CASE="${B3B_USE_CASE:-${OPENCOARRAYS_SRC_DIR}/prerequisites/use-case}" |
44 | 41 | 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." |
46 | 43 | exit 2 |
47 | | -else |
48 | | - source "${B3B_USE_CASE}/bootstrap.sh" "$@" |
49 | 44 | fi |
| 45 | +source "${B3B_USE_CASE}/bootstrap.sh" "$@" |
50 | 46 |
|
51 | 47 | # Set up a function to call when receiving an EXIT signal to do some cleanup. Remove if |
52 | 48 | # not needed. Other signals can be trapped too, like SIGINT and SIGTERM. |
@@ -115,14 +111,17 @@ info "__os: ${__os}" |
115 | 111 | info "__usage: ${__usage}" |
116 | 112 | info "LOG_LEVEL: ${LOG_LEVEL}" |
117 | 113 |
|
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}" |
126 | 125 |
|
127 | 126 | # Set OFP installation path to the value of the -i argument if present. |
128 | 127 | # Otherwise, install OFP in the OpenCoarrays prerequisites/installations directory. |
|
0 commit comments