benchmark-guile.in 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #! /bin/sh
  2. # Usage: benchmark-guile [-i GUILE-INTERPRETER] [GUILE-BENCHMARK-ARGS]
  3. # If `-i GUILE-INTERPRETER' is omitted, use ${top_builddir}/meta/guile.
  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. set -e
  12. top_builddir=@top_builddir_absolute@
  13. top_srcdir=@top_srcdir_absolute@
  14. BENCHMARK_SUITE_DIR=${top_srcdir}/benchmark-suite
  15. if [ x"$1" = x-i ] ; then
  16. guile=$2
  17. shift
  18. shift
  19. else
  20. guile=${top_builddir}/meta/guile
  21. fi
  22. GUILE_LOAD_PATH="$BENCHMARK_SUITE_DIR${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
  23. export GUILE_LOAD_PATH
  24. if [ -f "$guile" -a -x "$guile" ] ; then
  25. echo Benchmarking $guile ... "$@"
  26. echo with GUILE_LOAD_PATH=$GUILE_LOAD_PATH
  27. else
  28. echo ERROR: Cannot execute $guile
  29. exit 1
  30. fi
  31. # documentation searching ignores GUILE_LOAD_PATH.
  32. if [ ! -f guile-procedures.txt ] ; then
  33. @LN_S@ libguile/guile-procedures.txt .
  34. fi
  35. exec $guile \
  36. -L "$BENCHMARK_SUITE_DIR" \
  37. -e main -s "$BENCHMARK_SUITE_DIR/guile-benchmark" \
  38. --benchmark-suite "$BENCHMARK_SUITE_DIR/benchmarks" \
  39. --log-file benchmark-guile.log "$@"
  40. # benchmark-guile ends here