[Rd] Shared lib locations (was Re: [R] problem with RCurl install on Unix0

Martin Morgan mtmorgan at fhcrc.org
Thu Mar 22 20:05:03 CET 2007


[moved to R-devel]

As a package author, how can I let R know of a non-standard location
for shared libs, e.g., because my configure script went to extra
effort to find a shared library, or my package has more than one
shared library? Maybe another question is, in a package, where should
I place my shared libs (and how should they be named) so that R will
find them (I realize library libs/X.so is created for package X; it
seems that a library Y.so that X.so uses is not found when named
libs/Y.so or libs/libY.so).

Thanks,

(another) Martin

Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> On Thu, 22 Mar 2007, Martin Maechler wrote:
>
>>>>>>> "Steven" == Steven McKinney <smckinney at bccrc.ca>
>>>>>>>     on Wed, 21 Mar 2007 19:29:43 -0700 writes:
>>
>>    Steven> I get the same problem, and haven't
>>    Steven> figured it out yet.
>>
>>    Steven> Is it a 32bit/64bit clash?
>>
>> Well, I can install and run  RCurl  on both 32bit and 64bit
>> (Redhat / FC6  Linux; with own compilers, extra libs, ...).
>>
>>    Steven> (Similarly, I don't have RMySQL up and running cleanly.)
>>
>>
>>
>>
>>    >> library(RCurl)
>>    Steven> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>>    Steven> unable to load shared library '/share/apps/R/R-2.4.1/library/RCurl/libs/RCurl.so':
>>    Steven> libcurl.so.4: cannot open shared object file: No such file or directory
>>    Steven> Error: package/namespace load failed for 'RCurl'
>>
>> You might need to set  LD_LIBRARY_PATH  correctly
>> before starting R -- typically it would be set the same as it
>> was when RCurl was installed (which includes a 'configure' !) on
>> your system?  Or  RCurl's configure is not quite robust enough
>> and did not check for the presence of a libcurl.so.4
>>
>> I assume
>>
>>  ldd /share/apps/R/R-2.4.1/library/RCurl/libs/RCurl.so
>
> You may well need
>
> R CMD ldd /share/apps/R/R-2.4.1/library/RCurl/libs/RCurl.so
>
> as the R front end sets LD_LIBRARY_PATH.
>
>> also tells about the missing  libcurl.so.4 ?
>> Make sure you find that (in /usr/lib; /usr/local/lib, ... ?)
>> and then set your LD_LIBRARY_PATH
>> or even   'ldconfig' as root to make sure that libcurl.so.4 ``is
>> found''.
>> IMO the latter {correct ldconfig call / /etc/ld.so.conf setup}
>> should have happened as part of the installation of the curl
>> library.
>
> I find it very common for software packages to install into 
> /usr/local/lib (not lib64) and not to think about the ldconfig paths.
> Both are things that RPMs tend to correct.
>
>> On the 64-bit architecture, note that
>>
>> > system(paste("ldd", dir(system.file("libs", package = "RCurl"), full=TRUE)))
>>
>> finds all libraries in /lib64 and /usr/lib64 .
>
> I think you mean on Redhat-based AMD64 Linux.  This is something that 
> differs by 64-bit architecture (ia64 uses /lib) and also Linux distro (at 
> least in the past).
>
> RMySQL does not install out of the box on any of our 64-bit systems 
> (another lib vs lib64 issue), and I've sent patches to the maintainer.
>
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org



More information about the R-devel mailing list