ICC benchmarking and ICC vs GCC

ICC benchmarking and ICC vs GCC


as you see I am new here in this forum.

I have a project comparing ICC vs GCC. I am looking for the best way to start this project. any links/ tutorial/ documentations are more than welcome.

thinking to do some benchmarking with both compilers using SPECInt or any other type of workloads/ programs.

Thanks for your help.


39 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Mourad,
Well, the best place to start is to skim through the user manual documentation on Optimization/features sections. There you'll find information on several optimization techniques from auto vectorization, parallelization, processor specific switches, IPO (inter procedural optimization) HPO (High perf optimization) etc. Of course, outside of this if you need to code etc., you'll find several parallelization models/techniques that you will be aware of (like OpenMP, CilkPlus (Array Notations, SIMD etc).

For Spec benchmarking you can look at AVX, AVX2, IPO, O3, -no-prec-div, -parallel -opt-prefetch etc...as a first shot and you can probe further after you read through the doc on optimization per-se.

Finally, there are several articles on optimization per-se that you can find in the Intel Developer Zone at  http://software.intel.com/ and go to the content for compilers and search for relavant knowledge base articles on performance guides etc under Development/Tools/Resources/Content Library section

Hope the above helps


Mourad B. wrote:


I have a project comparing ICC vs GCC. I am looking for the best way to start this project. any links/ tutorial/ documentations are more than welcome.

thinking to do some benchmarking with both compilers using SPECInt or any other type of workloads/ programs.

As you're probably aware, gcc doesn't have a group of optimizations to maximize SPECint performance under the benchmark rules.  Among your first steps are to determine, according to the manuals of both compilers, how consistent a set of options you wish to pick for each.

Assuming you are interested in benchmarking with a current architecture setting such as avx2, the set of options for gcc including -march=core-avx2 -ffast-math -O2 -ftree-vectorize -fno-cx-limited-range -fopenmp -funroll-loops --param max-unroll-times=2 -std=c99 (and several more) is rather complicated for consistency with icc -openmp -unroll2 -mavx2 -ansi-alias -std=c99.

In my experience, the avx2 support is good only in the latest icc release and gcc development version.  So there's another non-obvious decision which makes a big difference to your results.

Yet another are the particular (sometimes peculiar) choices of syntax each compiler prefers for optimization.

Good point Tim! Not all options that you can use with icc may be supported in gcc and your suggestions are certainly to the point....

Thanks a lot for your answers.

I will start testing, will let you know for the next step or any other issues. really appreciated 



Thanks, please let us know what you find and I'll pass it on to our product team - appreciate much.

I was trying to connect ICC to eclipse through these steps:

any help?


  1. Start Eclipse*.

  2. Select Help > Install New Software.

  3. Next to the Work with field, click the Add button. The Add Repository dialog opens.

  4. Click the Local button and browse to the install_dir/eclipse_support/cdt8.0/eclipse directory.

  5. Click OK.

  6. Make sure Group items by category is not checked. (its not) I cant see any item. I installed ICC and it's in my /opt/intel/studioxx/composerxxx/


Hi MrB,
Pardon the delay, just saw your question :-( Well, you should follow the steps outlined in the product release notes under the section: "Eclipse Integration" and you should be able to do so.  You'll need a proper version of Eclipse, CDT and a functional JRE installed and configured in your environment before you try and install. Under the section there in the release notes, you'll notice a section "How to Install the Intel C++ Eclipse Product Extension in Your Eclipse Platform" which you can follow...


HI Kittur,

Thanks for your reply.

I did check all requirements and everything looks normal.

so following "Click on the Local… button, specify the directory containing the Intel C++ Eclipse extension and confirm." I don't find any item?!

is there an other way to do it?




Hi MrB,

Yes you can just install the Composer XE if you just want to use the compiler per-se. BTW, make sure you have the compiler installed and the dir below exists. For example if you have installed the latest composer XE as root, you'll find the directory with the the Intel C++ Eclipse Product extension as below:
     cd /opt/intel/composer_xe_2013.<n>.<xxx>/eclipse_support/cdt8.0/eclipse

So to add the Intel C++ product extension to your existing Eclipse configuration, follow these steps, from within Eclipse.

1) Open the "Available Software" page by selecting: Help > Install New Software...Click on the "Add..." button. Select "Local...".

A directory browser will open. Browse to select the eclipse directory in your Intel C++ compiler installation. For example, if you installed the compiler as root to the default directory, you would browse to


Select “OK” to close the directory browser. Then select "OK" to close the “Add Site” dialog.
Select the two boxes for the Intel C++ integration:  there will be one box for “Intel® C++ Compiler Documentation” and a second box for “Intel® C++ Compiler XE 14.0 for Linux* OS”.

  *  The Intel features will not be visible if you have Group items by category set – unset this option to view the Intel features.
  *  Click the “Next” button. An “Install” dialog will open which gives you a chance to review and confirm you want to install the checked items. Click “Next”. You will now be asked to accept the license agreement. Accept the license agreement and click “Finish”. Select “OK” on the “Security Warning” dialog that says you are installing software that contains unsigned content.
The installation of the Intel support will proceed.

  * When asked to restart Eclipse, select “Yes”.
  * When Eclipse restarts, you will be able to create and work with CDT projects that use the Intel C++ compiler.

Also note: If your installation of Eclipse already has an earlier Intel® C++ Composer XE integration
installed, installing the updated integration will not work. You will need to install a fresh version
of Eclipse into which you can install the latest Composer XE integration. For this same reason,
using the Eclipse update mechanism to install a newer Composer XE integration will not work.

Let me know if the above helps?


Thanks for your reply.

Here what I have when I try to add the ICC features to my eclipse.



I see that the "Group items by Category" is enabled in the snapshot you show. Disable or uncheck that item. Once you do, the Intel features should become visible....


Thanks. I am trying to foloow the tutorial.

In /opt/intel/composer_xe_2013_sp1.2.144/Samples/en_US/C++/cilk_samples, I am trying to write a Makefile to compare the gcc vs icpc performance in qsort-mutex, qsort, matrix, linear-recurrence, matrix-multiply.

any idea or links for that type of comparison. The idea is just check with the same options if icpc is better than gcc and why?



an other question: How can I use the vectorization option with GCC to compare with the vectorized version of ICC. Here what I mean:


trying with gcc for the default option:

g++ Driver.o Multiply.o -o default


ROW:101 COL: 101
Execution time is 30.162 seconds
GigaFlops = 0.676403
Sum of result = 195853.999899

trying with icc for the default option:

icc Driver.o Multiply.o -o default


ROW:101 COL: 101
Execution time is 30.197 seconds
GigaFlops = 0.675631
Sum of result = 195853.999899

ICC after vectorization:

# ./default

ROW:101 COL: 101
Execution time is 8.740 seconds
GigaFlops = 2.334442
Sum of result = 195853.999899






While there is a cilkplus branch of gcc, and some of that is merged into gcc 4.10, gcc cilkplus isn't ready for release.   Nor does icc Cilk(tm) Plus offer competitive performance on other than a few selected applications.

I think you have missed the fact that g++ defaults to -O0.  Boosters of one compiler or another hope that you don't study the options of the others, but this is out of bounds.  Here are some roughly equivalent option groups:

icpc -unroll2 -xHost -ansi-alias

g++ -O2 -ftree-vectorize -ffast-math -funroll-loops --param max-unroll-times=2 -march=native -fno-cx-limited-range


g++ -O3 -ffast-math -funroll-loops --param max-unroll-times=2 -march=native -fno-cx-limited-range

If you use complex math, you should study the g++ -fcx-limited-range and equivalent icpc -complex-limited-range options.

I don't recall how the icc vector samples suggest dealing with aliasing.  The semi-portable way, which works with both icpc and g++, is with the * __restrict qualifiers.  Only the latest development versions of g++ support #pragma GCC ivdep.

For matrix algebra, icpc offers MKL library function options, or -O3 may be useful.  OpenMP programming (inherent in MKL and ACML) will be important for both icpc and g++. 

Although standard linux distros offer lapack and blas libraries compatible with g++, they tend to be compiled without full optimization or a current version of gfortran, and without OpenMP.  Due to the importance of threaded vector libraries such as MKL and ACML, matrix algebra isn't necessarily a meaningful arena for comparing compiler performance.

Tim has eloquently given you the correct info on Cilk etc. Like Tim mentioned, on vector samples use the __restrict qualifier to ensure non ambiguity and compiler can go ahead and vectorize......


I did mistakenly omit icpc option -ansi-alias   to assert that your source code complies with the rules about typed aliasing.  The equivalent g++ option -fstrict-aliasing is set by default.

Which reminds me I must check whether the icpc beta test compiler has changed this default.

Tim, I did check 15.0 beta and ansi-alias is enabled by default and to disable you'll have to use -no-ansi-alias option explicitly....


-ansi-alias apparently is intended to be default for linux going forward, but not for Windows. It's not consistently documented. It seems there will be now more cases where the option makes no difference, possibly due both to better optimization in some cases and to the compiler exerting more caution in other cases.

thanks for all your replies.

I am trying to build a config file for SPEC 2006 using ICC with the same flags as in GCC, like:

# NOTE: The F90 benchmarks will *not* work with this compiler
#       setting.
CC      = icc
CXX     = icpc
FC      = ifort
F77     = g77

I know that FC is ifort, what about F77 (its a GCC config)?

if you have a ready SPEC2000 or 2006 for ICC, it will be very helpful.

I have also an other issue running SPEC2000, see here:

                 *MatrixId, MatrixTkn.DbId, MatrixTkn.Handle))

