Skip to content

Commit 2be2e15

Browse files
build: clean up install script
1 parent b409299 commit 2be2e15

File tree

1 file changed

+13
-123
lines changed

1 file changed

+13
-123
lines changed

install

Lines changed: 13 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
set -eo pipefail
3+
set -o pipefail
44

55
# Create file for TestHub
66
# This file will be populated during math/test
@@ -17,63 +17,6 @@ make data/version_number
1717
# at the end of the file
1818
{
1919

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-
7720
# Block sudo access, this check should come first as if a user blindly types "sudo ./install" then MESA_DIR wont be set
7821
# So lets catch this error first rather then forcing them to set MESA_DIR under sudo
7922
if [ ${EUID:-$(id -u)} -eq 0 ];
@@ -225,48 +168,19 @@ then
225168
exit 1
226169
fi
227170

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-
260171
# 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
263174
MINIMUM_VERSION=20.3.1
264175
VERSION_CHECK=$(echo $($MESA_DIR/scripts/check_sdk_version $MINIMUM_VERSION))
265176
echo MESASDK version check $VERSION_CHECK
266177
if [ $VERSION_CHECK != "passed" ]; then
267178
echo Your MESASDK is too old please update to version $MINIMUM_VERSION or newer
268179
exit 1
269180
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
270184
fi
271185
fi
272186

@@ -292,38 +206,14 @@ function enum_procs {
292206
fi
293207
}
294208

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
309215
fi
310216

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-
327217
echo
328218
echo
329219
echo
@@ -346,4 +236,4 @@ echo
346236
echo
347237

348238
# 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

Comments
 (0)