EDIT: If you're a Homebrew user, you now instead need to use brew install gcc
(gfortran
is no longer provided separate of gcc
), and you can then follow the instructions here to get set up.
You have to symlink the libraries to /usr/local/lib
manually:
ln -s /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/libgfortran.* /usr/local/lib/
I thought brew link gfortran
would handle this, but apparently it only symlinks the gfortran
program and not the actual libraries. So, unfortunately, you have to do it yourself.
(Replace 4.8.2
with whichever version of gfortran
you're using from homebrew
.)
Alternatively, if you want to keep from modifying /usr/local/lib
, you can use
FLIBS=-L/usr/local/Cellar/gfortran/4.8.2/gfortran
in your ~/.R/Makevars
file instead, so R knows where to find the gfortran
libraries.