Commit | Line | Data |
---|---|---|
dd897aaf DH |
1 | #! /bin/sh |
2 | # Usage: benchmark-guile [-i GUILE-INTERPRETER] [GUILE-BENCHMARK-ARGS] | |
4812ce85 | 3 | # If `-i GUILE-INTERPRETER' is omitted, use ${top_builddir}/meta/guile. |
dd897aaf DH |
4 | # See ${top_srcdir}/benchmark-suite/guile-benchmark for documentation on GUILE-BENCHMARK-ARGS. |
5 | # | |
6 | # Example invocations: | |
7 | # ./benchmark-guile | |
8 | # ./benchmark-guile numbers.bm | |
9 | # ./benchmark-guile -i /usr/local/bin/guile | |
10 | # ./benchmark-guile -i /usr/local/bin/guile numbers.bm | |
11 | ||
12 | set -e | |
13 | ||
14 | top_builddir=@top_builddir_absolute@ | |
15 | top_srcdir=@top_srcdir_absolute@ | |
16 | ||
17 | BENCHMARK_SUITE_DIR=${top_srcdir}/benchmark-suite | |
18 | ||
19 | if [ x"$1" = x-i ] ; then | |
20 | guile=$2 | |
21 | shift | |
22 | shift | |
23 | else | |
4812ce85 | 24 | guile=${top_builddir}/meta/guile |
dd897aaf DH |
25 | fi |
26 | ||
bd2057ff | 27 | GUILE_LOAD_PATH="$BENCHMARK_SUITE_DIR${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" |
dd897aaf DH |
28 | export GUILE_LOAD_PATH |
29 | ||
30 | if [ -f "$guile" -a -x "$guile" ] ; then | |
31 | echo Benchmarking $guile ... "$@" | |
32 | echo with GUILE_LOAD_PATH=$GUILE_LOAD_PATH | |
33 | else | |
34 | echo ERROR: Cannot execute $guile | |
35 | exit 1 | |
36 | fi | |
37 | ||
38 | # documentation searching ignores GUILE_LOAD_PATH. | |
39 | if [ ! -f guile-procedures.txt ] ; then | |
40 | @LN_S@ libguile/guile-procedures.txt . | |
41 | fi | |
42 | ||
43 | exec $guile \ | |
d10f7b57 | 44 | -L "$BENCHMARK_SUITE_DIR" \ |
dd897aaf DH |
45 | -e main -s "$BENCHMARK_SUITE_DIR/guile-benchmark" \ |
46 | --benchmark-suite "$BENCHMARK_SUITE_DIR/benchmarks" \ | |
47 | --log-file benchmark-guile.log "$@" | |
48 | ||
49 | # benchmark-guile ends here |