Author Topic: Targets  (Read 5303 times)

Offline jonjonzz

  • Single posting newcomer
  • *
  • Posts: 3
Targets
« on: May 16, 2014, 06:18:39 pm »
Hello,

I work on a computer running an Intel Core I5 processor.
I have downloaded the 13.12 release of Code::Blocks.
My development is with C.

When I compile my source code I can read :
mingw32-gcc.exe -Wall -g  -c H:\Essais_CB\ConsolePrompt\main.c -o obj\Debug\main.o
etc....

Questions:

1/ Why mingw32-gcc.exe ? The Intel Core I5 is 64 bits. Am-I not supposed to run mingw64-gcc.exe instead ?

2/ On the Compiler Settings, I do not see any flag checked. I mean that no explicit target is checked. I can see a flag for Intel Core 2, Intel Core I7, and other processors, but nothing for Intel Core I5.
How to make sure that the generated .EXE file matches the code for Intel Core I5 ?

Thank you for the answers.






Online stahta01

  • Lives here!
  • ****
  • Posts: 7789
    • My Best Post
Re: Targets
« Reply #1 on: May 16, 2014, 06:31:24 pm »
Code::Blocks is NOT a Compiler.
For the ease of Windows user, there are versions of CB that has MinGW GCC installed with CB.

Pick your compiler, install your compiler.
Configure the CB Toolchain to use that compiler as the default.
http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler


Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Vuki

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Targets
« Reply #2 on: May 17, 2014, 11:10:54 am »
Since the topic hasn't been locked and the question is slightly CB related:

1. It depends whether you develop code for 32 or 64 bit OS. CB 13.12 ships with 32 bit compiler. If you need 64 bit compiler, install TDM MinGW 64 bit.

2. Use I7 flags. Or, if you want to run the code only on your machine, you may use the compiler flag: -march=native.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 824
Re: Targets
« Reply #3 on: May 17, 2014, 12:54:27 pm »
More :
it's not because your processor and your OS is 64 bits that you need to compile in 64 bits. Many many application running on Windows 64 are still 32 bits applications : Windows supports this.
Codeblocks itself, as distributed for Windows, is a 32 bits application and it works perfectly, as expected, in 64 bits (OS and processor).
TDM 64 bits version of compilers have standard name like x86_64-w64-mingw32-gcc.exe, so it contains mingw32, I think because it can produce 64 bits application by defalut and 32 bits too (-m32 option).
You may need a 64 bits application for speed reasons (may be !), or for using very big arrays in your code.
But as told previously, this is not totally CB related : it's more a problem like which compiler to use for your needs, and CB supports many different compilers (32 and/or 64 bits on Windows).

gd_on
Windows 11 64 bits (24H2), svn C::B (last version or almost!), wxWidgets 3.2.8 (tests with 3.3), Msys2 Compilers 15.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline jonjonzz

  • Single posting newcomer
  • *
  • Posts: 3
Re: Targets
« Reply #4 on: May 19, 2014, 06:44:56 pm »
Thank you all for the information.