nightly.sh 2.3 KB
Newer Older
Matthias Braun's avatar
Matthias Braun committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -eu

function die() {
	echo "$@" 1>&2
	exit 1
}

ME="$(readlink -f "$0")"
MYDIR="$(dirname "$ME")"

TARGET_TRIPLE="$1"
test -n "$TARGET_TRIPLE" || die "No target triple specified"

# Check if cparser is available
CPARSER=$(readlink -f "${MYDIR}/../../cparser/build/debug/cparser") || die "cparser missing"
test -x "${CPARSER}" || die "cparser missing (expected at ${CPARSER})"

# Synchronize spec files
SOURCE="firm@i44sun3:/data1/firm/specinst"
DESTDIR="/data1/$(whoami)"
rsync -rsh=ssh -z --delete --recursive --links "$SOURCE" "${DESTDIR}/" || die "rsync failed"

cd "${DESTDIR}/specinst"
# Need to call "relocate" if the spec stuff ended up in a different directory
# than the original installation
(set +eu ; . shrc && bin/relocate)
# Setup result directory
rm -rf result # remove old symlink
RESDIR="/ben/firm/public_html/nightly_spec_results/${TARGET_TRIPLE}"
mkdir -p "${RESDIR}" || dir "Couldn't setup result dir"
ln -sf "${RESDIR}" result || die "Couldn't setup result dir"

SPEC_PY_FLAGS="--c-compiler=${CPARSER} --no-cpp --no-fortran --iterations=1"
# Start spec differently on each architecture
case "$TARGET_TRIPLE" in
"i686-linux-gnu")
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --time-limit=1800"
	;;
"sparc-leon-linux-gnu")
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --time-limit=5400"
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --no-floating-point"
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --target-architecture=sparc"
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --c-compiler-args=-mtarget=sparc-leon-linux-gnu"
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --c-compiler-args=-msoft-float"
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --c-compiler-args=-static"
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --submit=qemu-sparc"
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --submit=-r"
	SPEC_PY_FLAGS="$SPEC_PY_FLAGS --submit=2.6.40"
	SPEC_PY_FLAGS="164.gzip 176.gcc 181.mcf 186.crafty 197.parser 253.perlbmk 254.gap 255.vortex 256.bzip2"
	;;
*)
	echo "Architecture not yet supported (or maybe none was specified?)"
	exit 1
	;;
esac

${MYDIR}/../spec.py --config-only $SPEC_PY_FLAGS > config/default.cfg
(set +eu ; . shrc && runspec | tee log.txt)

# Error handling
#function handler() {
#	killall -q -9 -g runspec
#	killall -q -9 -g specinvoke
#	killall -q -9 cparser
#}
#SPEC_PY=$!
#trap handler TERM KILL EXIT INT
#wait $SPEC_PY

# Grep for errors in the output
ERR=$(grep --count Error log.txt)

if [ $ERR -ne 0 ]; then
	exit 1
fi
exit 0