-
-
Save fdavidcl/dedf154e3de34ffeccd4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# David Charte, Ignacio Cordón y Mario Román | |
# Parámetros | |
# 1 - regla para encontrar los archivos a compilar | |
# 2 - argumento a pasar al programa | |
CFLAGS="-flto -fopenmp -fwhole-program -Wall -Wl,--no-as-needed" | |
CXXFLAGS="$CFLAGS -std=c++0x" | |
LDFLAGS="-lm -lrt" | |
OPTS="-O0 -O1 -O2 -O3 -Os" | |
FILES=`ls $1` | |
for code in $FILES | |
do | |
for opt in $OPTS | |
do | |
name="${code%.cc}$opt" | |
g++ $code $CFLAGS $CXXFLAGS $opt $LDFLAGS -o $name | |
echo $code - $opt - `./$name $2` | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment