mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
29 lines
618 B
Bash
Executable File
29 lines
618 B
Bash
Executable File
#!/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
|