Skip to content

Commit e60acbd

Browse files
rousonzbeekman
authored andcommitted
Switched build -> build.sh in find_or_install.sh
1 parent cb73a69 commit e60acbd

File tree

4 files changed

+30
-26
lines changed

4 files changed

+30
-26
lines changed

prerequisites/build-functions/download_if_necessary.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ download_if_necessary()
99
if [ -f $url_tail ] || [ -d $url_tail ]; then
1010
info "Found '${url_tail}' in ${PWD}."
1111
info "If it resulted from an incomplete download, building ${package_name} could fail."
12-
info "Would you like to proceed anyway? (y/n)"
12+
info "Would you like to proceed anyway? (Y/n)"
1313
read proceed
14-
if [[ "${proceed}" == "y" ]]; then
15-
info "y"
16-
else
14+
if [[ "${proceed}" == "n" || "${proceed}" == "N" || "${proceed}" == "no" ]]; then
1715
info "n"
1816
info "Please remove $url_tail and restart the installation to to ensure a fresh download." 1>&2
1917
emergency "Aborting. [exit 80]"
18+
else
19+
info "y"
2020
fi
2121
elif ! type "${fetch}" &> /dev/null; then
2222
# The download mechanism is missing

prerequisites/build-functions/unpack_if_necessary.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ unpack_if_necessary()
55
package_source_directory="${version_to_build}"
66
else
77
info "Unpacking ${url_tail}."
8-
info "Unpack command: tar xf ${download_path}/${url_tail}"
8+
info "pushd ${download_path}"
99
pushd "${download_path}"
10+
info "Unpack command: tar xf ${url_tail}"
1011
tar xf "${url_tail}"
12+
info "popd"
1113
popd
1214
package_source_directory="${package_name}-${version_to_build}"
1315
fi

prerequisites/build.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,21 @@
3030
# (3) Parse the usage information (default usage file name: current file's name with -usage appended).
3131
# (4) Parse the command line using the usage information.
3232

33-
export __usage=${OPENCOARRAYS_SRC_DIR}/prerequisites/build.sh-usage
3433

35-
### Start of boilerplate -- do not edit this block #######################
34+
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD}/..}"
35+
export __usage=${OPENCOARRAYS_SRC_DIR}/prerequisites/build.sh-usage
36+
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
37+
echo "Please run this script inside the top-level OpenCoarrays source directory "
38+
echo "or set OPENCOARRAYS_SRC_DIR to the OpenCoarrays source directory path."
39+
exit 1
40+
fi
41+
export B3B_USE_CASE="${B3B_USE_CASE:-${OPENCOARRAYS_SRC_DIR}/prerequisites/use-case}"
3642
if [[ ! -f "${B3B_USE_CASE:-}/bootstrap.sh" ]]; then
3743
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."
4144
exit 2
42-
else
43-
source "${B3B_USE_CASE}/bootstrap.sh" "$@"
4445
fi
45-
### End of boilerplate -- start user edits below #########################
46+
source "${B3B_USE_CASE}/bootstrap.sh" "$@"
47+
4648

4749

4850
# Set up a function to call when receiving an EXIT signal to do some cleanup. Remove if

prerequisites/install-functions/find_or_install.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ find_or_install()
4040
package_in_path=false
4141
fi
4242

43-
package_install_path=`./build $package --default --query-path`
43+
package_install_path=`./build.sh -P $package`
4444

4545
printf "$this_script: Checking whether $executable is in the directory in which $this_script\n"
4646
printf " installs it by default and whether the user has executable permission for it..."
@@ -53,7 +53,7 @@ find_or_install()
5353
printf "no.\n"
5454
fi
5555

56-
minimum_version=`./build $package --default --query-version`
56+
minimum_version=`./build.sh -V $package`
5757

5858
if [[ "$package" == "cmake" ]]; then
5959

@@ -76,12 +76,12 @@ find_or_install()
7676
elif [[ "$package_in_path" == "true" ]]; then
7777
printf "$this_script: Checking whether $package in PATH is version < $minimum_version... "
7878

79-
if ! ./check_version.sh $package `./build $package --default --query-version`; then
79+
if ! ./check_version.sh $package `./build.sh -V $package`; then
8080
printf "yes.\n"
8181
# Here we place $package on the dependency stack to trigger the build of the above file:
8282
stack_push dependency_pkg $package "none"
8383
stack_push dependency_exe $package "none"
84-
stack_push dependency_path `./build cmake --default --query-path` "none"
84+
stack_push dependency_path `./build.sh -P cmake` "none"
8585

