|
2 | 2 |
|
3 | 3 | # BSD 3-Clause License |
4 | 4 | # |
5 | | -# -- hpclinux-install.sh |
6 | | -# |
| 5 | +# -- hpclinux-install.sh |
| 6 | +# |
7 | 7 | # Install OpenCoarrays inside the HPCLinux distribution from hpclinux.org. |
8 | 8 | # |
9 | 9 | # Usage: cd opencoarrays && ./prerequisites/hpclinux-install.sh" |
10 | 10 | # |
11 | 11 | # Motivation: |
12 | 12 | # |
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 |
17 | 17 | # omits the interrogation and invokes prerequisites/build.sh to build all prerequisites. |
18 | | -# |
| 18 | +# |
19 | 19 | # Copyright (c) 2016, Sourcery Institute |
20 | 20 | # All rights reserved. |
21 | | -# |
| 21 | +# |
22 | 22 | # Redistribution and use in source and binary forms, with or without |
23 | 23 | # modification, are permitted provided that the following conditions are met: |
24 | | -# |
| 24 | +# |
25 | 25 | # * Redistributions of source code must retain the above copyright notice, this |
26 | 26 | # list of conditions and the following disclaimer. |
27 | | -# |
| 27 | +# |
28 | 28 | # * Redistributions in binary form must reproduce the above copyright notice, |
29 | 29 | # this list of conditions and the following disclaimer in the documentation |
30 | 30 | # and/or other materials provided with the distribution. |
31 | | -# |
| 31 | +# |
32 | 32 | # * Neither the name of the copyright holder nor the names of its |
33 | 33 | # contributors may be used to endorse or promote products derived from |
34 | 34 | # this software without specific prior written permission. |
35 | | -# |
| 35 | +# |
36 | 36 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
37 | 37 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
38 | 38 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
45 | 45 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
46 | 46 |
|
47 | 47 | 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 |
51 | 51 | fi |
52 | 52 |
|
53 | 53 | pushd prerequisites |
54 | 54 |
|
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 |
63 | 63 |
|
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}" |
70 | 70 |
|
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}" |
75 | 75 |
|
76 | 76 | popd # return to top level of OpenCoarrays source tree |
77 | 77 |
|
78 | 78 | # Build OpenCoarrays |
79 | 79 | 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)' |
81 | 81 | read -r delete_build |
82 | 82 |
|
83 | | - if [[ "$delete_build" == "n" || "$delete_build" == "no" ]]; then |
| 83 | + if [[ "${delete_build}" == "n" || "${delete_build}" == "no" ]]; then |
84 | 84 | 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" |
86 | 86 | exit 10 |
87 | 87 | else # permission granted to delete build subdirectory |
88 | 88 | printf "Y\n" |
89 | | - fi |
| 89 | + fi |
90 | 90 | rm -rf build |
91 | 91 | fi |
92 | 92 | mkdir build |
93 | 93 | pushd build |
94 | 94 |
|
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}" |
100 | 101 |
|
101 | 102 | popd # return to top level of OpenCoarrays source tree |
0 commit comments