Created
September 6, 2016 06:01
-
-
Save WPettersson/bd707015c09ddd7839e04b27ab9120a7 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
#!/usr/bin/env bash | |
REGINA_PATH=/path/to/regina | |
CCOPTS="-O3 -S -I/usr/include/python2.7 -I${REGINA_PATH}/engine -I${REGINA_PATH}/build/engine -I/usr/include/libxml2 -pthread -std=c++11 -DNDEBUG -fPIC -DREGINA_DLL_EXPORTS=1 -Dregina_engine_EXPORTS" | |
function testCompile { | |
file=$1 | |
g++ ${CCOPTS} -o optimised.s ${file} || exit | |
g++ ${CCOPTS} -fwrapv -o notoptimised.s ${file} || exit | |
if ! diff optimised.s notoptimised.s &> /dev/null ; then | |
bname=$(basename ${file}) | |
mv optimised.s ${bname}-optimised.s | |
mv notoptimised.s ${bname}-notoptimised.s | |
echo "Optimisation detected on ${file}" | |
fi | |
} | |
for file in $(find ${REGINA_PATH}/engine -name \*cpp) ; do | |
testCompile ${file} | |
done | |
for file in $(find ${REGINA_PATH}/utils/ -name \*cpp) ; do | |
testCompile ${file} | |
done | |
for file in $(find ${REGINA_PATH}/python/ -name \*cpp) ; do | |
testCompile ${file} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment