library loading issue on OSX10.9 R3.1 Python3.4

Issue #196 resolved
Matthew Wakefield
created an issue

Installed bioconductor library fails to load correctly via RPy2 but loads correctly in R

$ python3
Python 3.4.0 (default, Apr  9 2014, 11:51:10) 
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from rpy2.robjects.packages import importr
>>> import rpy2
>>> rpy2.__version__
'2.3.10'
>>> edger = importr("edgeR")
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/edgeR/libs/edgeR.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/edgeR/libs/edgeR.so, 6): Library not loaded: /usr/local/lib/libquadmath.0.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/edgeR/libs/edgeR.so
  Reason: image not found

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

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/site-packages/rpy2/robjects/packages.py", line 306, in importr
    env = _get_namespace(rname)
rpy2.rinterface.RRuntimeError: Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/edgeR/libs/edgeR.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/edgeR/libs/edgeR.so, 6): Library not loaded: /usr/local/lib/libquadmath.0.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/edgeR/libs/edgeR.so
  Reason: image not found

$ R

R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.1.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library('edgeR')
Loading required package: limma

Comments (4)

  1. Laurent Gautier

    Seems to be OS X-specific, and may be specific to the way the packages were compiled (did you compile on the system you are running this on, or was the package compiled on a different system ?).

    The error is coming from a gfortran-related library, I think.

  2. Matthew Wakefield reporter

    I work with the edgeR developers so will chase from that end as well, however the package works through the R command line - this error is specific to the RPy2 loading. I did not compile the R3.1 (MacOS10.9 package installer - note there is another version for older editions) and used the bioconductor interface to install edgeR. RPy2 was a pip install. I will do over from scratch tomorrow to check it is consistent, and do the alternate R version. Will also keep logs from the various install and compiles.

  3. Laurent Gautier

    There is an other OS X-specific issue around finding R libraries that is currently open (issue #194). Do you know how the R executable is setting up environment variables ?

    (On Linux R is a bash wrapper script).

  4. Log in to comment