oa1.c(1714): error: case label value has already appeared in this switch at line 1705
      case sizeof (tokentype )  :

oa1.c(1851): error: case label value has already appeared in this switch at line 1842
      case sizeof (tokentype )  :

compilation aborted for oa1.c (code 2)
specmake: *** [oa1.o] Error 2
specmake  options 2> options.err | tee options.out
COMP: icc -c -o options.o              -O3 -funroll-all-loops
LINK: icc       -O3 -funroll-all-loops     -lm  -o options
  Some files did not appear to be built: vortex
*** Error building 255.vortex
If you wish to ignore this error, please use '-I' or ignore errors.

Thanks a lot for your help.



g77 is an obsolete Fortran 77 compiler that was part of gcc. I would hope nobody is using it for SPEC anymore.

Steve - Intel Developer Support

Thanks Steve for responding on Fortran (Mr B, Steve is "the" Fortran Guru, fyi)

Well, I don't know if the performance team are willing or can share the config files (need to check). Of course, SPEC publishes the options used by the submitters of benchmark data so you can get that info from their site, fyi.


Normally you would use the same compiler for F77 and F90. SPEC entries have config posted.

BTW, the complete config files should be found on the Spec org site, so you can go to www.spec.org for download of related config files from various sponsors of the benchmarks, fyi.

