Skip to content

Commit 1c9c6ce

Browse files
committed
Fix bug in HPC Linux install script
Style fixes for HPC Linux script Fixes #417
1 parent cbcdbb5 commit 1c9c6ce

File tree

1 file changed

+43
-42
lines changed

1 file changed

+43
-42
lines changed

developer-scripts/hpclinux-install.sh

+43-42
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@
22

33
# BSD 3-Clause License
44
#
5-
# -- hpclinux-install.sh
6-
#
5+
# -- hpclinux-install.sh
6+
#
77
# Install OpenCoarrays inside the HPCLinux distribution from hpclinux.org.
88
#
99
# Usage: cd opencoarrays && ./prerequisites/hpclinux-install.sh"
1010
#
1111
# Motivation:
1212
#
13-
# On Fedora-based distributions, the OpenCoarrays installer fails during the stack-based
14-
# system interrogation (presumably due to problems with the prerequisites/stack.sh script).
15-
# At least in the case of HPCLinux, system interrogation is unnecessary because HPCLinux is
16-
# uber-stable and it's safe bet that all prerequisites need to be installed so this script
13+
# On Fedora-based distributions, the OpenCoarrays installer fails during the stack-based
14+
# system interrogation (presumably due to problems with the prerequisites/stack.sh script).
15+
# At least in the case of HPCLinux, system interrogation is unnecessary because HPCLinux is
16+
# uber-stable and it's safe bet that all prerequisites need to be installed so this script
1717
# omits the interrogation and invokes prerequisites/build.sh to build all prerequisites.
18-
#
18+
#
1919
# Copyright (c) 2016, Sourcery Institute
2020
# All rights reserved.
21-
#
21+
#
2222
# Redistribution and use in source and binary forms, with or without
2323
# modification, are permitted provided that the following conditions are met:
24-
#
24+
#
2525
# * Redistributions of source code must retain the above copyright notice, this
2626
# list of conditions and the following disclaimer.
27-
#
27+
#
2828
# * Redistributions in binary form must reproduce the above copyright notice,
2929
# this list of conditions and the following disclaimer in the documentation
3030
# and/or other materials provided with the distribution.
31-
#
31+
#
3232
# * Neither the name of the copyright holder nor the names of its
3333
# contributors may be used to endorse or promote products derived from
3434
# this software without specific prior written permission.
35-
#
35+
#
3636
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3737
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3838
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,57 +45,58 @@
4545
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4646

4747
if [[ ! -d prerequisites ]]; then
48-
echo "Please execute this script with your present working directory"
49-
echo "set to the top level of the OpenCoarrays source tree."
50-
exit 1
48+
printf "Please execute this script with your present working directory"
49+
printf "set to the top level of the OpenCoarrays source tree."
50+
exit 1
5151
fi
5252

5353
pushd prerequisites
5454

55-
# Build CMake using the system GCC (4.8.1) and prepend its bin subdirectory to the PATH
56-
export cmake_install_path="${PWD}"/installations/cmake/cmake
57-
./build.sh --package cmake --install-prefix "${cmake_install_path}"
58-
if [[ -z "${PATH}" ]]; then
59-
export PATH="${cmake_install_path}"/bin
60-
else
61-
export PATH="${cmake_install_path}"/bin:$PATH
62-
fi
55+
# Build CMake using the system GCC (4.8.1) and prepend its bin subdirectory to the PATH
56+
export cmake_install_path="${PWD}/installations/cmake/cmake"
57+
./build.sh --package cmake --install-prefix "${cmake_install_path}"
58+
if [[ -z "${PATH}" ]]; then
59+
export PATH="${cmake_install_path}/bin"
60+
else
61+
export PATH="${cmake_install_path}/bin:${PATH}"
62+
fi
6363

64-
# Build GCC 6.3.0 and prepend its bin subdirectory to the PATH
65-
export gcc_version=6.3.0
66-
export gcc_install_path="${PWD}"/installations/gnu/$gcc_version
67-
./build.sh --package gcc --install-version $gcc_version --install-prefix "${gcc_install_path}"
68-
export PATH="${gcc_install_path}"/bin:$PATH
69-
export LD_LIBRARY_PATH="${gcc_install_path}"/lib64:"${gcc_install_path}"/lib:$LD_LIBRARY_PATH
64+
# Build GCC 6.3.0 and prepend its bin subdirectory to the PATH
65+
export gcc_version=6.3.0
66+
export gcc_install_path="${PWD}/installations/gnu/${gcc_version}"
67+
./build.sh --package gcc --install-version "${gcc_version}" --install-prefix "${gcc_install_path}"
68+
export PATH="${gcc_install_path}/bin:${PATH}"
69+
export LD_LIBRARY_PATH="${gcc_install_path}/lib64:${gcc_install_path}/lib:${LD_LIBRARY_PATH}"
7070

71-
# Build MPICH 3.2 and prepend its bin subdirectory to the PATH
72-
export mpich_install_path="${PWD}"/installations/mpich
73-
./build.sh --package mpich --install-prefix "${mpich_install_path}" --num-threads 4
74-
export PATH="${mpich_install_path}"/bin:$PATH
71+
# Build MPICH 3.2 and prepend its bin subdirectory to the PATH
72+
export mpich_install_path="${PWD}/installations/mpich"
73+
./build.sh --package mpich --install-prefix "${mpich_install_path}" --num-threads 4
74+
export PATH="${mpich_install_path}/bin:${PATH}"
7575

7676
popd # return to top level of OpenCoarrays source tree
7777

7878
# Build OpenCoarrays
7979
if [[ -d build ]]; then
80-
echo -e 'Old build subdirectory found. Ok to delete the "build" subdirectory? (Y/n) '
80+
printf 'Old build subdirectory found. Ok to delete the "build" subdirectory? (Y/n)'
8181
read -r delete_build
8282

83-
if [[ "$delete_build" == "n" || "$delete_build" == "no" ]]; then
83+
if [[ "${delete_build}" == "n" || "${delete_build}" == "no" ]]; then
8484
printf "n\n"
85-
echo -e "Please rename or delete the build subdirectory and restart this script. Aborting. [exit 10]\n"
85+
printf "Please rename or delete the build subdirectory and restart this script. Aborting. [exit 10]\n"
8686
exit 10
8787
else # permission granted to delete build subdirectory
8888
printf "Y\n"
89-
fi
89+
fi
9090
rm -rf build
9191
fi
9292
mkdir build
9393
pushd build
9494

95-
export opencoarrays_install_path="${PWD}"/prerequisites/installations/opencoarrays
96-
FC=gfortran CC=gcc cmake .. -DCMAKE_INSTALL_PREFIX="{opencoarrays_install_path}"
97-
make
98-
make install
99-
export PATH="${opencoarrays_install_path}"/bin:$PATH
95+
export opencoarrays_install_path="${PWD}/prerequisites/installations/opencoarrays"
96+
FC=gfortran CC=gcc cmake .. -DCMAKE_INSTALL_PREFIX="${opencoarrays_install_path}"
97+
make
98+
ctest --output-on-failure --schedule-random
99+
make install
100+
export PATH="${opencoarrays_install_path}/bin:${PATH}"
100101

101102
popd # return to top level of OpenCoarrays source tree

0 commit comments

Comments
 (0)