Problem loading R library

Issue #228 resolved
thwiouz
created an issue

Hi,

I tried to load the "PerformanceAnalytics" library through rpy2 whith the following:

import rpy2.robjects as robjects

robjects.r('library("PerformanceAnalytics")')

but got the following error message:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  impossible de charger l'objet partagé '/usr/local/lib/R/site-library/PerformanceAnalytics/libs/PerformanceAnalytics.so':
  /usr/local/lib/R/site-library/PerformanceAnalytics/libs/PerformanceAnalytics.so: undefined symbol: dgemm_

It seems to be a function defined in the lapack / blas library which is installed. Nevertheless, the package loading in pure R works fine. Is it a problem of path or permissions? FYI, I'm under Ubuntu 14.04 with rpy2 2.4.4

Could you help? Thanks,

Comments (10)

  1. Laurent Gautier

    When installing rpy2, what does the console output says about the compiling environment (near the beginning of the output, there are few lines about include_dirs, library_dirs, etc...) ?

    Also, are you using a stock ubuntu blas library ? Are you using an intel compiler rather than gcc ?

  2. mike space

    sorry if my response is newbie like:

    I installed rpy2 with pip, on an amazon ubuntu build. Added libblas-dev, liblapack-dev.

    Console output on compiling envir: Compilation parameters for rpy2's C components: include_dirs = ['/usr/share/R/include'] library_dirs = ['/usr/lib/R/lib'] libraries = ['R'] extra_link_args = []

    Using x86_64-linux-gnu-gcc

  3. Laurent Gautier
    • changed status to open

    I can reproduce it with that one R package (PerformanceAnalytics).

    For some reason the link to BLAS is not functioning when in rpy2. May be the issue is upstream, in the package PerformanceAnalytics. I am observing that the package authors have defined a file src/Makevars.win (rev. 3485) with the comment Adding Makevars.win file to link against BLAS and LAPACK libraries. However this is for Windows only.

  4. Laurent Gautier

    Creating a file src/Makevars as copy of src/Makevars.win in the source for that package is solving the issue, hinting further that the problem might be be more with R and PerformanceAnalytics.

    I am contacting the authors of the packages with a proposed fix, and I am closing this issue.

  5. Log in to comment