Thanks for all of you.

I would like to do some optimization using the ICC. which flags you are recommending vs GCC (optimized version as well).

the idea is to have the spec perfromance for GCC vs ICC (baseline), GCC vs ICC (optimized version)?

Thanks for your help


MrB, well, what you can do is to go to to www.spec.org site and click on the results tab and from there say you can select the CPU2006 Search Form below and configure your advanced search to indicate a value for Compiler matches as: "Version of Intel C++". You'll get a dump of HW vendor, System, Disclosure etc., containing corresponding config file that you can click and view the complete configuration and see what options are used for each of the Spec tests.

For baseline, you can try -O2 optimization and see what you get with icc and gcc and you can also see what's used as default in config file for those tests also. Likewise, for optimization, you can again refer to the sort of flags used in the config file for the tests. In general, if you're running on a system with AVX2 for example, you can use for example with icc: -xCORE-AVX2 -ipo -O3 -no-prec-div -opt-prefetch and so on. Like wise, with GCC you can correspondingly use for example: -Ofast-march=core-avx2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables and so on.....

I think taking a look at the config files for published Spec benchmarks would be the way to go since you're running Spec....


Thanks Kittur.

I guess its the same thing for C and CXX?


COPTIMIZE       = -xCORE-AVX2 -ipo -O3 -no-prec-div -opt-prefetch
CXXOPTIMIZE     = -xCORE-AVX2 -ipo -O3 -no-prec-div -opt-prefetch


COPTIMIZE       = -Ofast-march=core-avx2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables
CXXOPTIMIZE     = -Ofast-march=core-avx2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables




MrB, yes it's the same for C and C++. The only time you want to use differently is when applications you compile for example use C++ features say then may have to use -std= option where is c++11 etc., during compilation but don't think you have such a scenario in the spec tests you're trying to compile/execute.


thanks Kittur.

in my config file I have wrote this and it's not working?! can you help?

for GCC:

#Optimization AVX
notes0080=   Baseline C: -Ofast-march=core-avx2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables
COPTIMIZE       = -Ofast-march=core-avx2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables
notes0080=   Baseline C++: -Ofast-march=core-avx2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables
CXXOPTIMIZE     = -Ofast-march=core-avx2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables

for ICC

notes0080=  Baseline C:   icc -xCORE-AVX2 -ipo -O3 -no-prec-div -opt-prefetch
COPTIMIZE       = -xCORE-AVX2 -ipo -O3 -no-prec-div -opt-prefetch
notes0080=  Baseline C++:   icpc -xCORE-AVX2 -ipo -O3 -no-prec-div -opt-prefetch
CXXOPTIMIZE     = -xCORE-AVX2 -ipo -O3 -no-prec-div -opt-prefetch



