Brian Silverman | 72890c2 | 2015-09-19 14:37:37 -0400 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | if (($# < 2)); then |
| 4 | echo "Usage: $0 compilerlist.txt benchfile.cpp" |
| 5 | else |
| 6 | |
| 7 | compilerlist=$1 |
| 8 | benchfile=$2 |
| 9 | |
| 10 | g=0 |
| 11 | source $compilerlist |
| 12 | |
| 13 | # for each compiler, compile benchfile and run the benchmark |
| 14 | for (( i=0 ; i<g ; ++i )) ; do |
| 15 | # check the compiler exists |
| 16 | compiler=`echo ${CLIST[$i]} | cut -d " " -f 1` |
| 17 | if [ -e `which $compiler` ]; then |
| 18 | echo "${CLIST[$i]}" |
| 19 | # echo "${CLIST[$i]} $benchfile -I.. -o bench~" |
| 20 | # if [ -e ./.bench ] ; then rm .bench; fi |
| 21 | ${CLIST[$i]} $benchfile -I.. -o .bench && ./.bench 2> /dev/null |
| 22 | echo "" |
| 23 | else |
| 24 | echo "compiler not found: $compiler" |
| 25 | fi |
| 26 | done |
| 27 | |
| 28 | fi |