Free Fortran For Mac

If you'd like to use your Apple Mac with OS X for some numerical computation, this site could be useful to you. Most of these packages have been compiled/tested on several version of OS X and XCode Tools. Feel free to contact me with questions or problems!

2) Are there any free Fortran editors for Mac that you could recommend (and that don't take much time getting used to)? 3) Once I save the file, how do I compile it? Is is gfortran followed by the file name (with path) in the Terminal? Also, how does the path look like on a Mac? A step by step guide would be a great help. I am a first time Mac. F2C based Fortran: This is the oldest Fortran compiler available for OS X. Its been around since OS X was in a public beta state. Download this shell script: buildf2c, type chmod +x buildf2c and then sudo./buildf2c. The script will grab f2c source from Netlib repositories and install a f2c based compiler in /usr/local/.

Free Fortran For Mac

Computation Tools :: C/Fortran

GCC 4, 5, 7, 8, 9, 10 (auto-vectorizing gcc with OpenMP):
Compiled using source code from the GNU servers. This contains current versions (8.3 is the stable release) of gfortran (free, open source, GNU Fortran 95 compiler), gcc (GNU C) and g++ (GNU C++) compilers that can perform auto-vectorization (i.e. modify code to take advantage of AltiVec/SSE, automatically) and other sophisticated optimizations like OpenMP. For more information, see this webpage. Download my binaries, and cd to the download folder. Then gunzip gcc-10.2-bin.tar.gz (if your browser didn't do so already) and then sudo tar -xvf gcc-10.2-bin.tar -C /. It installs everything in /usr/local. You can invoke the Fortran 95 compiler by simply typing gfortran. You will also need to have Apple's XCode Tools installed from the Mac App Store. With XCode 4 or better you will need to download the command-line tools as an additional step. You will find the option to download the command-line tools in XCode's Preferences. On 10.9 Mavericks or higher, you can get the command-line tools by simply typing xcode-select --install. And on Catalina, you may have to specify an additional include and library path -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib for the compiler to find the system headers and libraries.
Binaries:
gcc-m1-bin.tar.gz,gfortran-m1-bin.tar.gz (gfortran only), updated Dec 2020 (Big Sur -- M1 Apple Silicon).
gcc-10.2-bin.tar.gz,gfortran-10.2-bin.tar.gz (gfortran only), updated Nov 2020 (Big Sur).
gcc-9.2-bin.tar.gz,gfortran-9.2-bin.tar.gz (gfortran only), updated Oct 2019 (Catalina).
gcc-8.3-bin.tar.gz,gfortran-8.3-bin.tar.gz (gfortran only), updated April 2019 (Mojave & Catalina).
gcc-8.1-bin.tar.gz,gfortran-8.1-bin.tar.gz (gfortran only), updated June 2018 (High Sierra & Mojave).
gcc-7.3-bin.tar.gz,gfortran-7.3-bin.tar.gz (gfortran only), updated June 2018 (High Sierra).
gcc-7.1-bin.tar.gz,gfortran-7.1-bin.tar.gz (gfortran only), updated June 2017 (El Capitan & Sierra).
gcc-5.1-bin.tar.gz,gfortran-5.1-bin.tar.gz (gfortran only), updated June 2015 (Yosemite & El Capitan).
gcc-4.9-bin.tar.gz,gfortran-4.9-bin.tar.gz (gfortran only), updated Nov 2014 (Mavericks & Yosemite).
gcc-4.8-bin.tar.gz,gfortran-4.8-bin.tar.gz (gfortran only), updated Oct 2013 (M. Lion & Mavericks).
gcc-4.7-bin.tar.gz,gfortran-4.7-bin.tar.gz (gfortran only), updated July 2012 (Lion & M. Lion).

Documentation: click here!

g77 3.4 :
This is the FINAL release of g77 (version 3.4 compiler). Future versions of GCC will have gfortran (see above). Download my binaries, and cd to the download folder. Then gunzip g77-bin.tar.gz (if your browser didn't do so already) and sudo tar -xvf g77-bin.tar -C /. It installs everything in /usr/local. You will need to have Apple's Developer Tools installed. They are included on the retail DVD version of OS X and also available as a free download from Apple's Developer Site. Please install the most current version of Developer Tools. Thanks to James Wookey for the Intel Mac version of g77.
Binaries: g77-bin.tar.gz (PowerPC only), g77-intel-bin.tar.gz (Intel Mac only), updated October 2006.
Documentation: click here!

F2Cbased Fortran:
This is the oldest Fortran compiler available for OS X. Its beenaround since OS X was in a public beta state. Download this shellscript: buildf2c, type chmod +xbuildf2c and then sudo ./buildf2c. The script will grabf2c source from Netlib repositories and install a f2c basedcompiler in /usr/local/. You aredone! The compiler can be envoked by the commands fc orf2c.
Install script: buildf2c
Documentation: click here!

Computation Tools :: Octave

Octave:
Octave is an open source, Matlab-like numerical analysis software package that is very popular among scientists and engineers. The good folks over at Octave-Forge provide an OS X style Octave application, with drag and drop installation! I recommend their binaries (links below).
Source: Octave
Binaries: Octave application, updated May 2011.
Documentation: clickhere!

Computation Tools :: Cactus, RNPL, etc.

Einstein Toolkit:
The Einstein Toolkit is an open-source software framework specifically targeted to the research area of numerical relativity and astrophysics. The broad aim of the toolkit is to provide the core computational tools that enable scientific research in this area, and take advantage of emerging petascale computers and advanced cyberinfrastructure.The Einstein Toolkit compiles and runs great on Mac OS X. A critical component of this toolkit is the Cactus Computing Toolkit (see below).
Source: clickhere!
Documentation: clickhere!

CactusCode (Numerical Computing Toolkit):
Cactus is an open source problem solving environment designed forscientists and engineers. Its modular structure ('thorns') easilyenables parallel computation across different architectures andcollaborative code development between different groups. It ismainly used for solving complicated PDE's. It highly portable, andhas some really remarkable features like observing and even'controlling' or 'steering' a running simulation using an ordinaryweb browser! Here is a link to a perpetual demo running at LSU Cactus Demo. Check it out!Cactus compiles and runs great on Mac OS X.
Source: clickhere!
Documentation: clickhere!

RNPL (Rapid Numerical Prototyping Language):
This is a great tool that takes as input details about the form ofan equation (usually a partial differential equation), and someparameters . and then spits out a C or FORTRAN Code that solvesthe equation numerically using established iterative numericaltechniques. RNPL can also be used for producing skeleton programsand for converting existing programs. Download the source, compileand install. This source has been modified to compile with OS X. Orget my binary distribution. You probably want to install this in/usr/local, to do so gunzip rnpl-bin.tar.gz (if your browser didn't do so already) and then sudo tar -xvf rnpl-bin.tar -C / and you are done! You will need to use the F77 flag: -fno-second-underscore, for RNPL generated F77 codes to compile properly.
Source: rnpl.tar.gz
Binaries: rnpl-bin.tar.gz, updated 2003.
Documentation: click here!

Computation Tools :: Other Miscellaneous

The GRAVSIM Package:
GRAVSIM is a package that contains an ever evolving and hopefully growing set of gravitational N body solvers. These solvers attempt to track the motion of a set of bodies moving under the influence of gravity. They are used in many areas of astrophysical study including planetary motion, star cluster formation and stability and galactic formation, stability and interactions (i.e. colliding galaxies). This package is highly AltiVec and DP optimized!
Source and Binaries: click here!
Documentation: click here!

Xmgr Grace:
This is a very easy to use, open-source, X11 based, plotting tool. I used it during my graduate school days and still love it. Its excellent especially for students and free! Note: I didnot create this binary, but I have tested it on both Intel and PPC Macs. It works very well. Move the Grace application to the system /Applications folder for it to function correctly.By the way, if you are looking for a nice, easy to use, 2D and 3D,plotting package for OS X, try pro Fit. It works great. They have a free trial version, that is not time-limited and is full-featured. It just has some restrictions on the volume of data you can make it handle. Even the full version is very inexpensive.
Binaries: Grace (PowerPC only), Grace, updated Aug 2014.
Documentation: click here!

There are many editors that support Fortran syntax highlighting.

(TODO expand this list)

Free Fortran Compiler For Mac

  • Code::Blocks IDE for Fortran An IDE for Fortran 2003 and 2008.
  • Emacs – V 23.x and later come with f90-mode supporting Fortran 2003.
  • gedit – free-format Fortran 95
  • jed – Programmer’s editor that supports fixed-format Fortran 77 and free-format Fortran 2003 modes with syntax highlighting and smart indentation.
  • Vim – Supports Fortran syntax up to Fortran 95, but see below.
  • NEdit – GUI editor with some Fortran support. It used to be a good choice, but is rather obsolete compared to gedit.
  • Eclipse with Photran – For the IDE users.
  • Geany: GUI editor with support for many languages as well as Fortran; see below.
  • Sublime Text 2 – A beautiful text editor (paid but no enforced time limit for free use) that supports Fortran syntax via Textmate bundle.
  • Kate: – Has syntax highlighting and indentation for Fortran.
  • Zeus: – A (shareware) programmer’s editor for Windows with Fortran syntax highlighting and code navigation.
  • Photran is an IDE and refactoring tool for Fortran based on Eclipse. Photran supports Fortran 77-2008 and is actively maintained with annual releases. It includes 39 refactorings (including Rename, Extract Procedure, and loop transformations), as well as the many IDE features.
  • Visual Studio Code is an lightweight open source alternative to Visual Studio. It can be expanded by plugins (see below).

Free Fortran Compiler Download

  • Code::Blocks IDE for Fortran http://cbfortran.sourceforge.net/: Recommended! Originally developed for C++, this advanced IDE has many features of eclipse and supports most features of Fortran 2003 and 2008. The environment is quite user friendly and easy to use. It is one of the few true IDEs for Fortran. I think the support of the Fortran community will help this IDE to become a very powerful general purpose and fast Fortran programming tool.

  • Jedit - written in Java - when opening more than one file this has no tabs but a drop-down list at the top, which I find less convenient. But it has good Fortran90 aware syntax highlighting (I had to make a small change to the configuration file to prevent every line starting with C being treated as a comment, but that was not difficult). But the print system is a Java-special, not using the regular Windows print menu, so you can’t alter your printer defaults, e.g. to print 2 pages per sheet of paper. This is an annoyance.

  • Gedit - there is a windows binary to download which worked with no trouble, but there is no manual and no help (missing file). Download bootcamp 5.1 dmg. The syntax highlighting did work for Fortran90, but it did not understand the .f90 or .f95 file extension, and had to be set each time, which was very tedious. I could not find the relevant file on the website, nor when I untarred a regular gedit distribution. Looking at the help on a Linux box there did not seem to be a way of associating file extensions with language highlighting.

  • Notepad++ - has tabbed browsing, and uses regular Windows printing, but the syntax highlighting was set for Fortran77, and was really not useful. After being annoyed by it for some time, I found it best to disable the highlighting entirely. In principle one could define one’s own Fortran90 syntax file, but I couldn’t be bothered to do this. Apart from this it’s a fairly good editor.

  • Notetab light - the free version of a commercial editor notetab. This is another adequate editor: regular Windows printing, no tabbed file opening, no syntax highlighting. It seems to have no particular features that at least one of the others has.

  • Geany(http://www.geany.org/): This is a free open source editor with many capabilities which also supports programming in Fortran. There are several plugins to deal with project management, debugging etc. The editor lets you for extensive customization for a programming language and even adding new one! Nikko in quicksand. It is available for both Windows and Linux.

  • Simply Fortran(http://simplyfortran.com/): lightweight IDE for MS Windows and compatible operating systems. Made with GNU Fortran in mind, but configurable with most compilers, it comes with an intergrated development environment, a graphical debugger, and a collection of other development accessories. In early stages of development as of now, has some bugs, but the author’s working on them.

  • Programmer’s Notepad - A general source code editor for MS Windows. It can be configured to build Fortran files with arbitrary command lines, or to invoke make in a particular directory. Like many editors, it is C-centric, but the Fortran support is adequate.

  • Absoft Pro Fortran - A IDE developed by Absoft specially for Fortran. http://www.absoft.com/

  • FTranProjectBuilder - Fortran specific development environment for the Mac with built-in source code editor, makefile generator, and lab notebook. It’s Mac-native, self configuring and works with any Fortran compiler, including mpiXX for parallel computations. Fortran 2003+ features include variable and type bound procedure auto-completions. http://www.NocturnalAviationSoftware.com

  • UltraEdit - General source code editor for multiple languages with syntax checking. http://www.ultraedit.com. Runs on Mac, Linux and Windows 32 and 64 bit. There is a companion product called UltraCompare which allows one to compare files. Syntax checking is acheived through what the vendor calls word files. The vendor has a fairly good size library of wordfiles, but you can create your own if you wish. The Product also allows the developer to organize their work in a project fashion. Support for ftp,sftp, etc. Also allows column editing mode. I have been developing for decades and find this tool to be the best on the market when it comes to editors. Not a free product.

  • Visual Studio Code - To use VSC for Fortran on Linux i recomend installing the following plugins: Fortran Language Server, C/C++ for Visual Studio Code, Modern Fortran language support for VSCode, Fortran IntelliSense and Fortran Breakpoint Support.

An enhanced Vim syntax file that includes Fortran 2003 keywords is available here:

Free Fortran For Windows 10

The following can be added to $HOME/.vimrc. It maps <shift>-F to toggle between fixed and free format Fortran source. In case it is hit by mistake, <ctrl>-F is mapped to re-detect the syntax.

Free Fortran For Mac

findent indents fortran source, both fixed and free format. Conversion from fixed to free is also possible. Available for Linux and Windows. Plugins for vim and gedit are contained in the tarball at findent.sourceforge.net