Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69143 - rpy cannot load lapack.so
Summary: rpy cannot load lapack.so
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-27 07:54 UTC by Max
Modified: 2005-08-17 02:45 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max 2004-10-27 07:54:58 UTC
I am trying to use rpy to run a file with a bunch of linear models like the following:
from rpy import *
output = r.source("linear_models.R")

In linear_models.R, I have some commands like
m1 = lm(Y ~ X1 + X2)
print(summary(m1))

It appears that rpy fails to load lapack.so (necessary for doing the linear models).

The error message is
 Warning message: 
unable to load shared library "/usr/lib/R/modules/lapack.so":
  libRlapack.so: cannot open shared object file: No such file or directory 
Traceback (most recent call last):
  File "./analysis.py", line 44, in ?
    output = r.source("linear_models.R")
rpy.RException: Error in La.chol2inv(x, size) : lapack routines cannot be loaded

I checked, I have a /usr/lib/R/modules/lapack.so, but when I run ldd on that I get:
 $ ldd lapack.so 
        libR.so => not found
        libRlapack.so => not found
        libg2c.so.0 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libg2c.so.0 (0x40020000)
        libm.so.6 => /lib/libm.so.6 (0x4003e000)
        libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libgcc_s.so.1 (0x40060000)
        libpcre.so.0 => /usr/lib/libpcre.so.0 (0x4006a000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x4007b000)
        libreadline.so.4 => /lib/libreadline.so.4 (0x4008a000)
        libdl.so.2 => /lib/libdl.so.2 (0x400b7000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x400ba000)
        libc.so.6 => /lib/libc.so.6 (0x400ff000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

So it appears that python can't find libRlapack.so because it isn't in a standard location (it is in /usr/lib/R/bin).

I tried
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/R/bin

That seems to work.

Reproducible: Always
Steps to Reproduce:
1. Write R batch file using a linear model ( lm() function )
2. r.source() the file from a python script using rpy
3.

Actual Results:  
see error message above

Expected Results:  
output from a linear model (R: lm() function)
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2004-10-28 01:28:21 UTC
yeah, there's some problems with the way that the libraries are put in. maybe we should add /usr/lib/R/{bin,lib} to /etc/env.d

probably is that that location has changed between R-1.99 and R-2.0.0
Comment 2 Max 2004-10-28 01:56:43 UTC
Oops, good point about the version: I should have said that I am using R Version 1.9.1.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-08-16 10:58:55 UTC
Hmm, what't the status here?
Comment 4 Max 2005-08-17 01:58:51 UTC
I have updated my R version to 2.1.0-r1:

Hm, I now have a /etc/env.d/99R which belongs to dev-lang/R, which sets
LDPATH=/usr/lib/R/lib, but I am not sure this does anything (echo $LDPATH
produces an empty line). In any case, my testcase doesn't produce any problems
anymore. I guess this means it can be closed?
Comment 5 Patrick Kursawe (RETIRED) gentoo-dev 2005-08-17 02:45:50 UTC
the 99R-file adds this path to /etc/ld.so.conf, so the linker can find files
there. Looks like this is fixed for all R versions currently in portage.
This was actually fixed because of bug #90601 - looks like I underestimated the
consequences of the missing path. Sorry.