[Rd] libgfortran misplaced in Mac OS X R install (PR#14226)

tbrick at virginia.edu tbrick at virginia.edu
Tue Mar 2 17:45:10 CET 2010

Full_Name: Timothy Brick
Version: 2.10
OS: Mac OS X (seen on both 10.6 and 10.5)
Submission from: (NULL) (

When using install.packages in R on Mac OS X, packages that require gfortran
throws an error (Example below from installation of OpenMx package):

Loading required package: OpenMx
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared library
6): Library not loaded: /usr/local/lib/libgfortran.2.dylib
Referenced from: /Library/Frameworks/R.framework/Resources/library/OpenMx/libs/i386/OpenMx.so
Reason: image not found

libgfortran.2.dylib does exist, but in
(or /2.9/, depending on version installed).

A workaround at present involves creating a symbolic link from the above file to
/usr/local/lib/libgfortran.2.dylib, however this requires sudo access and is
confusing for novice users.

There is more discussion of this bug as it relates to OpenMx at:

Posts on other forums indicate a similar issue with other packages including
vegan and lme4:

More information about the R-devel mailing list