Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.

Optimal performance compiler flags

jpburke
Beginner
170 Views
Hello - Can someone suggest the optimal performance compiler flags for 2nd gen i7 using GCC4.6.1 and the latest ICC Composer 12.1.3 ? I need to create 32 bit and 64 bit executables to run on Linux.

For GCC, I'm using -O3 -march=corei7-avx -mtune=corei7-avx

For ICC, -O3 -fast -march=corei7-avx -mkl -ipp

Any suggestions would be appreciated.

Thanks - JB
0 Kudos
2 Replies
styc
Beginner
170 Views
How about enable cross-file optimization with -flto for GCC and -ipo for ICC?
xunxun
Beginner
170 Views
GCC can use

Compiler Option:

-Ofast -march=native -fomit-frame-pointer -minline-all-stringops -malign-double -ftree-vectorize
-ftree-loop-linear -fgraphite-identity -floop-interchange -floop-block -floop-parallelize-all -fforce-addr
-flto -ftree-parallelize-loops=n (n is your core numbers)

Linker Option

-flto -fuse-linker-plugin -lgomp -lpthread -Wl,-O1 -Wl,--as-needed -Wl,-s
Reply