Skip to content

Commit e7e7414

Browse files
rousonzbeekman
authored andcommitted
Simplify initial environment set-up in install-ofp
1 parent bb19966 commit e7e7414

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

prerequisites/install-ofp.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# - Build OpenCoarrays prerequisite packages and their prerequisites
77
#
8-
# Usage: LOG_LEVEL=7 B3B_USE_CASE=/opt/bash3boilerplate/src/use-case ./my-script.sh -f script_input.txt
8+
# Usage: LOG_LEVEL=7 B3B_USE_CASE=/opt/bash3boilerplate/src/use-case ./install-opfp.sh
99
#
1010
# More info:
1111
#
@@ -32,17 +32,21 @@
3232

3333
export __usage="${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh-usage"
3434

35-
### Start of boilerplate -- do not edit this block #######################
35+
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD}/..}"
36+
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."
39+
exit 1
40+
fi
41+
42+
### Import bash3boilerplate functionality
43+
export B3B_USE_CASE="${B3B_USE_CASE:-${OPENCOARRAYS_SRC_DIR}/prerequisites/use-case}"
3644
if [[ ! -f "${B3B_USE_CASE:-}/bootstrap.sh" ]]; then
3745
echo "Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
38-
exit 1
39-
elif [[ ! -d "${OPENCOARRAYS_SRC_DIR:-}" ]]; then
40-
echo "Please set OPENCOARRAYS_SRC_DIR to the OpenCoarrays source directory path."
4146
exit 2
4247
else
4348
source "${B3B_USE_CASE}/bootstrap.sh" "$@"
4449
fi
45-
### End of boilerplate -- start user edits below #########################
4650

4751
# Set up a function to call when receiving an EXIT signal to do some cleanup. Remove if
4852
# not needed. Other signals can be trapped too, like SIGINT and SIGTERM.

0 commit comments

Comments
 (0)