@@ -29,14 +29,14 @@ function set_absolute_path()
29
29
}
30
30
set_absolute_path " ${patch_file} "
31
31
32
- # Exit on error or use of an unset variable:
32
+ # Exit on error or use of an unset variable:
33
33
set -o errexit
34
34
set -o nounset
35
35
36
36
# Return the highest exit code in a chain of pipes:
37
37
set -o pipefail
38
38
39
- # ## Define functions
39
+ # ## Define functions
40
40
function choose_package_manager()
41
41
{
42
42
OS=$( uname)
@@ -48,7 +48,7 @@ function choose_package_manager()
48
48
elif type brew >& /dev/null; then
49
49
package_manager=" brew"
50
50
fi
51
- ;;
51
+ ;;
52
52
53
53
" Linux" )
54
54
if [[ ! -f /etc/lsb-release ]]; then
@@ -64,17 +64,17 @@ function choose_package_manager()
64
64
" Debian" )
65
65
package_manager=" dnf"
66
66
;;
67
- * )
67
+ * )
68
68
echo " I don't recognize the Linux distribution ${DISTRIB_ID:- } "
69
69
exit 1
70
70
;;
71
71
esac
72
- ;;
72
+ ;;
73
73
74
- * )
74
+ * )
75
75
echo " I don't recognize the operating system \$ {OS}"
76
76
exit 1
77
- ;;
77
+ ;;
78
78
esac
79
79
}
80
80
choose_package_manager
@@ -121,22 +121,22 @@ install_if_missing flex
121
121
122
122
# Download and build the GCC trunk:
123
123
echo " Downloading the GCC trunk."
124
- ./install.sh --only-download --package gcc --install-branch trunk
124
+ ./install.sh --only-download --package gcc --install-branch trunk
125
125
126
126
# Patch the GCC trunk and rebuild
127
127
echo " Patching the GCC source using ${absolute_path} ."
128
- pushd prerequisites/downloads/trunk
128
+ pushd prerequisites/downloads/trunk
129
129
patch -p0 < " ${absolute_path} "
130
130
popd
131
131
132
132
# Build the patched GCC trunk
133
133
echo " Rebuilding the patched GCC source."
134
- ./install.sh --package gcc --install-branch trunk --yes-to-all
134
+ ./install.sh --package gcc --install-branch trunk --yes-to-all
135
135
136
136
# Verify that GCC installed in the expected path
137
137
patched_GCC_install_path=${PWD} /prerequisites/installations/gcc/trunk
138
138
if ! type " ${patched_GCC_install_path} " /bin/gfortran >& /dev/null; then
139
- echo " gfortran is not installed in the expected location ${patched_GCC_install_path} ."
139
+ echo " gfortran is not installed in the expected location ${patched_GCC_install_path} ."
140
140
exit 1
141
141
fi
142
142
@@ -146,7 +146,7 @@ echo "Setting and exporting LD_LIBRARY_PATH"
146
146
function prepend_to_LD_LIBRARY_PATH() {
147
147
: ${1?' set_LD_LIBRARY_PATH: missing path' }
148
148
new_path=" ${1} "
149
- if [[ -z " ${LD_LIBRARY_PATH:- } " ]]; then
149
+ if [[ -z " ${LD_LIBRARY_PATH:- } " ]]; then
150
150
export LD_LIBRARY_PATH=" ${new_path} "
151
151
else
152
152
export LD_LIBRARY_PATH=" ${new_path} :${LD_LIBRARY_PATH} "
@@ -155,7 +155,7 @@ function prepend_to_LD_LIBRARY_PATH() {
155
155
156
156
old_path=" ${LD_LIBRARY_PATH:- } "
157
157
158
- if [[ -d " ${PWD} /prerequisites/installations/gcc/trunk/lib" ]]; then
158
+ if [[ -d " ${PWD} /prerequisites/installations/gcc/trunk/lib" ]]; then
159
159
prepend_to_LD_LIBRARY_PATH " ${patched_GCC_install_path} /lib/"
160
160
fi
161
161
@@ -175,12 +175,12 @@ echo "Building MPICH with the patched compilers."
175
175
./install.sh --package mpich --yes-to-all \
176
176
--with-fortran " ${patched_GCC_install_path} /bin/gfortran" \
177
177
--with-c " ${patched_GCC_install_path} /bin/gcc" \
178
- --with-cxx " ${patched_GCC_install_path} /bin/g++"
178
+ --with-cxx " ${patched_GCC_install_path} /bin/g++"
179
179
180
180
# Verify that MPICH installed where expected
181
181
mpich_install_path=$( ./install.sh -P mpich)
182
182
if ! type " ${mpich_install_path} " /bin/mpif90; then
183
- echo " MPICH is not installed in the expected location ${mpich_install_path} ."
183
+ echo " MPICH is not installed in the expected location ${mpich_install_path} ."
184
184
exit 1
185
185
fi
186
186
0 commit comments