gfortran with Xcode 4.3.2 unreliable

Jason Swails jason.swails at
Sat Jun 9 11:56:55 PDT 2012

On Sat, Jun 9, 2012 at 1:47 PM, Sean Farley
<sean.michael.farley at>wrote:

> > There was a thread ~1 month ago regarding gfortran that was acting
> > strangely.  Here's a link to that
> > thread:
> >
> > I haven't seen any responses or anything to this, and I was wondering if
> > anyone else had run into issues trying to use gfortran from any of the
> gcc4X
> > builds using Xcode 4.3.x on Lion.
> >
> > There seems to be something *seriously* wrong with the Fortran compiler
> > built with MacPorts -- in a very Fortran-heavy program suite, nearly
> half of
> > the tests are suddenly failing when built with these compilers even after
> > the selected_real_kind() issues are resolved.  And the failures are not
> > blatantly ridiculous, they're subtle, but currently I'm wary of trusting
> > anything the MacPorts-built GCC compilers (at least the Fortran
> compilers)
> > spit out.
> Yes, you are correct that this is seriously wrong and very subtle. The
> issue is with gmp and causes gfortran to erroneously double the size
> of (at least) ints. I opened a ticket here with a patch:

It's not just ints -- it's floats, too.  reals are erroneously passed as
doubles, and doubles as 10-byte floats (??), but only sometimes...  It's
hard to determine what exactly is happening (especially since I'm more of a
user of programming and less of a pure programmer).

However, a comprehensive test suite that tests out fine with GCC 4.2, 4.3,
4.4, 4.5, 4.6, and 4.7, along with all flavors of (buggy) intel fortran
compilers, and the PGI compilers all fail with this particular gfortran
build.  I will look through your patch and see if it fixes my problems
(this is affecting quite a few users of this program suite).  If so,
hopefully the port maintainer (or some other dev) can apply this fix,
because just fixing it for me is not enough (I have the 10.6 SDK, so I'm
not even affected by this).

For what it's worth, the compilers on appear to work
just fine, but I'm not a fan of always using the bleeding-edge,
latest-checkout-version of the compiler suite...  It's bitten me on a
couple of occasions.

> that fixes the gmp issue and also fixes debuggers loading shared
> symbols; but haven't heard back from the macports devs at all on the
> issue. You should be able to apply the patch yourself and rebuild
> everything from source with the -s option:
> $ sudo port uninstall --follow-dependents gmp
> $ sudo port -vs install gcc47
> or whichever gcc you have installed. Hope that helps!

The debug symbols are great!  Thanks for this!


Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list