Last active
August 29, 2015 14:01
-
-
Save mroman42/dd3028088caa8813cfb2 to your computer and use it in GitHub Desktop.
Compila un programa probando varias optimizaciones
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 | |
CFLAGS="-flto -fopenmp -fwhole-program -Wall -Wl,--no-as-needed" | |
CXXFLAGS="$CFLAGS -std=c++0x" | |
LDFLAGS="-lm -lrt" | |
OPTS="-O0 -O1 -O2 -O3 -Os" | |
for code in *.cc; | |
do | |
for opt in $OPTS; | |
do | |
g++ $code $CFLAGS $CXXFLAGS $opt $LDFLAGS -o "${code%.cc}$1$opt" | |
echo "Tiempo ${code%.cc} $1$opt: `./${code%.cc}$1$opt $2`" | |
done | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment