1
1
#! /bin/bash
2
2
3
- set -eo pipefail
3
+ set -o pipefail
4
4
5
5
# Create file for TestHub
6
6
# This file will be populated during math/test
@@ -17,63 +17,6 @@ make data/version_number
17
17
# at the end of the file
18
18
{
19
19
20
- function check_okay {
21
- if [ $? -ne 0 ]
22
- then
23
- exit 1
24
- fi
25
- }
26
-
27
- function do_one_parallel {
28
- cd $1
29
- check_okay
30
- echo
31
- pwd
32
- echo " building $1 package."
33
- echo
34
- # don't use nice with ./i1 or can miss errors
35
- ./i1p
36
- check_okay
37
- cd ..
38
- echo
39
- if [ -f skip_build ] || [ -f " $1 /skip_build" ]
40
- then
41
- echo " mesa/$1 has been tested and exported."
42
- elif [ -f skip_test ] || [ -f " $1 /skip_test" ]
43
- then
44
- echo " mesa/$1 has been built and exported."
45
- else
46
- echo " mesa/$1 has been built, tested, and exported."
47
- fi
48
- echo
49
- echo " ************************************************"
50
- }
51
-
52
- function do_one {
53
- cd $1
54
- check_okay
55
- echo
56
- pwd
57
- echo " building $1 package."
58
- echo
59
- # don't use nice with ./i1 or can miss errors
60
- ./i1
61
- check_okay
62
- cd ..
63
- echo
64
- if [ -f skip_build ] || [ -f " $1 /skip_build" ]
65
- then
66
- echo " mesa/$1 has been tested and exported."
67
- elif [ -f skip_test ] || [ -f " $1 /skip_test" ]
68
- then
69
- echo " mesa/$1 has been built and exported."
70
- else
71
- echo " mesa/$1 has been built, tested, and exported."
72
- fi
73
- echo
74
- echo " ************************************************"
75
- }
76
-
77
20
# Block sudo access, this check should come first as if a user blindly types "sudo ./install" then MESA_DIR wont be set
78
21
# So lets catch this error first rather then forcing them to set MESA_DIR under sudo
79
22
if [ ${EUID:- $(id -u)} -eq 0 ];
@@ -225,48 +168,19 @@ then
225
168
exit 1
226
169
fi
227
170
228
- makedepf90 > /dev/null
229
- if [ $? -ne 0 ]
230
- then
231
- echo
232
- echo " *******************************************************************"
233
- echo " * *"
234
- echo " * You need to install makedepf90 before you can install mesa. *"
235
- echo " * *"
236
- echo " * *"
237
- echo " * But only if you are not using the SDK. If you see this *"
238
- echo " * message and are trying to use the sdk *"
239
- echo " * then please check your environment variables *"
240
- echo " * are set first. *"
241
- echo " * *"
242
- echo " * *"
243
- echo " * The makedepf90 tar file is in the mesa/scripts directory. *"
244
- echo " * Unpack it anywhere (tar -zxvf makedepf90-2.8.8.tar.gz), *"
245
- echo " * and cd to the makedepf90-2.8.8 directory. *"
246
- echo " * Then do the usual sequence: *"
247
- echo " * *"
248
- echo " * ./configure *"
249
- echo " * make all *"
250
- echo " * sudo make install *"
251
- echo " * *"
252
- echo " * Note: 'make test' doesn't seem to work. I suggest skipping *"
253
- echo " * that step in the makedepf90 installation. *"
254
- echo " * *"
255
- echo " ******************************************************************"
256
- echo
257
- exit 1
258
- fi
259
-
260
171
# Check mesasdk version
261
- if [ ! -z " $MESASDK_ROOT " ]; then
262
- if [ -z " $MESA_DIR_INTENTIONALLY_EMPTY " ]; then
172
+ if [ -z " $MESA_DIR_INTENTIONALLY_EMPTY " ]; then
173
+ if [ ! -z " $MESASDK_ROOT " ]; then
263
174
MINIMUM_VERSION=20.3.1
264
175
VERSION_CHECK=$( echo $( $MESA_DIR /scripts/check_sdk_version $MINIMUM_VERSION ) )
265
176
echo MESASDK version check $VERSION_CHECK
266
177
if [ $VERSION_CHECK != " passed" ]; then
267
178
echo Your MESASDK is too old please update to version $MINIMUM_VERSION or newer
268
179
exit 1
269
180
fi
181
+ else
182
+ echo MESASDK_ROOT enviroment variable is not set. See https://docs.mesastar.org/en/latest/installation.html#set-your-environment-variables
183
+ exit 1
270
184
fi
271
185
fi
272
186
@@ -292,38 +206,14 @@ function enum_procs {
292
206
fi
293
207
}
294
208
295
- make -Oline -j$( enum_procs)
296
- check_okay
297
-
298
- if [ ! -r data ]
299
- then
300
- echo
301
- echo " ******************************************************************"
302
- echo " * *"
303
- echo " * Please setup the current mesa data before doing ./install *"
304
- echo " * See the mesa README file for details. *"
305
- echo " * *"
306
- echo " ******************************************************************"
307
- echo
308
- exit 1
209
+ make -w -Oline -j$( enum_procs)
210
+ if [[ $? -ne 0 ]] then
211
+ echo
212
+ echo " !! MESA install failed, see above or $BUILD_LOG for details !!"
213
+ echo
214
+ exit 1
309
215
fi
310
216
311
- function do_input_data {
312
- cd $1
313
- check_okay
314
- echo
315
- pwd
316
- echo " installing mesa $1 data."
317
- echo
318
- # don't use nice or can miss errors
319
- ./build_data_and_export
320
- check_okay
321
- echo " $1 data successfully installed."
322
- echo
323
- echo " ************************************************"
324
- cd ..
325
- }
326
-
327
217
echo
328
218
echo
329
219
echo
346
236
echo
347
237
348
238
# end scope and redirect output
349
- } 2>&1 | tee -a $BUILD_LOG | grep -Ev " (Leaving|Entering) directory"
239
+ } 2>&1 | tee -a $BUILD_LOG | { grep -Ev " (Leaving|Entering) directory" || true ; }
0 commit comments