| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
##################################################################### |
| 4 |
# # |
| 5 |
# Defines the best optimisation flags to use # |
| 6 |
# on the various platforms. This file is called # |
| 7 |
# by the faust2xxx scripts. It sets two variables # |
| 8 |
# $MYGCCFLAGS and $MYICCFLAGS # |
| 9 |
# (c) Grame, 2013 # |
| 10 |
# # |
| 11 |
##################################################################### |
| 12 |
|
| 13 |
#------------------------------------------------------------------- |
| 14 |
# Default compilation flags for gcc and icc : |
| 15 |
# |
| 16 |
if [ "$(uname -m)" = armv6l ]; then # for Raspberry PI |
| 17 |
MYGCCFLAGS="-std=c++14 -O3 -march=armv6zk -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -ffast-math -ftree-vectorize" |
| 18 |
elif [ "$(uname -s)" = Darwin ]; then # for macOS |
| 19 |
if [[ $(sysctl -n machdep.cpu.brand_string) =~ "Apple" ]]; then |
| 20 |
# Silicon MX |
| 21 |
MYGCCFLAGS="-std=c++14 -Ofast" |
| 22 |
else |
| 23 |
# Intel |
| 24 |
MYGCCFLAGS="-std=c++14 -Ofast -march=native" |
| 25 |
fi |
| 26 |
MYGCCFLAGSGENERIC="-std=c++14 -Ofast" |
| 27 |
else # for Linux (Intel) |
| 28 |
MYGCCFLAGS="-std=c++14 -Ofast -march=native" |
| 29 |
MYGCCFLAGSGENERIC="-std=c++14 -Ofast" |
| 30 |
fi |
| 31 |
|
| 32 |
# For Linux (intel) with icc |
| 33 |
MYICCFLAGS="-std=c++14 -O3 -xHost -ftz -fno-alias -fp-model fast=2" |
| 34 |
|
| 35 |
# Default compilers |
| 36 |
|
| 37 |
# Set default value for CXX |
| 38 |
: ${CXX:=c++} |
| 39 |
|
| 40 |
# Set default value for CC |
| 41 |
: ${CC:=cc} |
| 42 |
|
| 43 |
# For universal binaries creation on maxOS |
| 44 |
LIPO=lipo |
| 45 |
|
| 46 |
# For use with template-llvm.cpp |
| 47 |
if [[ $(uname) == Darwin ]]; then |
| 48 |
STRIP=-dead_strip |
| 49 |
else |
| 50 |
#STRIP=-strip (does not seem to work...) |
| 51 |
STRIP= |
| 52 |
fi |
| 53 |
|