8686
else
8787
printf "no.\n"
@@ -96,7 +96,7 @@ find_or_install()
9696
else # Build package ($package has no prerequisites)
9797
stack_push dependency_pkg $package "none"
9898
stack_push dependency_exe $package "none"
99-
stack_push dependency_path `./build $package --default --query-path` "none"
99+
stack_push dependency_path `./build.sh -P $package` "none"
100100
fi
101101

102102
elif [[ $package == "mpich" ]]; then
@@ -130,7 +130,7 @@ find_or_install()
130130
# Trigger 'find_or_install gcc' and subsequent build of $package
131131
stack_push dependency_pkg "none" $package "gcc"
132132
stack_push dependency_exe "none" $executable "gfortran"
133-
stack_push dependency_path "none" `./build $package --default --query-path` `./build gcc --default --query-path`
133+
stack_push dependency_path "none" `./build.sh -P $package` `./build -P gcc`
134134
else
135135
printf "yes.\n"
136136
printf "$this_script: Checking whether $executable in PATH wraps gfortran version 5.3.0 or later... "
@@ -156,15 +156,15 @@ find_or_install()
156156
# Trigger 'find_or_install gcc' and subsequent build of $package
157157
stack_push dependency_pkg "none" $package "gcc"
158158
stack_push dependency_exe "none" $executable "gfortran"
159-
stack_push dependency_path "none" `./build $package --default --query-path` `./build gcc --default --query-path`
159+
stack_push dependency_path "none" `./build.sh -P $package` `./build.sh gcc`
160160
fi
161161
fi
162162

163163
else # $package not in PATH and not yet installed by this script
164164
# Trigger 'find_or_install gcc' and subsequent build of $package
165165
stack_push dependency_pkg "none" $package "gcc"
166166
stack_push dependency_exe "none" $executable "gfortran"
167-
stack_push dependency_path "none" `./build $package --default --query-path` `./build gcc --default --query-path`
167+
stack_push dependency_path "none" `./build.sh -P $package` `./build.sh -P gcc`
168168
fi
169169

170170
elif [[ $package == "gcc" ]]; then
@@ -334,7 +334,7 @@ find_or_install()
334334
# Trigger 'find_or_install m4' and subsequent build of $package
335335
stack_push dependency_pkg "m4"
336336
stack_push dependency_exe "m4"
337-
stack_push dependency_path `./build m4 --default --query-path`
337+
stack_push dependency_path `./build.sh -P m4`
338338
else
339339
printf "no.\n"
340340
printf "$this_script: Using the $package executable $executable found in the PATH.\n"
@@ -357,7 +357,7 @@ find_or_install()
357357
# Trigger 'find_or_install m4' and subsequent build of $package
358358
stack_push dependency_pkg "m4"
359359
stack_push dependency_exe "m4"
360-
stack_push dependency_path `./build m4 --default --query-path`
360+
stack_push dependency_path `./build.sh -P m4`
361361
fi
362362

363363
elif [[ $package == "m4" ]]; then
@@ -386,7 +386,7 @@ find_or_install()
386386

387387
elif [[ "$package_in_path" == "true" ]]; then
388388
printf "$this_script: Checking whether $package executable $executable in PATH is version < $minimum_version... "
389-
if ! ./check_version.sh $package `./build $package --default --query-version`; then
389+
if ! ./check_version.sh $package `./build.sh -V $package`; then
390390
printf "yes.\n"
391391
export M4="$package_install_path/bin/m4"
392392
# Halt the recursion and signal that there are no prerequisites to build
@@ -512,8 +512,8 @@ find_or_install()
512512
fi
513513

514514
printf "$this_script: Downloading, building, and installing $package \n"
515-
echo "$this_script: Build command: FC=$FC CC=$CC CXX=$CXX ./build $package --default $package_install_path $num_threads"
516-
FC="$FC" CC="$CC" CXX="$CXX" ./build "$package" --default "$package_install_path" "$num_threads"
515+
echo "$this_script: Build command: FC=$FC CC=$CC CXX=$CXX ./build -p $package -i $package_install_path -j $num_threads"
516+
FC="$FC" CC="$CC" CXX="$CXX" ./build.sh -p "$package" -i "$package_install_path" -j "$num_threads"
517517

518518
if [[ -x "$package_install_path/bin/$executable" ]]; then
519519
printf "$this_script: Installation successful.\n"

0 commit comments

Comments
 (0)