Re: use a different default configure.compiler (was: UsingTheRightCompiler)

2012-04-16 Thread Ryan Schmidt

On Apr 15, 2012, at 23:04, Jeff Singleton wrote:

 I just can't say a lot for Clang.  I have mentioned this before.  I have 
 taken many suggestions.  Tried Tried and Tried some more to like Clang.
 
 I just can't do it.
 
 Its ugly.  It causes more problems between ports that depend on one another, 
 yet some are built with Clang, other built with GCC.

I've not heard of any problems related to some ports being built with clang and 
others built with other compilers; if you have examples of this please let us 
know.


 I am simply fed up with Clang and I don't really want to use it anymore. 
 Clang does't respect architecture settings, no matter which I use (i386 or 
 x86_64).

clang of course does respect -arch settings. If individual ports that are 
compiling with an Xcode compiler (gcc-4.2, llvm-gcc-4.2 or clang) do not 
respect -arch settings, please file bug reports against those ports. (MacPorts 
gcc compilers do not respect -arch flags, so ports that use them cannot be made 
to respect -arch flags either.)


 Case and point - Pango crashes during compile no matter which Arch I use:
 
 libtool: link: /usr/bin/clang  -o .libs/pango-basic-coretext.so -bundle  
 .libs/basic-coretext.o   -framework Carbon -L/opt/local/lib  -O2 -arch x86_64 
 -arch x86_64   -framework Carbon 
 -Wl,-exported_symbols_list,.libs/pango-basic-coretext-symbols.expsym
 Undefined symbols for architecture x86_64:
 snip unnecessary error output
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see 
 invocation)
 
 I am just sick of running into linking errors -- either they happen now, or 
 they happen eventually during an upgrade.  Either way, I usually end up 
 getting frustrated, and wiping out my whole ports tree, and attempt to 
 rebuild from scratch.
 
 In this case…I still hit that link error with Pango.

The unnecessary error output you snipped above might have been just what we 
needed to know whether this is a problem we've seen before or not. I have a 
feeling this is #32722 — which is not clang-specific, by the way; I see it on 
my Snow Leopard machine too, using gcc-4.2. The problem here is the quartz 
and/or no_x11 variants. I have enlisted the help of the pango developers in 
understanding why this is happening and how to fix it.


 Would someone PLEASE just tell me how I can force the default compiler to be 
 GCC. No configure.compiler does not work, and no environment variables CC CPP 
 CXX do not work.  I have both set to gcc-4.2 and yet Pango still defaults to 
 use Clang and crashes no matter what I try.
 
 I don't want to edit every single Portfile when I hit this issue, because 
 when I sync again, my changes go away.
 
 There simply HAS to be some way of forcing Macports to use the compiler that 
 I want to use and not argue and not make changes whenever and just do what I 
 tell it to.
 
 Is that so much to ask?  Can I please just use GCC and never EVER have to see 
 another Clang linking error again. PLEASE!???!

As of MacPorts 2.1.0 beta 1 yes you can override the default value of 
configure.compiler than MacPorts chose for you, so feel free to upgrade to that 
version and change the appropriate value in macports.conf. Note that individual 
ports might specify an alternate compiler, if it is already known that using a 
particular compiler will not work (but I can't think of many ports that 
wouldn't work with Apple gcc 4.2). Note that Xcode 4.2 and up no longer include 
any Apple gcc compilers, so you cannot set configure.compiler to gcc-4.2 if you 
have Xcode 4.2 or later. You can however install the apple-gcc42 port, which is 
basically the same thing, and set configure.compiler to apple-gcc-4.2.



___
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users


Re: use a different default configure.compiler (was: UsingTheRightCompiler)

2012-04-16 Thread vincent habchi
Hi everybody,

Le 16 avr. 2012 à 09:00, Ryan Schmidt ryandes...@macports.org a écrit :

 
 On Apr 15, 2012, at 23:04, Jeff Singleton wrote:
 
 I just can't say a lot for Clang.  I have mentioned this before.  I have 
 taken many suggestions.  Tried Tried and Tried some more to like Clang.
 
 I just can't do it.
 
 Its ugly.  It causes more problems between ports that depend on one another, 
 yet some are built with Clang, other built with GCC.
 
 I've not heard of any problems related to some ports being built with clang 
 and others built with other compilers; if you have examples of this please 
 let us know.

My own experience is that Clang works fine. LLVM based tools are now used 
extensively, be it by Apple for traditional GCC substitution, or by other 
companies like, e.g. NVidia for its OpenGL JIT compiler. LLVM is modern, 
extensible, modular and easily ported to any hardware whereas GCC is hoary, 
monolithic and totally cryptic, let alone code documentation. 

The only drawback I still see to the use of Clang is its inferior performance 
when it comes to floating point brute force. In fact, I carried out some tests 
with Clang on Atlas latest development version. Good news is that Clang works 
fine, even with AVX assembly; Bad news is that performance is still worse than 
GCC, sometimes by more than 40%, at least on Linux. On OS X, no comparison is 
possible since the provided assembler ‘/usr/bin/as’ is antiquated and does not 
recognize AVX instructions, and using Clang as an assembler fails because GCC 
emits non Intel compliant instructions that llvm-mc does not recognize. This 
might be slightly different on OS X because since LLVM is basically Apple 
driven there might be additional optimizations enabled for Darwin. But there is 
still room for additional improvements.

Additional tools like a new linker, lld, are underway; It will eventually 
replace ld64.

By the way, is it possible to add GCC 4.7 as a possible compiler?

Vincent



___
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users


Re: use a different default configure.compiler (was: UsingTheRightCompiler)

2012-04-16 Thread Ryan Schmidt

On Apr 16, 2012, at 04:46, vincent habchi wrote:

 By the way, is it possible to add GCC 4.7 as a possible compiler?

That's in 2.1.0 beta 1:

https://trac.macports.org/browser/tags/release_2_1_0-beta1/base/ChangeLog#L7

___
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users