User forums > Using Code::Blocks

GCC Optimization

(1/2) > >>

nickrt:
Hello - I hope this is the right place! Firstly I love Code:Blocks as a development environment!!
Quick question - does the included GCC compiler (in PC environment?) support (a) 64-bit code generation and (b) the -mtune=core2 (or even core4?!) optimizations? I have developed some very maths intensive code that needs to run as fast as jolly well possible!!

Thanks for any help/suggestions!!

Nick

CBLaw:
Hey nickrt, I'm no pro, but. if you right click your project and select 'build options' you can set up the GCC compiler. On my machine I'm seeing 'Intel Pentium 4 Nocona (MMX SSE SSE2, SSE3, 64-bit extensions) listed about 2/3 of the down the list of compiler flags.  Of course this is only one of many CPU's you can build for. Hope this helps...

thomas:
There is no difference between Core 2 and what you call "Core 4". The latter is Core 2 with two extra cores, other than that, quad-core and dual-core CPUs of the same generation are identical.

The Core 2 architecture is supported by MinGW/gcc versions 4.3 and up. The official MinGW branch does not support 64-bit code generation, however there is an inofficial MinGW64 project doing that.
Under Linux/BSD/whatever, gcc certainly supports 64-bit code generation, has been for years.

So, no and no.

nickrt:
Hello

Thank you for the help!

Having looked, it seems that for scientific applications, where the speed of "heavy" maths functions is important, the Intel C compiler is the best (http://software.intel.com/en-us/intel-compilers/).  Does the Code:Blocks environment support this compiler - as I am thinking of investing and would like to stay within the same development environment?

With GCC, I have found that there is an entire "art" to optimization and choice of the command-line options.  For my specific needs I use:

-mtune=nocona
-fomit-frame-pointer
-ffast-math
-fstrict-aliasing
-pipe
-malign-double
-fno-exceptions
-funsafe-math-optimizations
-mfpmath=sse
-msse2

These are all set in the Project-Build-Options, under "other options" (I used them for Release). Along with the following ticked:

Optimize full for speed
i686
Expensive optimizations

There is much discussion on the web on how the different options interact and which produce "better" code!!

Anyones input on the Intel compilers (for Windows and Linux) would be appreciated  :lol:

Ceniza:
Code::Blocks supports Intel's compiler, so it would not be a problem.

About optimizations... that's something you would have to try for yourself. You may want to search for GCC vs Intel comparisons (one which compares recent versions of both). See if the results convince you.

Navigation

[0] Message Index

[#] Next page

Go to full version