FAQ: R-Forge binaries of vegan fail in Mac OS

Several users have reported that R-Forge binaries of vegan fail with a message similar to the one below (the exact message varies with your platform, but all report Error in dyn.load):

Error in dyn.load(file, DLLpath = DLLpath, ...) :
 unable to load shared object
'/Library/Frameworks/R.framework/Versions/2.14/Resources/library/vegan/libs/i386/vegan.so':
 dlopen(/Library/Frameworks/R.framework/Versions/2.14/Resources/library/vegan/libs/i386/vegan.so,
6): Library not loaded: /usr/local/lib/libgfortran.2.dylib
 Referenced from:
/Library/Frameworks/R.framework/Versions/2.14/Resources/library/vegan/libs/i386/vegan.so
 Reason: image not found

Alternatively, you can get the following message:


downloaded_packages
Error in get(Info[i, 1], envir = env) :
internal error -3 in R_decompress1
Error: package/namespace load failed for ‘vegan’

The problem in both cases is that the R-Forge binary package was built assuming that Fortran and Fortran runtime libraries are installed in the computer, and if you do not have Fortan, you get the reported problem. R ships with its own Fortran runtime libraries, but you must tell that they are used, and if the built package fails to do this, you get the error like that above. CRAN fixes the built binaries so that they can be used in all Macs, but R-Forge does not do this, and therefore its binaries can be used only in Macs with installed Fortran.

I have filed this as Bug #1343 in R-Forge. If this is your problem, you may consider confirming my report in the R-Forge bug reporting system: perhaps this will make R-Forge admins to do something to fix this issue.

You can try to fix the problem following instructions in R for MacOS FAQ (last paragraph in Question 5.4). Alternatively, you can install gfortran package from the MacOS tools directory in CRAN.


Jari Oksanen