Download Gfortran For Mac

Mandatory tools

Instead of trying to install gfortran you should try gcc instead. Gcc install comes with gfortran. This is available from homebrew or MacPorts. Another method is to install pre-compiled binaries from here. Select the version based on your Mac OS version and you get an apple style loader. A.dmg file ready to load on your mac. This will download and unpack a new version of gfortran, putting it into a new directory: /gfortran. It will also put a Makevars file into your /.R directory so that R knows where to look when it wants gfortran. To test it, install pomp from source by running the following in an R session. Mandatory tools. In order to compile R for macOS, you will need the following tools: Xcode developer tools from Apple. Xcode can be obtained from Apple AppStore and the Xcode developer page. Older versions are available in the 'more' section of the Developer pages (Apple developer account necessary). GNU Fortran compiler. The gfortran maintainers offer nice Apple-style installers for: macOS Sierra (10.12): download gfortran 6.3 OS X El Capitan (10.11): download gfortran 6.1 OS X Yosemite (10.10): download gfortran 5.2 or gfortran 4.9.2 OS X Mavericks (10.9): download gfortran 4.9.0 or gfortran 4.8.2 OS X Mountain Lion (10.8): download gfortran 4.8.2.

In order to compile R for macOS, you will need the following tools:
  • Xcode developer tools from Apple
    Xcode can be obtained from Apple AppStore and the Xcode developer page. Older versions are available in the 'more' section of the Developer pages (Apple developer account necessary).
  • GNU Fortran compiler
    Unfortunately Xcode doesn't contain a Fortran compiler, therefore you will have to install one. We recommend official GNU Fortran binaries from F.X.Coudert. CRAN High-Sierra builds currently use GNU Gortran 8.2 from that page (note that even though compiled for Mojave it is compatible with High Sierra).
    gfortran-8.2-Mojave.dmg (ca. 87MB, GNU Fortran 8.2 from F.X.Coudert)
    SHA256 hash: 81d379231ba5671a5ef1b7832531f53be5a1c651701a61d87e1d877c4f06d369

    This is a copy of GNU Fortran 8.2 build from https://github.com/fxcoudert/gfortran-for-macOS/releases

    Make sure you add /usr/local/gfortran/bin to your PATH in order to use this compiler. This can be done, e.g. by
    export PATH=$PATH:/usr/local/gfortran/bin

Download gfortran for mac latestNOTE: In order to retain compatibility with native R we recommend using above tools. Although it is possible to compile R using tools from other package managers such as Homebrew, MacPorts or Fink, such binaries are by definition incompatible with macOS native libraries and applications. If you choose one of those package managers, make sure you compile everything using those tools including R and all packages and libraries you intend to use.

Mandatory libraries

Old versions of R provided fall-back versions of dependend libraries. This is no longer the case, the following libraries are not present in most recent macOS (or are too old) and have to be installed before R can be compiled:
  • liblzma (aka xz-utils) https://tukaani.org/xz/
  • PCRE2https://www.pcre.org/ built with --disable-jit (JIT is buggy on macOS)
  • bzip2 may need to be installed if the system version is too old
Binaries for the above libraries are available in /libs-4 as well as many others that are useful for R packages (see optional libraries below).

Note that all binaries used by CRAN are built using the recipes system and thus can be trasparently re-built accordingly.

Optional tools and libraries

The following tools and libraries are optional. R can be compiled without them, but they provide additional capabilities to R.
  • LaTeX
    In order to produce documentation, LaTeX is necessary. It can be obtained from several places, for example as a part of MacTeX.
  • GNU readline,
    Although Mac OS X comes with readline-replacement library, it lack some functionality like backward search etc. Therefore many user prefer GNU readline. For macOS 10.13 download see libs-4 on this site (for older OS X verions see libs).
  • PNG, JPEG and TIFF libraries
    If bitmap manipulation libraries are present, R will add graphics device support for those bitmap formats. There are also other package that take advantage of PNG and JPEG, so it is in general a good idea to install them.Again, they are available in /libs-4 (new) and /libs (old).
  • cairo
    R support for cairo graphics can be enabled by installing cario and dependent libraries (also provided in /libs-4).
  • subversion
    If you want to check out R from the SVN repository, you will need subversion. It was included in Xcode 9 and earlier, but is no longer. We are providing a signed binary:
    subversion-1.14.0-darwin15.6.tar.gz(SHA1: 9dab09d6cf608bea6224bdc3ec3e95893e4e9800)
    which works on OS X 10.11 (El Capitan) and higher, is relocatable, i.e., you can put it anywhere you want since it only depends on system libraries.
    (Static build with: apr-1.7.0, apr-util-1.6.1, openssl-1.1.1g, serf-1.3.9, sqlite-3.33.0, subversion-1.14.0)
    This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)
(sources for open source software not linked directly)

Old version of this page for much older OS X versions.

Disclaimer

All software is provided 'as is' and any express or implied warranties, including, but but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the publisher, copyright owner or contributors be liable for any direct, indirect, incidental,special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

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!

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!

Download gfortran for mac full

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!

Gfortran For Mac Os X

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!