SCM

[#1343] Installing binary packages with Fortran code in MacOS

Date:
2011-04-05 12:59
Priority:
3
State:
Closed
Submitted by:
Jari Oksanen (jarioksa)
Assigned to:
Nobody (None)
Hardware:
Macintosh
Operating System:
None
Severity:
enhancement
URL:
Summary:
Installing binary packages with Fortran code in MacOS

Detailed description
Dear R-Forge maintainers,

I have been informed recently that installation of binary package from R-Forge fails in MacOS. I don't have this problem, but other users have. This is the error they get when they try to load the package after seemingly successful installation:

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

The problem seems to missing Fortran runtime library.

This issue seems to be discussed in R-MacOSX-FAQ section 5.4 which tells how to change the the package.so file to point to a fortran runtime library in the MacOSX R installation instead of the runtime used to build the package (and they say they do this in CRAN). Could it be possible to get this operation also in R-Forge so that users without similar Fortran compilers could be able to use R-Forge binaries.

URL of the appropriate section in R-MacOSX-FAQ is

http://cran.R-project.org/bin/macosx/RMacOSX-FAQ.html#Building-universal-package

Best wishes, Jari Oksanen

Comments:

Message  ↓
Date: 2012-03-07 23:08
Sender: Clem Wang

I'm not sure why this bug is closed...

In any case, I read elsewhere that a work-around is to restart R and then try loading the library. That worked for me.

Date: 2012-03-02 01:58
Sender: Clem Wang

Has any progress been made on making a good Mac binary for this package?


When I try to load the library in R, I get an unhelpful error message:

> install.packages("lme4")
> library(lme4)
Error in get(Info[i, 1], envir = env) :
internal error -3 in R_decompress1


When I tried the instructions in the MacOSX-FAQ (mentioned in this thread to fix the problem), I got the error message using the Unix command line:
$ for lib in `ls lme4/libs/*/*.so`; do
install_name_tool -change /usr/local/lib/libgfortran.2.dylib \
/Library/Frameworks/R.framework/Versions/2.14/Resources/lib/libgfortran.2.dylib \
$lib
done

install_name_tool: can't map file: lme4/libs/i386/lme4.so.dSYM (Invalid argument)
install_name_tool: can't map file: lme4/libs/ppc/lme4.so.dSYM (Invalid argument)
install_name_tool: can't map file: lme4/libs/x86_64/lme4.so.dSYM (Invalid argument)

Or should I be doing something else?


I'm using 2.14.2, on Mac OSX 10.6.8 on Intel Core i5

Many thanks in advance

Date: 2011-12-19 14:53
Sender: Stefan Theussl

Dear Jari,

thanks for this note.
this is currently in testing stage. Will go online later today and hopefully fixes this issue.

Best,
Stefan

Date: 2011-12-18 15:52
Sender: Jari Oksanen

I have had several user queries of vegan binaries failing in Mac. In one case I successfully followd instructions in http://cran.R-project.org/bin/macosx/RMacOSX-FAQ.html#Building-universal-package -- so I can confirm that this works-

Could it be possible to have this kind of fixing of binary packages also in R-Forge so that the MacOS binaried offerred in R-Forge would work in Macs without Fortran installation?

Cheers, Jari Oksanen

Attached Files:

Changes

Field Old Value Date By
status_idOpen2011-12-19 14:53stefan7th
close_date2011-12-19 14:532011-12-19 14:53stefan7th
Thanks to:
Vienna University of Economics and Business Powered By FusionForge