| 1 |
#! /usr/bin/env bash |
| 2 |
#!/bin/bash |
| 3 |
# was #!/arch/gnu/bin/bash |
| 4 |
# was #! /bin/sh |
| 5 |
# but /bin/sh didn't recognize the -nt operator |
| 6 |
|
| 7 |
# "bench", a shell script to benchmark Scheme implementations |
| 8 |
# |
| 9 |
# Please report any errors or extensions to the author: |
| 10 |
# |
| 11 |
# Marc Feeley ([email protected]) |
| 12 |
# |
| 13 |
# The following have contributed to this benchmark suite: |
| 14 |
# |
| 15 |
# Harvey Stein ([email protected]) |
| 16 |
|
| 17 |
# This script has been modified by Will Clinger ([email protected]). |
| 18 |
# |
| 19 |
# The benchmarks must be contained within a src subdirectory |
| 20 |
# of the directory in which this script is run. |
| 21 |
# |
| 22 |
# FIXME: The tested systems live in different places on our |
| 23 |
# machines. This should be cleaned up so a one-line change |
| 24 |
# will take care of it. |
| 25 |
|
| 26 |
OSNAME="`( uname )`" |
| 27 |
|
| 28 |
# The following definitions are not in use, but using them |
| 29 |
# might improve the script. |
| 30 |
|
| 31 |
HOME="`( pwd )`" |
| 32 |
SRC="${HOME}/src" |
| 33 |
PREFIX="${HOME}/prefix" |
| 34 |
SUFFIX="${HOME}/suffix" |
| 35 |
|
| 36 |
TEMP="/tmp/larcenous" |
| 37 |
|
| 38 |
# On our Solaris machines, we can't install systems in |
| 39 |
# /usr/local, and some are in random places for historical |
| 40 |
# reasons. |
| 41 |
|
| 42 |
setup () |
| 43 |
{ |
| 44 |
case ${OSNAME} in |
| 45 |
|
| 46 |
"SunOS") |
| 47 |
|
| 48 |
APPS="/proj/will/Apps" |
| 49 |
|
| 50 |
CHICKEN="${APPS}/Chicken/bin/csc" |
| 51 |
CHICKEN_INT="${APPS}/Chicken/bin/csi" |
| 52 |
GSC="${APPS}/bin/gsc" |
| 53 |
GSI="${APPS}/bin/gsi" |
| 54 |
TWOBIT="/proj/will/LarcenyDev/twobit" |
| 55 |
SCHEME48="${APPS}/Scheme48/scheme48-1.3/go" |
| 56 |
MIT="${APPS}/bin/mitscheme" |
| 57 |
LARCENY=${LARCENY:-"larceny"} |
| 58 |
;; |
| 59 |
|
| 60 |
"Linux") |
| 61 |
|
| 62 |
APPS="/usr/local" |
| 63 |
|
| 64 |
CHICKEN="${APPS}/bin/chicken-csc" |
| 65 |
CHICKEN_INT="${APPS}/bin/chicken-csi" |
| 66 |
GSC="${APPS}/bin/gambit-gsc" |
| 67 |
GSI="${APPS}/bin/gambit-gsi" |
| 68 |
TWOBIT="${APPS}/bin/twobit" |
| 69 |
SCHEME48="${APPS}/bin/scheme48" |
| 70 |
MIT="${APPS}/bin/mit-scheme" |
| 71 |
PETITE_CHEZ="${APPS}/bin/petite-chez" |
| 72 |
HENCHMAN="/home/henchman/bin/larceny" |
| 73 |
LARCENY=${LARCENY:-"larceny"} |
| 74 |
;; |
| 75 |
|
| 76 |
"Darwin") |
| 77 |
APPS="/opt/bin" |
| 78 |
LARCENY="/Users/aghuloum/.opt/larceny-0.93-bin-native-ia32-macosx/larceny" |
| 79 |
PETITE_CHEZ="/usr/bin/petite" |
| 80 |
CHICKEN="/Users/ikarus/.opt/bin/csc" |
| 81 |
CHICKEN_INIT="/Users/ikarus/.opt/bin/csi" |
| 82 |
GSI="/Users/ikarus/.opt/4.0b20/bin/gsi" |
| 83 |
GSC="/Users/ikarus/.opt/4.0b20/bin/gsc" |
| 84 |
MIT="mit-scheme" |
| 85 |
;; |
| 86 |
esac |
| 87 |
|
| 88 |
# For both Solaris and Linux machines. |
| 89 |
|
| 90 |
BIGLOO=${BIGLOO:-"bigloo"} |
| 91 |
MZSCHEME=${MZSCHEME:-"mzscheme"} |
| 92 |
|
| 93 |
CSC=$CHICKEN |
| 94 |
CSI=$CHICKEN_INT |
| 95 |
} |
| 96 |
|
| 97 |
setup |
| 98 |
|
| 99 |
# ----------------------------------------------------------------------------- |
| 100 |
|
| 101 |
error () |
| 102 |
{ |
| 103 |
echo $1 |
| 104 |
echo ' |
| 105 |
Usage: bench [-r runs] [-c clean] [-i iterfile] [-s setting] [-o options] <scheme-systems> <benchmarks> |
| 106 |
|
| 107 |
<scheme-systems> is the abbreviated name of one or more |
| 108 |
language implementations to use, i.e.: |
| 109 |
|
| 110 |
gambit for Gambit-C compiler. |
| 111 |
gambit-int for Gambit-C interpreter. |
| 112 |
bigloo for Bigloo compiler. |
| 113 |
bigloo-int for Bigloo interpreter. |
| 114 |
chicken for Chicken compiler. |
| 115 |
chicken-int for Chicken interpreter. |
| 116 |
mzscheme for MzScheme. |
| 117 |
scheme48 for Scheme48. |
| 118 |
larceny for Larceny. |
| 119 |
awk for AWK. |
| 120 |
cc for '"cc"' C compiler. |
| 121 |
gcc for '"gcc"' C compiler. |
| 122 |
java for Java. |
| 123 |
all for all of the above. |
| 124 |
all-interpreters for the above interpreters. |
| 125 |
all-compilers for the above compilers. |
| 126 |
|
| 127 |
<benchmarks> is the name of one or more benchmarks |
| 128 |
to use, i.e.: |
| 129 |
|
| 130 |
all for all the benchmarks |
| 131 |
fib for the fib benchmark |
| 132 |
"fib boyer" for fib & boyer. |
| 133 |
|
| 134 |
runs is the number of times to run each benchmark (default is 1). |
| 135 |
|
| 136 |
clean is whether or not to clean out the build directory. |
| 137 |
true = clean. Useful for testing or inspection. |
| 138 |
|
| 139 |
iterfile is the file which specifies the number of iterations in |
| 140 |
each benchmark. If not supplied, we use num-iters.scm for compilers |
| 141 |
and num-iters-int.scm for interpreters. For testing, you might |
| 142 |
want to use one-iter.scm, which runs each test once. |
| 143 |
|
| 144 |
setting is the benchmarking setting. The possible values are: |
| 145 |
|
| 146 |
r5rs (default): |
| 147 |
- generic arithmetic operations |
| 148 |
- optional overflow detection on fixnum arithmetic |
| 149 |
- mutable bindings for the definitions in the benchmark |
| 150 |
- mutable predefined bindings (for +, car, ...) |
| 151 |
|
| 152 |
r6rs: |
| 153 |
- generic arithmetic operations |
| 154 |
- overflow detection on fixnum arithmetic (either produce a |
| 155 |
bignum or signal an exception) |
| 156 |
- immutable bindings for the definitions in the benchmark |
| 157 |
- immutable predefined bindings (for +, car, ...) |
| 158 |
- safe execution (i.e. an exception must be signalled on errors) |
| 159 |
|
| 160 |
r6rs-unsafe: |
| 161 |
- like r6rs setting but errors are not checked, but |
| 162 |
fixnum arithmetic overflows are detected |
| 163 |
|
| 164 |
r6rs-fixflo: |
| 165 |
- arithmetic operations are specialized to fixnum or flonum |
| 166 |
arguments as appropriate and the fixnum operations may |
| 167 |
wrap on overflow |
| 168 |
- immutable bindings for the definitions in the benchmark |
| 169 |
- immutable predefined bindings (for +, car, ...) |
| 170 |
- safe execution (i.e. an exception must be signalled on errors) |
| 171 |
|
| 172 |
r6rs-fixflo-unsafe: |
| 173 |
- like r6rs-fixflo setting but errors are not checked' |
| 174 |
|
| 175 |
exit |
| 176 |
} |
| 177 |
|
| 178 |
# ----------------------------------------------------------------------------- |
| 179 |
|
| 180 |
cleanup () |
| 181 |
{ |
| 182 |
if [ "$clean" = "true" ] ; then |
| 183 |
# It's true that technically speaking, we should be in the build |
| 184 |
# directory when this fcn is called. Thus, we should be able to |
| 185 |
# just do rm *. However, that's kind of dangerous, so instead, |
| 186 |
# we delete files newer than the mark file that evaluate () makes. |
| 187 |
|
| 188 |
for x in * ; do |
| 189 |
if [ $x -nt clean_newer_than_me ] ; then |
| 190 |
rm $x |
| 191 |
fi |
| 192 |
done |
| 193 |
fi |
| 194 |
rm clean_newer_than_me |
| 195 |
} |
| 196 |
|
| 197 |
evaluate () |
| 198 |
{ |
| 199 |
echo > clean_newer_than_me |
| 200 |
sleep 1 |
| 201 |
{ |
| 202 |
echo |
| 203 |
echo Testing $1 under ${NAME}-${setting} |
| 204 |
echo Compiling... |
| 205 |
make_src_code $1 |
| 206 |
$COMP $1 |
| 207 |
i=0 |
| 208 |
while [ "$i" -lt "$NB_RUNS" ] |
| 209 |
do |
| 210 |
echo Running... |
| 211 |
$EXEC $1 |
| 212 |
i=`expr $i + 1` |
| 213 |
done |
| 214 |
cleanup |
| 215 |
} 2>&1 | tee -a ../../results.${NAME}-${setting} |
| 216 |
|
| 217 |
} |
| 218 |
|
| 219 |
make_src_code () |
| 220 |
{ |
| 221 |
case "$extension" in |
| 222 |
".awk") |
| 223 |
cat ../../src/$1.awk > $1.awk |
| 224 |
chmod +x $1.awk ;; |
| 225 |
".c") |
| 226 |
cat ../../src/$1.c > $1.c ;; |
| 227 |
".java") |
| 228 |
cat ../../src/$1.java > $1.java ;; |
| 229 |
".scm") |
| 230 |
printf "$PREFIXCODE\n" "$1" "$1" > $1-prefix.scm |
| 231 |
printf "$SUFFIXCODE\n" "$1" "$1" > $1-suffix.scm |
| 232 |
cat $1-prefix.scm ../../prefix/prefix-${system}.scm | sed "s/;INSERTCODE/$INSERTCODE/" | cat - ../../num-iters/${iterfile} ../../src/$1.scm ../../suffix/suffix-${system}.scm $1-suffix.scm > $1.scm ;; |
| 233 |
".ss") |
| 234 |
printf "$PREFIXCODE\n" "$1" "$1" > $1-prefix.scm |
| 235 |
printf "$SUFFIXCODE\n" "$1" "$1" > $1-suffix.scm |
| 236 |
cat ../../prefix/prefix-${system}.scm | sed "s/;INSERTCODE/$INSERTCODE/" | cat - ../../num-iters/${iterfile} ../../src/$1.scm ../../suffix/suffix-${system}.scm > $1-body.ss |
| 237 |
cat $1-prefix.scm $1-suffix.scm > $1.ss ;; |
| 238 |
esac |
| 239 |
} |
| 240 |
|
| 241 |
# ----------------------------------------------------------------------------- |
| 242 |
# For handling setting that does not exist for a given compiler |
| 243 |
|
| 244 |
nonexistent_comp () |
| 245 |
{ |
| 246 |
: |
| 247 |
} |
| 248 |
|
| 249 |
nonexistent_exec () |
| 250 |
{ |
| 251 |
: |
| 252 |
} |
| 253 |
|
| 254 |
# ----------------------------------------------------------------------------- |
| 255 |
# Definitions specific to Gambit-C compiler |
| 256 |
|
| 257 |
gambit_comp () |
| 258 |
{ |
| 259 |
{ |
| 260 |
echo $GSC $COMPOPTS $1.scm |
| 261 |
} | /usr/bin/time sh |
| 262 |
} |
| 263 |
|
| 264 |
gambit_exec () |
| 265 |
{ |
| 266 |
if test -f ./$1.o1 |
| 267 |
then $GSI -:m10000,d- ./$1.o1 |
| 268 |
fi |
| 269 |
} |
| 270 |
|
| 271 |
gambit_int_comp () |
| 272 |
{ |
| 273 |
: |
| 274 |
} |
| 275 |
|
| 276 |
gambit_int_exec () |
| 277 |
{ |
| 278 |
printf "$REPLCOMMANDS" "$1" | $GSI -:m10000,d- |
| 279 |
} |
| 280 |
|
| 281 |
# ----------------------------------------------------------------------------- |
| 282 |
# Definitions specific to bigloo compiler |
| 283 |
|
| 284 |
bigloo_comp () |
| 285 |
{ |
| 286 |
case $1 in |
| 287 |
ctak|dynamic|fibc|maze|puzzle|scheme) usecc="-call/cc" ;; |
| 288 |
*) usecc="" ;; |
| 289 |
esac |
| 290 |
/usr/bin/time $BIGLOO $usecc $COMPOPTS $1.scm -o $1 |
| 291 |
} |
| 292 |
|
| 293 |
bigloo_exec () |
| 294 |
{ |
| 295 |
if test -f ./$1 |
| 296 |
then ./$1 |
| 297 |
fi |
| 298 |
} |
| 299 |
|
| 300 |
bigloo_int_comp () |
| 301 |
{ |
| 302 |
: |
| 303 |
} |
| 304 |
|
| 305 |
bigloo_int_exec () |
| 306 |
{ |
| 307 |
printf "$REPLCOMMANDS" "$1" | /usr/bin/time $BIGLOO -heapsize 10 |
| 308 |
} |
| 309 |
|
| 310 |
# ----------------------------------------------------------------------------- |
| 311 |
# Definitions specific to Chicken compiler |
| 312 |
|
| 313 |
chicken_comp () |
| 314 |
{ |
| 315 |
{ |
| 316 |
echo $CSC $COMPOPTS $1.scm |
| 317 |
} | /usr/bin/time sh |
| 318 |
} |
| 319 |
|
| 320 |
chicken_exec () |
| 321 |
{ |
| 322 |
if test -f ./$1 |
| 323 |
then ./$1 -:hi10M -:hs0 |
| 324 |
fi |
| 325 |
} |
| 326 |
|
| 327 |
chicken_int_comp () |
| 328 |
{ |
| 329 |
: |
| 330 |
} |
| 331 |
|
| 332 |
chicken_int_exec () |
| 333 |
{ |
| 334 |
printf "$REPLCOMMANDS" "$1" | /usr/bin/time $CSI -:hi10M -:hs0 |
| 335 |
} |
| 336 |
|
| 337 |
# ----------------------------------------------------------------------------- |
| 338 |
# Definitions specific to MzScheme |
| 339 |
|
| 340 |
mzscheme_comp () |
| 341 |
{ |
| 342 |
: |
| 343 |
} |
| 344 |
|
| 345 |
mzscheme_exec () |
| 346 |
{ |
| 347 |
printf "$REPLCOMMANDS" "$1" | mzscheme $COMPOPTS |
| 348 |
} |
| 349 |
|
| 350 |
# ----------------------------------------------------------------------------- |
| 351 |
# Definitions specific to Scheme48 |
| 352 |
|
| 353 |
scheme48_comp () |
| 354 |
{ |
| 355 |
: |
| 356 |
} |
| 357 |
|
| 358 |
scheme48_exec () |
| 359 |
{ |
| 360 |
printf "$REPLCOMMANDS" "$1" | $SCHEME48 $COMPOPTS |
| 361 |
} |
| 362 |
|
| 363 |
# ----------------------------------------------------------------------------- |
| 364 |
# Definitions specific to Larceny |
| 365 |
|
| 366 |
larceny_comp () |
| 367 |
{ |
| 368 |
printf "$COMPCOMMANDS" "$1" | ${LARCENY} $COMPOPTS |
| 369 |
: |
| 370 |
} |
| 371 |
|
| 372 |
larceny_exec () |
| 373 |
{ |
| 374 |
printf "$EXECCOMMANDS" "$1" | ${LARCENY} $COMPOPTS |
| 375 |
} |
| 376 |
|
| 377 |
henchman_comp () |
| 378 |
{ |
| 379 |
: |
| 380 |
} |
| 381 |
|
| 382 |
henchman_exec () |
| 383 |
{ |
| 384 |
printf "$REPLCOMMANDS" "$1" | $HENCHMAN $COMPOPTS |
| 385 |
} |
| 386 |
|
| 387 |
# ----------------------------------------------------------------------------- |
| 388 |
# Definitions specific to Ikarus Scheme |
| 389 |
|
| 390 |
ikarus_comp () |
| 391 |
{ |
| 392 |
: |
| 393 |
} |
| 394 |
|
| 395 |
ikarus_exec () |
| 396 |
{ |
| 397 |
printf "$REPLCOMMANDS" "$1" | ikarus |
| 398 |
} |
| 399 |
|
| 400 |
|
| 401 |
# ----------------------------------------------------------------------------- |
| 402 |
# Definitions specific to Chez Scheme |
| 403 |
|
| 404 |
chez_comp () |
| 405 |
{ |
| 406 |
: |
| 407 |
} |
| 408 |
|
| 409 |
chez_exec () |
| 410 |
{ |
| 411 |
printf "$REPLCOMMANDS" "$1" | scheme |
| 412 |
} |
| 413 |
|
| 414 |
# ----------------------------------------------------------------------------- |
| 415 |
# Definitions specific to Petite Chez |
| 416 |
|
| 417 |
petite_chez_comp () |
| 418 |
{ |
| 419 |
: |
| 420 |
} |
| 421 |
|
| 422 |
petite_chez_exec () |
| 423 |
{ |
| 424 |
printf "$REPLCOMMANDS" "$1" | /usr/bin/time $PETITE_CHEZ |
| 425 |
} |
| 426 |
|
| 427 |
# ----------------------------------------------------------------------------- |
| 428 |
# Definitions specific to MIT Scheme |
| 429 |
|
| 430 |
mit_comp () |
| 431 |
{ |
| 432 |
{ |
| 433 |
echo "(compile-file \"$1.scm\")" | /usr/bin/time ${MIT} ${COMPOPTS} |
| 434 |
} |
| 435 |
} |
| 436 |
|
| 437 |
mit_exec () |
| 438 |
{ |
| 439 |
printf "$REPLCOMMANDS" "$1" | $MIT -heap 7000 |
| 440 |
} |
| 441 |
|
| 442 |
# ----------------------------------------------------------------------------- |
| 443 |
# Definitions specific to stalin |
| 444 |
|
| 445 |
stalin_comp () |
| 446 |
{ |
| 447 |
mv $1.scm $1.sc |
| 448 |
/usr/bin/time stalin -copt -O2 -Ob -Om -On -Or -Ot -s $1 |
| 449 |
} |
| 450 |
|
| 451 |
stalin_exec () |
| 452 |
{ |
| 453 |
if test -f ./$1 |
| 454 |
then /usr/bin/time ./$1 |
| 455 |
fi |
| 456 |
} |
| 457 |
|
| 458 |
# ----------------------------------------------------------------------------- |
| 459 |
# Definitions specific to scm |
| 460 |
|
| 461 |
scm_comp () |
| 462 |
{ |
| 463 |
: |
| 464 |
} |
| 465 |
|
| 466 |
scm_exec () |
| 467 |
{ |
| 468 |
printf "$REPLCOMMANDS" "$1" | /usr/bin/time scm -f |
| 469 |
} |
| 470 |
|
| 471 |
# ----------------------------------------------------------------------------- |
| 472 |
# Definitions specific to STk |
| 473 |
|
| 474 |
stk_comp () |
| 475 |
{ |
| 476 |
: |
| 477 |
} |
| 478 |
|
| 479 |
stk_exec () |
| 480 |
{ |
| 481 |
### Need to send output to /dev/null so that it doesn't hang when there's |
| 482 |
### an error... |
| 483 |
printf "$REPLCOMMANDS" "$1" | /usr/bin/time snow -f < /dev/null |
| 484 |
} |
| 485 |
|
| 486 |
# ----------------------------------------------------------------------------- |
| 487 |
# Definitions specific to AWK |
| 488 |
|
| 489 |
awk_comp () |
| 490 |
{ |
| 491 |
: |
| 492 |
} |
| 493 |
|
| 494 |
awk_exec () |
| 495 |
{ |
| 496 |
/usr/bin/time ./$1.awk |
| 497 |
} |
| 498 |
|
| 499 |
# ----------------------------------------------------------------------------- |
| 500 |
# Definitions specific to CC |
| 501 |
|
| 502 |
cc_comp () |
| 503 |
{ |
| 504 |
{ |
| 505 |
echo cc -O -o $1 $1.c -lm -lpthread |
| 506 |
} | /usr/bin/time sh |
| 507 |
ls -l $1 |
| 508 |
} |
| 509 |
|
| 510 |
cc_exec () |
| 511 |
{ |
| 512 |
if test -f ./$1 |
| 513 |
then /usr/bin/time ./$1 |
| 514 |
fi |
| 515 |
} |
| 516 |
|
| 517 |
# ----------------------------------------------------------------------------- |
| 518 |
# Definitions specific to GCC |
| 519 |
|
| 520 |
gcc_comp () |
| 521 |
{ |
| 522 |
{ |
| 523 |
echo gcc -O3 -o $1 $1.c -lm -lpthread |
| 524 |
} | /usr/bin/time sh |
| 525 |
ls -l $1 |
| 526 |
} |
| 527 |
|
| 528 |
gcc_exec () |
| 529 |
{ |
| 530 |
if test -f ./$1 |
| 531 |
then /usr/bin/time ./$1 |
| 532 |
fi |
| 533 |
} |
| 534 |
|
| 535 |
# ----------------------------------------------------------------------------- |
| 536 |
# Definitions specific to Java |
| 537 |
|
| 538 |
java_comp () |
| 539 |
{ |
| 540 |
{ |
| 541 |
echo javac $1.java |
| 542 |
} | /usr/bin/time sh |
| 543 |
ls -l $1.class |
| 544 |
} |
| 545 |
|
| 546 |
java_exec () |
| 547 |
{ |
| 548 |
/usr/bin/time java $1 |
| 549 |
} |
| 550 |
|
| 551 |
# ----------------------------------------------------------------------------- |
| 552 |
|
| 553 |
GABRIEL_BENCHMARKS="boyer browse cpstak ctak dderiv deriv destruc diviter divrec puzzle takl triangl" # fft tak trav1 trav2 |
| 554 |
|
| 555 |
KVW_BENCHMARKS="ack array1 cat string sum1 sumloop tail wc" |
| 556 |
|
| 557 |
#C_BENCHMARKS="fft fib fibfp mbrot nucleic pnpoly sum sumfp tak tfib $KVW_BENCHMARKS" |
| 558 |
C_BENCHMARKS="fft fib fibfp mbrot pnpoly sum sumfp tak $KVW_BENCHMARKS" |
| 559 |
|
| 560 |
#OTHER_BENCHMARKS="conform dynamic earley fibc graphs lattice matrix maze mazefun nqueens paraffins peval pi primes ray scheme simplex slatex" |
| 561 |
OTHER_BENCHMARKS="conform dynamic earley fibc graphs lattice matrix maze mazefun nqueens paraffins peval primes ray scheme simplex slatex perm9 nboyer sboyer gcbench symbtesting" |
| 562 |
|
| 563 |
NEW_BENCHMARKS="parsing gcold" |
| 564 |
|
| 565 |
AWK_BENCHMARKS="$KVW_BENCHMARKS" |
| 566 |
|
| 567 |
JAVA_BENCHMARKS="tfib" |
| 568 |
|
| 569 |
#ALL_BENCHMARKS="succeed fail crash $GABRIEL_BENCHMARKS $C_BENCHMARKS $OTHER_BENCHMARKS" |
| 570 |
ALL_BENCHMARKS="$GABRIEL_BENCHMARKS $C_BENCHMARKS $OTHER_BENCHMARKS $NEW_BENCHMARKS" |
| 571 |
|
| 572 |
ALL_INTERPRETERS='bigloo-int petite-chez gambit-int chicken-int scm stk' |
| 573 |
ALL_COMPILERS='gambit bigloo chicken mzscheme scheme48 larceny' |
| 574 |
ALL_GAMBIT='gambit gambit-int' |
| 575 |
ALL_NON_SCHEME='awk cc gcc java' |
| 576 |
ALL_SYSTEMS="$ALL_COMPILERS $ALL_INTERPRETERS $ALL_NON_SCHEME" |
| 577 |
|
| 578 |
## Arg processing... |
| 579 |
if [ "$#" -lt 2 ]; then |
| 580 |
error '>>> At least two command line arguments are needed' |
| 581 |
fi |
| 582 |
|
| 583 |
|
| 584 |
cmdline="$0" |
| 585 |
flagsdone=0 |
| 586 |
|
| 587 |
NB_RUNS=1 |
| 588 |
clean=true |
| 589 |
setting=r5rs |
| 590 |
options="" |
| 591 |
|
| 592 |
while [ $# -gt 2 ] ; do |
| 593 |
arg="$1" |
| 594 |
shift |
| 595 |
case $arg in |
| 596 |
-r) NB_RUNS=$1 ; shift ;; |
| 597 |
-c) clean=$1 ; shift ;; |
| 598 |
-i) forceiters=$1 ; shift ;; |
| 599 |
-s) setting=$1 ; shift ;; |
| 600 |
-o) options=$1 ; shift ;; |
| 601 |
*) error ">>> Unknown argument of $arg given." ;; |
| 602 |
esac |
| 603 |
done |
| 604 |
|
| 605 |
if [ "$#" -ne 2 ]; then |
| 606 |
error '>>> Last two arguments must be <systems> and <benchmarks>' |
| 607 |
fi |
| 608 |
|
| 609 |
case "$1" in |
| 610 |
all) systems="$ALL_SYSTEMS" ;; |
| 611 |
all-interpreters) systems="$ALL_INTERPRETERS" ;; |
| 612 |
all-compilers) systems="$ALL_COMPILERS" ;; |
| 613 |
all-gambit) systems="$ALL_GAMBIT" ;; |
| 614 |
*) systems="$1" ;; |
| 615 |
esac |
| 616 |
|
| 617 |
case "$2" in |
| 618 |
all) benchmarks="$ALL_BENCHMARKS" ;; |
| 619 |
gabriel) benchmarks="$GABRIEL_BENCHMARKS" ;; |
| 620 |
kvw) benchmarks="$KVW_BENCHMARKS" ;; |
| 621 |
other) benchmarks="$OTHER_BENCHMARKS" ;; |
| 622 |
awk) benchmarks="$AWK_BENCHMARKS" ;; |
| 623 |
c) benchmarks="$C_BENCHMARKS" ;; |
| 624 |
java) benchmarks="$JAVA_BENCHMARKS" ;; |
| 625 |
*) benchmarks="$2" ;; |
| 626 |
esac |
| 627 |
|
| 628 |
## Run each benchmark under each system... |
| 629 |
for system in $systems ; do |
| 630 |
|
| 631 |
case "$system" in |
| 632 |
|
| 633 |
gambit) NAME='Gambit-C' |
| 634 |
COMP=gambit_comp |
| 635 |
EXEC=gambit_exec |
| 636 |
iterfile=num-iters.scm |
| 637 |
extension=".scm" |
| 638 |
case "$setting" in |
| 639 |
mostly-fixflo) |
| 640 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 641 |
INSERTCODE="(declare (mostly-fixnum-flonum))(define-macro (if-fixflo yes no) no)" |
| 642 |
PREFIXCODE="; %s %s" |
| 643 |
SUFFIXCODE="; %s %s" |
| 644 |
REPLCOMMANDS="" |
| 645 |
;; |
| 646 |
mostly-flofix) |
| 647 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 648 |
INSERTCODE="(declare (mostly-flonum-fixnum))(define-macro (if-fixflo yes no) no)" |
| 649 |
PREFIXCODE="; %s %s" |
| 650 |
SUFFIXCODE="; %s %s" |
| 651 |
REPLCOMMANDS="" |
| 652 |
;; |
| 653 |
mostly-fix) |
| 654 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 655 |
INSERTCODE="(declare (mostly-fixnum))(define-macro (if-fixflo yes no) no)" |
| 656 |
PREFIXCODE="; %s %s" |
| 657 |
SUFFIXCODE="; %s %s" |
| 658 |
REPLCOMMANDS="" |
| 659 |
;; |
| 660 |
mostly-flo) |
| 661 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 662 |
INSERTCODE="(declare (mostly-flonum))(define-macro (if-fixflo yes no) no)" |
| 663 |
PREFIXCODE="; %s %s" |
| 664 |
SUFFIXCODE="; %s %s" |
| 665 |
REPLCOMMANDS="" |
| 666 |
;; |
| 667 |
mostly-generic) |
| 668 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 669 |
INSERTCODE="(declare (mostly-generic))(define-macro (if-fixflo yes no) no)" |
| 670 |
PREFIXCODE="; %s %s" |
| 671 |
SUFFIXCODE="; %s %s" |
| 672 |
REPLCOMMANDS="" |
| 673 |
;; |
| 674 |
sb-mostly-fixflo) |
| 675 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 676 |
INSERTCODE="(declare (standard-bindings) (mostly-fixnum-flonum))(define-macro (if-fixflo yes no) no)" |
| 677 |
PREFIXCODE="; %s %s" |
| 678 |
SUFFIXCODE="; %s %s" |
| 679 |
REPLCOMMANDS="" |
| 680 |
;; |
| 681 |
sb-mostly-flofix) |
| 682 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 683 |
INSERTCODE="(declare (standard-bindings) (mostly-flonum-fixnum))(define-macro (if-fixflo yes no) no)" |
| 684 |
PREFIXCODE="; %s %s" |
| 685 |
SUFFIXCODE="; %s %s" |
| 686 |
REPLCOMMANDS="" |
| 687 |
;; |
| 688 |
sb-mostly-fix) |
| 689 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 690 |
INSERTCODE="(declare (standard-bindings) (mostly-fixnum))(define-macro (if-fixflo yes no) no)" |
| 691 |
PREFIXCODE="; %s %s" |
| 692 |
SUFFIXCODE="; %s %s" |
| 693 |
REPLCOMMANDS="" |
| 694 |
;; |
| 695 |
sb-mostly-flo) |
| 696 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 697 |
INSERTCODE="(declare (standard-bindings) (mostly-flonum))(define-macro (if-fixflo yes no) no)" |
| 698 |
PREFIXCODE="; %s %s" |
| 699 |
SUFFIXCODE="; %s %s" |
| 700 |
REPLCOMMANDS="" |
| 701 |
;; |
| 702 |
sb-mostly-generic) |
| 703 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 704 |
INSERTCODE="(declare (standard-bindings) (mostly-generic))(define-macro (if-fixflo yes no) no)" |
| 705 |
PREFIXCODE="; %s %s" |
| 706 |
SUFFIXCODE="; %s %s" |
| 707 |
REPLCOMMANDS="" |
| 708 |
;; |
| 709 |
r5rs) |
| 710 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 711 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 712 |
PREFIXCODE="; %s %s" |
| 713 |
SUFFIXCODE="; %s %s" |
| 714 |
REPLCOMMANDS="" |
| 715 |
;; |
| 716 |
r6rs) |
| 717 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 718 |
INSERTCODE="(declare (standard-bindings) (extended-bindings) (block))(define-macro (if-fixflo yes no) no)" |
| 719 |
PREFIXCODE="; %s %s" |
| 720 |
SUFFIXCODE="; %s %s" |
| 721 |
REPLCOMMANDS="" |
| 722 |
;; |
| 723 |
r6rs-unsafe) |
| 724 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 725 |
INSERTCODE="(declare (standard-bindings) (extended-bindings) (block) (not safe))(define-macro (if-fixflo yes no) no)" |
| 726 |
PREFIXCODE="; %s %s" |
| 727 |
SUFFIXCODE="; %s %s" |
| 728 |
REPLCOMMANDS="" |
| 729 |
;; |
| 730 |
r6rs-fixflo) |
| 731 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 732 |
INSERTCODE="(declare (standard-bindings) (extended-bindings) (block))(define-macro (if-fixflo yes no) yes)" |
| 733 |
PREFIXCODE="; %s %s" |
| 734 |
SUFFIXCODE="; %s %s" |
| 735 |
REPLCOMMANDS="" |
| 736 |
;; |
| 737 |
r6rs-fixflo-unsafe) |
| 738 |
COMPOPTS="-dynamic -cc-options '$options'" |
| 739 |
INSERTCODE="(declare (standard-bindings) (extended-bindings) (block) (not safe))(define-macro (if-fixflo yes no) yes)" |
| 740 |
PREFIXCODE="; %s %s" |
| 741 |
SUFFIXCODE="; %s %s" |
| 742 |
REPLCOMMANDS="" |
| 743 |
;; |
| 744 |
esac |
| 745 |
;; |
| 746 |
|
| 747 |
gambit-sp) NAME='Gambit-C-sp' |
| 748 |
COMP=gambit_comp |
| 749 |
EXEC=gambit_exec |
| 750 |
iterfile=num-iters.scm |
| 751 |
extension=".scm" |
| 752 |
case "$setting" in |
| 753 |
mostly-fixflo) |
| 754 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 755 |
INSERTCODE="(declare (mostly-fixnum-flonum))(define-macro (if-fixflo yes no) no)" |
| 756 |
PREFIXCODE="; %s %s" |
| 757 |
SUFFIXCODE="; %s %s" |
| 758 |
REPLCOMMANDS="" |
| 759 |
;; |
| 760 |
mostly-flofix) |
| 761 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 762 |
INSERTCODE="(declare (mostly-flonum-fixnum))(define-macro (if-fixflo yes no) no)" |
| 763 |
PREFIXCODE="; %s %s" |
| 764 |
SUFFIXCODE="; %s %s" |
| 765 |
REPLCOMMANDS="" |
| 766 |
;; |
| 767 |
mostly-fix) |
| 768 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 769 |
INSERTCODE="(declare (mostly-fixnum))(define-macro (if-fixflo yes no) no)" |
| 770 |
PREFIXCODE="; %s %s" |
| 771 |
SUFFIXCODE="; %s %s" |
| 772 |
REPLCOMMANDS="" |
| 773 |
;; |
| 774 |
mostly-flo) |
| 775 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 776 |
INSERTCODE="(declare (mostly-flonum))(define-macro (if-fixflo yes no) no)" |
| 777 |
PREFIXCODE="; %s %s" |
| 778 |
SUFFIXCODE="; %s %s" |
| 779 |
REPLCOMMANDS="" |
| 780 |
;; |
| 781 |
mostly-generic) |
| 782 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 783 |
INSERTCODE="(declare (mostly-generic))(define-macro (if-fixflo yes no) no)" |
| 784 |
PREFIXCODE="; %s %s" |
| 785 |
SUFFIXCODE="; %s %s" |
| 786 |
REPLCOMMANDS="" |
| 787 |
;; |
| 788 |
sb-mostly-fixflo) |
| 789 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 790 |
INSERTCODE="(declare (standard-bindings) (mostly-fixnum-flonum))(define-macro (if-fixflo yes no) no)" |
| 791 |
PREFIXCODE="; %s %s" |
| 792 |
SUFFIXCODE="; %s %s" |
| 793 |
REPLCOMMANDS="" |
| 794 |
;; |
| 795 |
sb-mostly-flofix) |
| 796 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 797 |
INSERTCODE="(declare (standard-bindings) (mostly-flonum-fixnum))(define-macro (if-fixflo yes no) no)" |
| 798 |
PREFIXCODE="; %s %s" |
| 799 |
SUFFIXCODE="; %s %s" |
| 800 |
REPLCOMMANDS="" |
| 801 |
;; |
| 802 |
sb-mostly-fix) |
| 803 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 804 |
INSERTCODE="(declare (standard-bindings) (mostly-fixnum))(define-macro (if-fixflo yes no) no)" |
| 805 |
PREFIXCODE="; %s %s" |
| 806 |
SUFFIXCODE="; %s %s" |
| 807 |
REPLCOMMANDS="" |
| 808 |
;; |
| 809 |
sb-mostly-flo) |
| 810 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 811 |
INSERTCODE="(declare (standard-bindings) (mostly-flonum))(define-macro (if-fixflo yes no) no)" |
| 812 |
PREFIXCODE="; %s %s" |
| 813 |
SUFFIXCODE="; %s %s" |
| 814 |
REPLCOMMANDS="" |
| 815 |
;; |
| 816 |
sb-mostly-generic) |
| 817 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 818 |
INSERTCODE="(declare (standard-bindings) (mostly-generic))(define-macro (if-fixflo yes no) no)" |
| 819 |
PREFIXCODE="; %s %s" |
| 820 |
SUFFIXCODE="; %s %s" |
| 821 |
REPLCOMMANDS="" |
| 822 |
;; |
| 823 |
r5rs) |
| 824 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 825 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 826 |
PREFIXCODE="; %s %s" |
| 827 |
SUFFIXCODE="; %s %s" |
| 828 |
REPLCOMMANDS="" |
| 829 |
;; |
| 830 |
r6rs) |
| 831 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 832 |
INSERTCODE="(declare (standard-bindings) (extended-bindings) (block))(define-macro (if-fixflo yes no) no)" |
| 833 |
PREFIXCODE="; %s %s" |
| 834 |
SUFFIXCODE="; %s %s" |
| 835 |
REPLCOMMANDS="" |
| 836 |
;; |
| 837 |
r6rs-unsafe) |
| 838 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 839 |
INSERTCODE="(declare (standard-bindings) (extended-bindings) (block) (not safe))(define-macro (if-fixflo yes no) no)" |
| 840 |
PREFIXCODE="; %s %s" |
| 841 |
SUFFIXCODE="; %s %s" |
| 842 |
REPLCOMMANDS="" |
| 843 |
;; |
| 844 |
r6rs-fixflo) |
| 845 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 846 |
INSERTCODE="(declare (standard-bindings) (extended-bindings) (block))(define-macro (if-fixflo yes no) yes)" |
| 847 |
PREFIXCODE="; %s %s" |
| 848 |
SUFFIXCODE="; %s %s" |
| 849 |
REPLCOMMANDS="" |
| 850 |
;; |
| 851 |
r6rs-fixflo-unsafe) |
| 852 |
COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE" |
| 853 |
INSERTCODE="(declare (standard-bindings) (extended-bindings) (block) (not safe))(define-macro (if-fixflo yes no) yes)" |
| 854 |
PREFIXCODE="; %s %s" |
| 855 |
SUFFIXCODE="; %s %s" |
| 856 |
REPLCOMMANDS="" |
| 857 |
;; |
| 858 |
esac |
| 859 |
;; |
| 860 |
|
| 861 |
gambit-int) NAME='Gambit-C-int' |
| 862 |
COMP=gambit_int_comp |
| 863 |
COMPOPTS="" |
| 864 |
EXEC=gambit_int_exec |
| 865 |
iterfile=num-iters-int.scm |
| 866 |
extension=".scm" |
| 867 |
case "$setting" in |
| 868 |
r5rs) |
| 869 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 870 |
PREFIXCODE="; %s %s" |
| 871 |
SUFFIXCODE="; %s %s" |
| 872 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 873 |
;; |
| 874 |
r6rs) |
| 875 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 876 |
PREFIXCODE="; %s %s" |
| 877 |
SUFFIXCODE="; %s %s" |
| 878 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 879 |
;; |
| 880 |
r6rs-unsafe) |
| 881 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 882 |
PREFIXCODE="; %s %s" |
| 883 |
SUFFIXCODE="; %s %s" |
| 884 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 885 |
;; |
| 886 |
r6rs-fixflo) |
| 887 |
INSERTCODE="(define-macro (if-fixflo yes no) yes)" |
| 888 |
PREFIXCODE="; %s %s" |
| 889 |
SUFFIXCODE="; %s %s" |
| 890 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 891 |
;; |
| 892 |
r6rs-fixflo-unsafe) |
| 893 |
INSERTCODE="(define-macro (if-fixflo yes no) yes)" |
| 894 |
PREFIXCODE="; %s %s" |
| 895 |
SUFFIXCODE="; %s %s" |
| 896 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 897 |
;; |
| 898 |
esac |
| 899 |
;; |
| 900 |
|
| 901 |
bigloo) NAME='Bigloo' |
| 902 |
COMP=bigloo_comp |
| 903 |
EXEC=bigloo_exec |
| 904 |
iterfile=num-iters.scm |
| 905 |
extension=".scm" |
| 906 |
case "$setting" in |
| 907 |
r5rs) |
| 908 |
COMPOPTS="-O6 -copt -O3 -copt -fomit-frame-pointer" |
| 909 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 910 |
PREFIXCODE="; %s %s" |
| 911 |
SUFFIXCODE="; %s %s" |
| 912 |
REPLCOMMANDS="" |
| 913 |
COMP=nonexistent_comp |
| 914 |
EXEC=nonexistent_exec |
| 915 |
;; |
| 916 |
r6rs) |
| 917 |
COMPOPTS="-O6 -copt -O3 -copt -fomit-frame-pointer" |
| 918 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 919 |
PREFIXCODE="; %s %s" |
| 920 |
SUFFIXCODE="; %s %s" |
| 921 |
REPLCOMMANDS="" |
| 922 |
;; |
| 923 |
r6rs-unsafe) |
| 924 |
COMPOPTS="-Obench -copt -O3 -copt -fomit-frame-pointer" |
| 925 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 926 |
PREFIXCODE="; %s %s" |
| 927 |
SUFFIXCODE="; %s %s" |
| 928 |
REPLCOMMANDS="" |
| 929 |
;; |
| 930 |
r6rs-fixflo) |
| 931 |
COMPOPTS="-O6 -copt -O3 -copt -fomit-frame-pointer" |
| 932 |
INSERTCODE="(define-macro (if-fixflo yes no) yes)" |
| 933 |
PREFIXCODE="; %s %s" |
| 934 |
SUFFIXCODE="; %s %s" |
| 935 |
REPLCOMMANDS="" |
| 936 |
;; |
| 937 |
r6rs-fixflo-unsafe) |
| 938 |
COMPOPTS="-Obench -copt -O3 -copt -fomit-frame-pointer" |
| 939 |
INSERTCODE="(define-macro (if-fixflo yes no) yes)" |
| 940 |
PREFIXCODE="; %s %s" |
| 941 |
SUFFIXCODE="; %s %s" |
| 942 |
REPLCOMMANDS="" |
| 943 |
;; |
| 944 |
esac |
| 945 |
;; |
| 946 |
|
| 947 |
bigloo-int) NAME='Bigloo-int' |
| 948 |
COMP=bigloo_int_comp |
| 949 |
COMPOPTS="" |
| 950 |
EXEC=bigloo_int_exec |
| 951 |
iterfile=num-iters-int.scm |
| 952 |
extension=".scm" |
| 953 |
INSERTCODE="" |
| 954 |
PREFIXCODE="; %s %s" |
| 955 |
SUFFIXCODE="; %s %s" |
| 956 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 957 |
;; |
| 958 |
|
| 959 |
chicken) NAME='Chicken' |
| 960 |
COMP=chicken_comp |
| 961 |
EXEC=chicken_exec |
| 962 |
iterfile=num-iters.scm |
| 963 |
extension=".scm" |
| 964 |
# Possible improvement: should -disable-interrupts be used? What |
| 965 |
# is lost when -disable-interrupts is used? Is that a normal |
| 966 |
# mode of execution? |
| 967 |
case "$setting" in |
| 968 |
r5rs) |
| 969 |
COMPOPTS="-w -d0 -no-trace -no-usual-integrations" |
| 970 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 971 |
PREFIXCODE="; %s %s" |
| 972 |
SUFFIXCODE="; %s %s" |
| 973 |
REPLCOMMANDS="" |
| 974 |
;; |
| 975 |
r6rs) |
| 976 |
COMPOPTS="-w -d0 -O3 -no-trace -block" |
| 977 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 978 |
PREFIXCODE="; %s %s" |
| 979 |
SUFFIXCODE="; %s %s" |
| 980 |
REPLCOMMANDS="" |
| 981 |
;; |
| 982 |
r6rs-unsafe) |
| 983 |
COMPOPTS="-w -d0 -O3 -no-trace -block -unsafe -unsafe-libraries" |
| 984 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 985 |
PREFIXCODE="; %s %s" |
| 986 |
SUFFIXCODE="; %s %s" |
| 987 |
REPLCOMMANDS="" |
| 988 |
;; |
| 989 |
r6rs-fixflo) |
| 990 |
# It is impossible to use the fixnum/flonum specific |
| 991 |
# procedures in this setting because they are unsafe. |
| 992 |
COMPOPTS="-w -d0 -O3 -no-trace -block" |
| 993 |
INSERTCODE="(define-macro (if-fixflo yes no) no)" |
| 994 |
PREFIXCODE="; %s %s" |
| 995 |
SUFFIXCODE="; %s %s" |
| 996 |
REPLCOMMANDS="" |
| 997 |
COMP=nonexistent_comp |
| 998 |
EXEC=nonexistent_exec |
| 999 |
;; |
| 1000 |
r6rs-fixflo-unsafe) |
| 1001 |
COMPOPTS="-w -d0 -O3 -no-trace -block -unsafe -unsafe-libraries" |
| 1002 |
INSERTCODE="(define-macro (if-fixflo yes no) yes)" |
| 1003 |
PREFIXCODE="; %s %s" |
| 1004 |
SUFFIXCODE="; %s %s" |
| 1005 |
REPLCOMMANDS="" |
| 1006 |
;; |
| 1007 |
esac |
| 1008 |
;; |
| 1009 |
|
| 1010 |
chicken-int) NAME='Chicken-int' |
| 1011 |
COMP=chicken_int_comp |
| 1012 |
COMPOPTS="" |
| 1013 |
EXEC=chicken_int_exec |
| 1014 |
iterfile=num-iters-int.scm |
| 1015 |
extension=".scm" |
| 1016 |
INSERTCODE="" |
| 1017 |
PREFIXCODE="; %s %s" |
| 1018 |
SUFFIXCODE="; %s %s" |
| 1019 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 1020 |
;; |
| 1021 |
|
| 1022 |
mzscheme) NAME='MzScheme' |
| 1023 |
COMP=mzscheme_comp |
| 1024 |
EXEC=mzscheme_exec |
| 1025 |
iterfile=num-iters.scm |
| 1026 |
extension=".ss" |
| 1027 |
case "$setting" in |
| 1028 |
r5rs) |
| 1029 |
COMPOPTS="-q" |
| 1030 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1031 |
PREFIXCODE="; %s %s" |
| 1032 |
SUFFIXCODE="(require (lib \"include.ss\")) (include \"%s-body.ss\") (main) ; %s" |
| 1033 |
REPLCOMMANDS="(load \"%s.ss\")" |
| 1034 |
;; |
| 1035 |
r6rs) |
| 1036 |
COMPOPTS="-q" |
| 1037 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1038 |
PREFIXCODE="(module %s mzscheme (define-syntax body-src \"%s-body.ss\")" |
| 1039 |
SUFFIXCODE="(require (lib \"include.ss\")) (define-syntax (include-body stx) #\`(begin (include #,(syntax-local-value #'body-src)) (main))) (include-body)) ; %s %s" |
| 1040 |
REPLCOMMANDS="(require \"%s.ss\")" |
| 1041 |
;; |
| 1042 |
r6rs-unsafe) |
| 1043 |
# MzScheme does not seem to have an unsafe mode. |
| 1044 |
COMPOPTS="-q" |
| 1045 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1046 |
PREFIXCODE="(module %s mzscheme (define-syntax body-src \"%s-body.ss\")" |
| 1047 |
SUFFIXCODE="(require (lib \"include.ss\")) (define-syntax (include-body stx) #\`(begin (include #,(syntax-local-value #'body-src)) (main))) (include-body)) ; %s %s" |
| 1048 |
REPLCOMMANDS="(require \"%s.ss\")" |
| 1049 |
COMP=nonexistent_comp |
| 1050 |
EXEC=nonexistent_exec |
| 1051 |
;; |
| 1052 |
r6rs-fixflo) |
| 1053 |
# MzScheme does not seem to have fixnum/flonum specific arithmetic operators. |
| 1054 |
COMPOPTS="-q" |
| 1055 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1056 |
PREFIXCODE="(module %s mzscheme (define-syntax body-src \"%s-body.ss\")" |
| 1057 |
SUFFIXCODE="(require (lib \"include.ss\")) (define-syntax (include-body stx) #\`(begin (include #,(syntax-local-value #'body-src)) (main))) (include-body)) ; %s %s" |
| 1058 |
REPLCOMMANDS="(require \"%s.ss\")" |
| 1059 |
COMP=nonexistent_comp |
| 1060 |
EXEC=nonexistent_exec |
| 1061 |
;; |
| 1062 |
r6rs-fixflo-unsafe) |
| 1063 |
# MzScheme does not seem to have fixnum/flonum specific arithmetic operators. |
| 1064 |
# MzScheme does not seem to have an unsafe mode. |
| 1065 |
COMPOPTS="-q" |
| 1066 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1067 |
PREFIXCODE="(module %s mzscheme (define-syntax body-src \"%s-body.ss\")" |
| 1068 |
SUFFIXCODE="(require (lib \"include.ss\")) (define-syntax (include-body stx) #\`(begin (include #,(syntax-local-value #'body-src)) (main))) (include-body)) ; %s %s" |
| 1069 |
REPLCOMMANDS="(require \"%s.ss\")" |
| 1070 |
COMP=nonexistent_comp |
| 1071 |
EXEC=nonexistent_exec |
| 1072 |
;; |
| 1073 |
esac |
| 1074 |
;; |
| 1075 |
|
| 1076 |
scheme48) NAME='Scheme48' |
| 1077 |
COMP=scheme48_comp |
| 1078 |
EXEC=scheme48_exec |
| 1079 |
iterfile=num-iters.scm |
| 1080 |
extension=".scm" |
| 1081 |
case "$setting" in |
| 1082 |
r5rs) |
| 1083 |
COMPOPTS="-h 20000000" |
| 1084 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1085 |
PREFIXCODE="; %s %s" |
| 1086 |
SUFFIXCODE="; %s %s" |
| 1087 |
REPLCOMMANDS=",bench off\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n" |
| 1088 |
;; |
| 1089 |
r6rs) |
| 1090 |
COMPOPTS="-h 20000000" |
| 1091 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1092 |
PREFIXCODE="; %s %s" |
| 1093 |
SUFFIXCODE="; %s %s" |
| 1094 |
REPLCOMMANDS=",bench on\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n" |
| 1095 |
;; |
| 1096 |
r6rs-unsafe) |
| 1097 |
# Scheme48 does not seem to have an unsafe mode. |
| 1098 |
COMPOPTS="-h 20000000" |
| 1099 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1100 |
PREFIXCODE="; %s %s" |
| 1101 |
SUFFIXCODE="; %s %s" |
| 1102 |
REPLCOMMANDS=",bench on\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n" |
| 1103 |
COMP=nonexistent_comp |
| 1104 |
EXEC=nonexistent_exec |
| 1105 |
;; |
| 1106 |
r6rs-fixflo) |
| 1107 |
# Scheme48 does not seem to have fixnum/flonum specific arithmetic operators. |
| 1108 |
COMPOPTS="-h 20000000" |
| 1109 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1110 |
PREFIXCODE="; %s %s" |
| 1111 |
SUFFIXCODE="; %s %s" |
| 1112 |
REPLCOMMANDS=",bench on\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n" |
| 1113 |
COMP=nonexistent_comp |
| 1114 |
EXEC=nonexistent_exec |
| 1115 |
;; |
| 1116 |
r6rs-fixflo-unsafe) |
| 1117 |
# Scheme48 does not seem to have fixnum/flonum specific arithmetic operators. |
| 1118 |
# Scheme48 does not seem to have an unsafe mode. |
| 1119 |
COMPOPTS="-h 20000000" |
| 1120 |
PREFIXCODE="; %s %s" |
| 1121 |
SUFFIXCODE="; %s %s" |
| 1122 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1123 |
REPLCOMMANDS=",bench on\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n" |
| 1124 |
COMP=nonexistent_comp |
| 1125 |
EXEC=nonexistent_exec |
| 1126 |
;; |
| 1127 |
esac |
| 1128 |
;; |
| 1129 |
|
| 1130 |
larceny) NAME='Larceny' |
| 1131 |
COMP=larceny_comp |
| 1132 |
COMPOPTS="" |
| 1133 |
EXEC=larceny_exec |
| 1134 |
iterfile=num-iters.scm |
| 1135 |
extension=".scm" |
| 1136 |
PREFIXCODE="; %s %s" |
| 1137 |
SUFFIXCODE="; %s %s" |
| 1138 |
case "$setting" in |
| 1139 |
r5rs) |
| 1140 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1141 |
COMPSWITCHES="(compiler-switches 'standard)" |
| 1142 |
;; |
| 1143 |
r6rs) |
| 1144 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1145 |
COMPSWITCHES="(compiler-switches 'fast-safe)" |
| 1146 |
;; |
| 1147 |
r6rs-unsafe) |
| 1148 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1149 |
COMPSWITCHES="(compiler-switches 'fast-unsafe)" |
| 1150 |
;; |
| 1151 |
r6rs-fixflo) |
| 1152 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) yes)))" |
| 1153 |
COMPSWITCHES="(compiler-switches 'fast-safe)" |
| 1154 |
;; |
| 1155 |
r6rs-fixflo-unsafe) |
| 1156 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) yes)))" |
| 1157 |
COMPSWITCHES="(compiler-switches 'fast-unxsafe)" |
| 1158 |
;; |
| 1159 |
esac |
| 1160 |
REPLCOMMANDS="(begin $COMPSWITCHES (load \"%s.scm\") (main))" |
| 1161 |
COMPCOMMANDS="(begin $COMPSWITCHES (compile-file \"%s.scm\"))" |
| 1162 |
EXECCOMMANDS="(begin (load \"%s.fasl\") (main))" |
| 1163 |
;; |
| 1164 |
|
| 1165 |
henchman) NAME='Henchman' |
| 1166 |
COMP=henchman_comp |
| 1167 |
COMPOPTS="" |
| 1168 |
EXEC=henchman_exec |
| 1169 |
iterfile=num-iters.scm |
| 1170 |
extension=".scm" |
| 1171 |
PREFIXCODE="; %s %s" |
| 1172 |
SUFFIXCODE="; %s %s" |
| 1173 |
case "$setting" in |
| 1174 |
r5rs) |
| 1175 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1176 |
REPLCOMMANDS="(begin (compiler-switches 'standard) (load \"%s.scm\") (main))" |
| 1177 |
;; |
| 1178 |
r6rs) |
| 1179 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1180 |
REPLCOMMANDS="(begin (compiler-switches 'fast-safe) (load \"%s.scm\") (main))" |
| 1181 |
;; |
| 1182 |
r6rs-unsafe) |
| 1183 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1184 |
REPLCOMMANDS="(begin (compiler-switches 'fast-unsafe) (load \"%s.scm\") (main))" |
| 1185 |
;; |
| 1186 |
r6rs-fixflo) |
| 1187 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) yes)))" |
| 1188 |
REPLCOMMANDS="(begin (compiler-switches 'fast-safe) (load \"%s.scm\") (main))" |
| 1189 |
;; |
| 1190 |
r6rs-fixflo-unsafe) |
| 1191 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) yes)))" |
| 1192 |
REPLCOMMANDS="(begin (compiler-switches 'fast-unsafe) (load \"%s.scm\") (main))" |
| 1193 |
;; |
| 1194 |
esac |
| 1195 |
;; |
| 1196 |
|
| 1197 |
ikarus) NAME='Ikarus' |
| 1198 |
COMP=ikarus_comp |
| 1199 |
COMPOPTS="" |
| 1200 |
EXEC=ikarus_exec |
| 1201 |
iterfile=num-iters.scm |
| 1202 |
extension=".scm" |
| 1203 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1204 |
PREFIXCODE="; %s %s" |
| 1205 |
SUFFIXCODE="; %s %s" |
| 1206 |
case "$setting" in |
| 1207 |
r5rs) |
| 1208 |
REPLCOMMANDS="(begin (time (load \"%s.scm\")) (main))" |
| 1209 |
;; |
| 1210 |
r6rs) |
| 1211 |
REPLCOMMANDS="(begin (import scheme) (time (load \"%s.scm\")) (main))" |
| 1212 |
;; |
| 1213 |
esac |
| 1214 |
;; |
| 1215 |
|
| 1216 |
|
| 1217 |
chez) NAME='Chez-Scheme' |
| 1218 |
COMP=chez_comp |
| 1219 |
COMPOPTS="" |
| 1220 |
EXEC=chez_exec |
| 1221 |
iterfile=num-iters.scm |
| 1222 |
extension=".scm" |
| 1223 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1224 |
PREFIXCODE="; %s %s" |
| 1225 |
SUFFIXCODE="; %s %s" |
| 1226 |
case "$setting" in |
| 1227 |
r5rs) |
| 1228 |
REPLCOMMANDS="(begin (optimize-level 1) (load \"%s.scm\") (main))" |
| 1229 |
;; |
| 1230 |
r6rs) |
| 1231 |
REPLCOMMANDS="(begin (optimize-level 2) (load \"%s.scm\") (main))" |
| 1232 |
;; |
| 1233 |
r6rs-unsafe) |
| 1234 |
REPLCOMMANDS="(begin (optimize-level 3) (load \"%s.scm\") (main))" |
| 1235 |
;; |
| 1236 |
r6rs-fixflo) |
| 1237 |
REPLCOMMANDS="(begin (optimize-level 2) (load \"%s.scm\") (main))" |
| 1238 |
;; |
| 1239 |
r6rs-fixflo-unsafe) |
| 1240 |
REPLCOMMANDS="(begin (optimize-level 3) (load \"%s.scm\") (main))" |
| 1241 |
;; |
| 1242 |
esac |
| 1243 |
;; |
| 1244 |
|
| 1245 |
petite-chez) NAME='Petite-Chez-Scheme' |
| 1246 |
COMP=petite_chez_comp |
| 1247 |
COMPOPTS="" |
| 1248 |
EXEC=petite_chez_exec |
| 1249 |
iterfile=num-iters.scm |
| 1250 |
extension=".scm" |
| 1251 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1252 |
PREFIXCODE="; %s %s" |
| 1253 |
SUFFIXCODE="; %s %s" |
| 1254 |
case "$setting" in |
| 1255 |
r5rs) |
| 1256 |
REPLCOMMANDS="(begin (optimize-level 1) (load \"%s.scm\") (main))" |
| 1257 |
;; |
| 1258 |
r6rs) |
| 1259 |
REPLCOMMANDS="(begin (optimize-level 2) (load \"%s.scm\") (main))" |
| 1260 |
;; |
| 1261 |
esac |
| 1262 |
;; |
| 1263 |
|
| 1264 |
mit) NAME='MIT-Scheme' |
| 1265 |
COMP=mit_comp |
| 1266 |
COMPOPTS="-compiler -heap 6000" |
| 1267 |
EXEC=mit_exec |
| 1268 |
iterfile=num-iters.scm |
| 1269 |
extension=".scm" |
| 1270 |
PREFIXCODE="; %s %s" |
| 1271 |
SUFFIXCODE="; %s %s" |
| 1272 |
case "$setting" in |
| 1273 |
r5rs) |
| 1274 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1275 |
REPLCOMMANDS="(begin (load \"%s\") (main))" |
| 1276 |
;; |
| 1277 |
r6rs) |
| 1278 |
INSERTCODE="(declare (usual-integrations)) (define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1279 |
REPLCOMMANDS="(begin (load \"%s\") (main))" |
| 1280 |
;; |
| 1281 |
esac |
| 1282 |
;; |
| 1283 |
|
| 1284 |
mit-int) NAME='MIT-Scheme-int' |
| 1285 |
COMP=nonexistent_comp |
| 1286 |
COMPOPTS="" |
| 1287 |
EXEC=mit_exec |
| 1288 |
iterfile=num-iters-int.scm |
| 1289 |
extension=".scm" |
| 1290 |
PREFIXCODE="; %s %s" |
| 1291 |
SUFFIXCODE="; %s %s" |
| 1292 |
case "$setting" in |
| 1293 |
r5rs) |
| 1294 |
INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1295 |
REPLCOMMANDS="(begin (load \"%s\") (main))" |
| 1296 |
;; |
| 1297 |
r6rs) |
| 1298 |
INSERTCODE="(declare (usual-integrations)) (define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))" |
| 1299 |
REPLCOMMANDS="(begin (load \"%s\") (main))" |
| 1300 |
;; |
| 1301 |
esac |
| 1302 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 1303 |
;; |
| 1304 |
|
| 1305 |
scm) NAME='SCM' |
| 1306 |
COMP=scm_comp |
| 1307 |
COMPOPTS="" |
| 1308 |
EXEC=scm_exec |
| 1309 |
iterfile=num-iters-int.scm |
| 1310 |
extension=".scm" |
| 1311 |
INSERTCODE="" |
| 1312 |
PREFIXCODE="; %s %s" |
| 1313 |
SUFFIXCODE="; %s %s" |
| 1314 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 1315 |
;; |
| 1316 |
|
| 1317 |
stalin) NAME='Stalin' |
| 1318 |
COMP=stalin_comp |
| 1319 |
COMPOPTS="" |
| 1320 |
INSERTCODE="" |
| 1321 |
EXEC=stalin_exec |
| 1322 |
iterfile=num-iters.scm |
| 1323 |
extension=".scm" |
| 1324 |
INSERTCODE="" |
| 1325 |
PREFIXCODE="; %s %s" |
| 1326 |
SUFFIXCODE="; %s %s" |
| 1327 |
REPLCOMMANDS="" |
| 1328 |
;; |
| 1329 |
|
| 1330 |
stk) NAME='STk' |
| 1331 |
COMP=stk_comp |
| 1332 |
COMPOPTS="" |
| 1333 |
INSERTCODE="" |
| 1334 |
EXEC=stk_exec |
| 1335 |
iterfile=num-iters-int.scm |
| 1336 |
extension=".scm" |
| 1337 |
INSERTCODE="" |
| 1338 |
PREFIXCODE="; %s %s" |
| 1339 |
SUFFIXCODE="; %s %s" |
| 1340 |
REPLCOMMANDS="(load \"%s.scm\")" |
| 1341 |
;; |
| 1342 |
|
| 1343 |
awk) NAME='AWK' |
| 1344 |
COMP=awk_comp |
| 1345 |
COMPOPTS="" |
| 1346 |
INSERTCODE="" |
| 1347 |
EXEC=awk_exec |
| 1348 |
iterfile= |
| 1349 |
extension=".awk" |
| 1350 |
;; |
| 1351 |
|
| 1352 |
cc) NAME='CC' |
| 1353 |
COMP=cc_comp |
| 1354 |
COMPOPTS="" |
| 1355 |
INSERTCODE="" |
| 1356 |
EXEC=cc_exec |
| 1357 |
iterfile= |
| 1358 |
extension=".c" |
| 1359 |
;; |
| 1360 |
|
| 1361 |
gcc) NAME='GCC' |
| 1362 |
COMP=gcc_comp |
| 1363 |
COMPOPTS="" |
| 1364 |
INSERTCODE="" |
| 1365 |
EXEC=gcc_exec |
| 1366 |
iterfile= |
| 1367 |
extension=".c" |
| 1368 |
;; |
| 1369 |
|
| 1370 |
java) NAME='Java' |
| 1371 |
COMP=java_comp |
| 1372 |
COMPOPTS="" |
| 1373 |
INSERTCODE="" |
| 1374 |
EXEC=java_exec |
| 1375 |
iterfile= |
| 1376 |
extension=".java" |
| 1377 |
;; |
| 1378 |
|
| 1379 |
*) error '>>> Unknown system' |
| 1380 |
;; |
| 1381 |
esac |
| 1382 |
|
| 1383 |
if [ -n "$forceiters" ] ; then iterfile="$forceiters" ; fi |
| 1384 |
|
| 1385 |
cd sys/$system |
| 1386 |
if [ $? != 0 ] ; then |
| 1387 |
echo "ERROR: Can't change to directory sys/$system." |
| 1388 |
exit 1 |
| 1389 |
fi |
| 1390 |
|
| 1391 |
{ |
| 1392 |
echo |
| 1393 |
echo '****************************' |
| 1394 |
echo Benchmarking ${NAME}-${setting} on `date` under `uname -a` |
| 1395 |
} >> ../../results.${NAME}-${setting} |
| 1396 |
|
| 1397 |
for program in $benchmarks ; do |
| 1398 |
evaluate $program |
| 1399 |
done |
| 1400 |
cd ../.. |
| 1401 |
if [ $? != 0 ] ; then |
| 1402 |
echo "ERROR: Can't change back to benchmark directory." |
| 1403 |
exit 1 |
| 1404 |
fi |
| 1405 |
done |