Hello,

I use Fortran extensively on my Mac for my work (scientific computing -- all
applications are written in Fortran).  I have tried both of the methods that
you have below, but I've had problems with all of them.  The problem with
installing just gfortran through binaries is that they're typically
incompatible with the Xcode GCC compiler (they're different versions of
GCC), so it's far more difficult to link C- and Fortran- object files.  If
you do find one that's compatible with the Xcode GCC, then that means you're
using GCC 4.2, which is quite old. gfortran from that era is not yet stable
and reliable, especially for legacy F77.

IMO, the best approach is actually provided by MacPorts.  Just install an
updated GCC with the +gfortran variant.

sudo port -v install gcc45 +gfortran (this may take a little while)

Then you can install gcc_select to help manage different versions of the GCC
compiler (i.e. the xcode version and the MacPorts version, or multiple
MacPorts versions if you install gcc44, gcc43, gcc46, etc.)

sudo port -v install gcc_select (this should be fast)

To use gcc_select, do the following

gcc_select -l (lists all of the available versions)
sudo gcc_select mp-gcc45 (selects the GCC 4.5 installed with MacPorts)

Hope this helps,
Jason

On Fri, Jan 7, 2011 at 8:49 AM, Marcelo Chiapparini <
marcelo.chiappar...@gmail.com> wrote:

> Hi!
>
> I need to run FORTRAN in my iMac with OSX 10.6 installed. I've done some
> research, but the results are not conclusive:
>
> http://www.webmo.net/support/fortran_osx.html
> http://hpc.sourceforge.net/
> http://gcc.gnu.org/wiki/GFortranBinaries
> http://r.research.att.com/tools/
>
> I am not sure which method is the most convenient: to installing the
> FORTRAN binaries for Leopard or to installing the gfortran extension for
> Xcode... So, I would like very much to know about experiences from people
> already running FORTRAN in a Mac (if any!). Thanks a lot in advance for the
> help!
>
> Regards
>
> Marcelo
>
>
>
> _______________________________________________
> macports-users mailing list
> macports-users@lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
>
>


-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Graduate Student
352-392-4032
_______________________________________________
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to