how long does it take to build gcc45?

Ryan Schmidt ryandesign at macports.org
Wed Dec 8 11:50:35 PST 2010


On Dec 6, 2010, at 06:35, Gabriele Kahlout wrote:

> On 6 December 2010 00:29, Ryan Schmidt wrote:
> 
>> On Dec 5, 2010, at 22:00, Gabriele Kahlout wrote:
>> 
>> > I.e. how do I make it such g++ -v returns 4.5 and not 4.2?
>> 
>> Ah, I see:
>> 
>> > Sounds simple but my removing of g++ alias in usr/bin and replacement with a g++ that links to g++-mp-4.5 tells me that g++ is not executable. What was I supposed to do?
>> 
>> Install the gcc_select port, then run gcc_select. It will manage the symlinks for you (though in ${prefix}/bin, not in /usr/bin; you should undo any changes you made in /usr/bin).
> 
> Horray! (thank you!):
> 
> MacBook:bin simpatico$ sudo ./gcc_select -f mp-gcc45
> Selecting version "mp-gcc45" for gcc
> MacBook:bin simpatico$ g++ -v
> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin10/4.5.1/lto-wrapper
> Target: x86_64-apple-darwin10
> Configured with: ../gcc-4.5.1/configure --prefix=/opt/local --build=x86_64-apple-darwin10 --enable-languages=c,c++,objc,obj-c++,fortran,java --libdir=/opt/local/lib/gcc45 --includedir=/opt/local/include/gcc45 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.5 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.5 --with-gxx-include-dir=/opt/local/include/gcc45/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --enable-stage1-checking --disable-multilib --enable-fully-dynamic-string
> Thread model: posix
> gcc version 4.5.1 (GCC) 

Note that changing the default compiler (e.g. using gcc_select) could adversely affect a small number of ports.

Ports in MacPorts are *supposed* to not care; they're supposed to compile using a certain specific compiler. Usually that matches the default compiler for the OS (as dictated from on high by Apple, not as selected by you using gcc_select) -- that is, Apple gcc 4.2 on Snow Leopard, Apple gcc 4.0 and Leopard and Tiger. Individual ports may override that compiler and choose a different one as needed, for example cairo which uses Apple gcc 4.2 even on Leopard, because it has special needs.

The problem comes for the small number of ports that do not respect MacPorts' instructions to use a specific compiler. These ports will then build with whatever compiler you've gcc_selected, and this might cause them to fail to build properly or at all if you haven't selected the usual default compiler. If you find such a port, please file a ticket so we can fix that port to respect the MacPorts-dictated compiler.


Further reading:

http://trac.macports.org/wiki/UsingTheRightCompiler





More information about the macports-users mailing list