Skip to content

Makevars file for "alternate" gfortran configuration on macOS

Kyle Baron edited this page May 12, 2019 · 3 revisions

As of this writing, the R Installation and Administration manual is recommending an "alternative" gfortran install on macOS Sierra (see Customizing Package Installation).

To our knowledge, this "alternative" gfortran installation is the only viable option on macOS Sierra. In other words, it isn't really "alternative" but rather "standard" for contemporary macOS installs.

Below is the ~/.R/Makevars file for the gfortran installed from http://coudert.name/software.html. There may be other items in your Makevars file ... but these are the lines that are needed for the coudert gfortran 6.3 install for Sierra.

~/.R/Makevars

F77 = /usr/local/bin/gfortran
FC = $(F77)
FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin16/6.3.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm

Please pay special attention to the long line for FLIBS. This should be on a single line.

You can also try the GCC gfortran binary here: https://gcc.gnu.org/wiki/GFortranBinaries. The setup and paths might be slightly different. If you have successfully used this gfortran install, please post a note on the issue tracker and we will include your configuration here.