File: bench_multi_compilers.sh

package info (click to toggle)
eigen3 3.2.1-2~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 11,680 kB
  • sloc: cpp: 74,426; fortran: 26,495; ansic: 25,724; sh: 709; python: 172; makefile: 27
file content (28 lines) | stat: -rwxr-xr-x 618 bytes parent folder | download | duplicates (26)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

if (($# < 2)); then
    echo "Usage: $0 compilerlist.txt benchfile.cpp"
else

compilerlist=$1
benchfile=$2

g=0
source $compilerlist

# for each compiler, compile benchfile and run the benchmark
for (( i=0 ; i<g ; ++i )) ; do
  # check the compiler exists
  compiler=`echo ${CLIST[$i]} | cut -d " " -f 1`
  if [ -e `which $compiler` ]; then
    echo "${CLIST[$i]}"
#     echo "${CLIST[$i]} $benchfile -I.. -o bench~"
#     if [ -e ./.bench ] ; then rm .bench; fi
    ${CLIST[$i]} $benchfile -I.. -o .bench && ./.bench 2> /dev/null
    echo ""
  else
    echo "compiler not found: $compiler"
  fi
done

fi