Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Best Fortran Compiler for OSX

  1. Aug 28, 2011 #1
    I am making the switch to OSX from Linux and am unable to find any solid reference to the best way to get gfortran onto my mac without using MacPorts?

    What (other?) compilers are people using on OSX? I will have xcode installed as I typically develop in C and am looking to target the new Mac Appstore.

  2. jcsd
  3. Aug 28, 2011 #2


    User Avatar

    Staff: Mentor

  4. Aug 28, 2011 #3
    Thank you!

    I read from some sources that the hpc builds were not good, can you please verify this claim?

    I should add, I will be using Lion.
  5. Aug 28, 2011 #4

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    I can't resist: What is wrong with MacPorts (or fink as an alternative)?

    One of the nice things about linux is that the huge array of high quality open source tools that can be downloaded for free from a trustworthy site. MacPorts, fink, and a few other projects are attempts to provide that Linux-like functionality to us Mac owners.

    You really should give one or both of MacPorts and fink a try.
  6. Aug 28, 2011 #5
    Having experience with BSD and Gentoo, I am extremely familiar with Ports/Portage and like the system very much. However, I am trying ensure consistency on my system and avoid multiple package sources.

    If it turns out that this is the best way to go, then of course, I will use MacPorts. I am just trying to find a more "native" (in lieu of a better word, neglecting that OSX is a BSD derivative) method of package management.

    I have spent most of my time in the *NIX world dealing with compiling packages and tweaking for perfection. Now I am going OSX, I am typically trying to start using software instead of configuring it as my workload is much higher now I am entering my M.Sc studies and I have less time to play with potential inconsistencies.
  7. Aug 28, 2011 #6


    User Avatar

    Staff: Mentor

    I can't address this, unfortunately. I haven't used Fortran seriously in many years. I installed gfortran on my Mac out of curiosity, and compiled a few simple programs to check that it works at all.

    What do they mean by the builds not being good?
  8. Aug 28, 2011 #7
    Sadly the posts I read were in a passing search that I am unable to source at this moment. It was vague but mentioned something regarding incompatibilities with xcode (That said, Vim is my editor for most tasks).
  9. Aug 28, 2011 #8


    User Avatar

    Staff: Mentor

    I don't use the Xcode IDE myself. I compile/link and run programs at the command line, edit code with a simple text editor, use makefiles as necessary, etc. As far as I know, gfortran works fine in that mode, but most of my recent experience is with C++ (gcc / g++).
  10. Aug 28, 2011 #9
    Most of my work for university requires little more than Vim, Terminal, GCC Suite and Make. Realistically, this is where most of my Fortran work will be done. I will, for my own personal purposes, only be using Xcode for App Store Development and as such, will be largely using C for the main engine and Obj-C for the UI. It would be nice to have Fortran available in Xcode to write certain numerical libraries and integrate them into the project but this is not a dealbreaker.

    If gfortran works from Terminal with the stock gcc in OSX Lion, I am satisfied and this thread may be marked as closed!

    Thank you
  11. Aug 30, 2011 #10
    I use Ifort, it works well and pretty easy to install if I remember correctly.
  12. Aug 30, 2011 #11
    Aren't the Intel compilers terribly expensive? Or am I not looking properly?
  13. Aug 30, 2011 #12
    I understand the ifort is free for Linux, and also "not very expensive" for OSX if you know where to look...
  14. Sep 3, 2011 #13
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook