Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

navier-stokes

macrumors newbie
Original poster
Mar 19, 2008
19
0
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?

Cheers!
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
My favorite fortran compiler is g95:
http://www.g95.org

You can download and build it, or get it pre-built with fink:
http://www.finkproject.org/

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.

-Lee
 

navier-stokes

macrumors newbie
Original poster
Mar 19, 2008
19
0
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.