gfortran with Xcode 4.3.2 unreliable

Sean Farley sean.michael.farley at
Sat Jun 9 10:47:05 PDT 2012

> 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:

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!

More information about the macports-users mailing list