MrB, I searched the spec site and I have attached a config file (to this thread, that you can download) used for one of the hw vendor's cpu2006 test run. You can see clearly there how the general default values are set, and then how for each individual unit tests the values are changed accordingly and you can create one on similar lines.

BTW, the attached config file also shows usage of avx2 and other options like settings for CC, CXX, SSE used (avx, avx2, sse4.2 etc) and set proper values for each unit test and override defaults if need be explicitly.   BTW, make sure your system supports avx if you're using avx?  To check if your system supports avx, you can do %cat /proc/cpuinfo and look at the values in the 'flags" output. It will have avx or avx2 depending on the system. Hope this helps...



Download cpu2006-20131212-27767-cfg.doc13.98 KB

It looks like you omitted the space preceding -march=....
I've already made suggestions about unrolling options, so I don't expect further comments to have much influence.
It doesn't make much sense to benchmark gcc 3.45 (released 7 years ago) when no compilers that old are still supported, unless you hope to show the degree of progress made over those years. I don't think any linux distros based on such an old gcc support any current CPUs.
If you would be more explicit about probems you encountered, the responses you get might be more on target.

Tim, you're correct just noticed gcc345 in MrB's response.

Tim's correct, it's a very old version and would fail miserably on several features/optimizations that present versions of GCC supports. I'd suggest you use at least a version of GCC 4.4 and above for your benchmarking needs....


thanks for your answer

I have the results for GCC, GCC with optimization, ICC and ICC with Optimization flags:

the base rate for SPECInt2000 for GCC = 358, GCC with OPT= 359 and ICC=364/ ICC with OPT=385.

observation: no difference between the optimized and none optimized versions for GCC and ICC?

any thoughts? any suggestions for GCC or ICC default or optimized flags?  Thanks.

GCC with opt:

# Optimization flags      #
notes0080=   Baseline C: -O3 -march=core2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables
COPTIMIZE       = -O3 -march=core2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables
notes0081=   Baseline C++: -O3 -march=core2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables
CXXOPTIMIZE     = -O3 -march=core2 -mfpmath=sse -funroll-loops -fasynchronous-unwind-tables

ICC with opt:

notes0080= C: -xAVX -ipo -O3 -no-prec-div -opt-prefetch -opt-mem-layout-trans=3
COPTIMIZE=    -xAVX -ipo -O3 -no-prec-div -opt-prefetch -opt-mem-layout-trans=3
notes0081= C++: -xAVX -ipo -O3 -no-prec-div -opt-prefetch -opt-mem-layout-trans=3
CXXOPTIMIZE=  -xAVX -ipo -O3 -no-prec-div -opt-prefetch -opt-mem-layout-trans=3





Trying to install SPEC2006. following ./install.sh I have this:

benchspec/CPU2006/998.specrand/data/ref/input/control: FAILED open or read
benchspec/CPU2006/998.specrand/data/ref/output/rand.234923.out: FAILED open or read
benchspec/CPU2006/998.specrand/data/ref/reftime: FAILED open or read
benchspec/CPU2006/998.specrand/data/test/input/control: FAILED open or read
benchspec/CPU2006/998.specrand/data/test/output/rand.24239.out: FAILED open or read
benchspec/CPU2006/998.specrand/data/test/reftime: FAILED open or read
benchspec/CPU2006/998.specrand/data/train/input/control: FAILED open or read
benchspec/CPU2006/998.specrand/data/train/output/rand.3.out: FAILED open or read
benchspec/CPU2006/998.specrand/data/train/reftime: FAILED open or read
benchspec/CPU2006/998.specrand/src/Makefile: FAILED open or read
benchspec/CPU2006/998.specrand/src/main.c: FAILED open or read
benchspec/CPU2006/998.specrand/src/specrand.c: FAILED open or read
benchspec/CPU2006/998.specrand/src/specrand.h: FAILED open or read


Is that normal???



Hi MrB,
Just back from my vacation and saw your question. Well, it's been sometime ago that I ran spec but you shouldn't be getting such errors and I quickly checked on the Errata for Spec and it doesn't show such errors you mention so something else must be going on. I'll need to investigate this and may be check with our dev team who run spec bmarks with our compiler and will let you know, appreciate much.

Hi MrB,
I chatted with Jin Lin my peer and was told that you now have no issue with Spec install. Let me know otherwise, appreciate much.

Thanks Kittur,

Yes I am working with Jin. he is helping me :)


Great, I'll sync up with Jin MrB, thanks.

Hi Mourad,
    I'll consider this issue resolved as we sync-ed up and all's taken care of, thanks!

Leave a Comment

Please sign in to add a comment. Not a member? Join today