1#!/bin/bash
2
3if (($# < 2)); then
4    echo "Usage: $0 compilerlist.txt benchfile.cpp"
5else
6
7compilerlist=$1
8benchfile=$2
9
10g=0
11source $compilerlist
12
13# for each compiler, compile benchfile and run the benchmark
14for (( 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
26done
27
28fi
29