Os X + Fortran

Discussion in 'Mac Programming' started by navier-stokes, Oct 9, 2008.

  1. navier-stokes macrumors newbie

    Mar 19, 2008
    Hi all,

    I'm going to buy a new mac in a week or two and will be looking to do small amounts of programming on it. Currently I am using XP + MS Visual Studio + Intel's Fortran compiler... I have no experience with working on a mac at all...

    Can someone point me in the right direction of a decent, free, Fortran compiler for OS X?

    And also, how do you generally go about programming on OS X? What's an easy text editor to link the compiler to, or is there a visual studio (hopefully better!) equivalent for the mac?

  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    My favorite fortran compiler is g95:

    You can download and build it, or get it pre-built with fink:

    However, this doesn't buy you instant integration into XCode, the "standard" IDE for OS X. There is a plugin (http://maxao.free.fr/xcode-fortran-plugin/) or two (http://www.macresearch.org/xcode_gfortran_plugin_update) that can be used with the GNU Fortran compiler, gfortran (http://gcc.gnu.org/wiki/GFortran) that will allow you to use XCode for editing, building, etc. I have not tried these, so I can't be much help in terms of recommendations.

    I personally like the commandline, so I edit with vi, but there are a lot of other graphical programmers' text editors for OS X. Some popular ones are TextMate (not free) and TextWrangler (free!).

    You didn't mention what version of fortran you're writing, so some tools may be more suitable than others depending on the situation. For fortran 77 and below, g77 should be fine, but if you are writing fortran 95 or 2003, i think g95 supports newer constructs better than gfortran at this time.

  3. navier-stokes thread starter macrumors newbie

    Mar 19, 2008
    Excellent stuff mate, just what I needed. Not sure if I'll be using 77 or 95 yet, maybe both - I'll probably be using bits of code from a few years back...

    Thanks for the kick start though, I'll look into them

Share This Page