[ESS] ESS and LD_LIBRARY_PATH

Erik Iverson iverson at biostat.wisc.edu
Wed Oct 18 22:14:52 CEST 2006


Hello -

Apologies if this is something simple; I've tried everything I can think 
of!  I am on RHLE 4, R version 2.3.1, ESS 5.3.0.

I have downloaded an R package called Cairo (not on CRAN).  The package
Cairo needs to have the Cairo library (www.cairographics.org) installed
to function.  Because I'm doing this at work, and do not have root 
access, I have installed the Cairo graphics library in ~/lib, as is my 
standard practice (I'm *not* talking about the R package Cairo here, I'm 
talking about the Cairo graphics library).  I then have LD_LIBRARY_PATH 
set to ~/lib in my .cshrc file.  I then installed the R Cairo package 
with R CMD INSTALL.

Now, from my shell in KDE, I can start R and load the Cairo package.
 > library(Cairo)
 >
This is great!

However, I try from ESS 5.3.0 under XEmacs, also using R version 2.3.1
 > library(Cairo)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
	unable to load shared library '/u/iverson/R.tools/lib/Cairo/libs/Cairo.so':
   libcairo.so.2: cannot open shared object file: No such file or directory
Error in library(Cairo) : .First.lib failed for 'Cairo'

It can't find libcairo.so.2, which is in ~/lib.

I can't figure out why when starting R from my shell, I can load Cairo, 
but not when using R under ESS.

I check the LD_LIBRARY_PATH environment variable from the R session 
started in my shell:
 > Sys.getenv("LD_LIBRARY_PATH")
LD_LIBRARY_PATH
"/s/pkg/linux/R/2.2.1/lib/R/lib: ... :/u/iverson/lib"
I omit some paths here, but note it has ~/lib.

I now check LD_LIBRARY_PATH from the R session in ESS:
 > Sys.getenv("LD_LIBRARY_PATH")
 
 
                                                LD_LIBRARY_PATH
"/s/pkg/linux/R/2.2.1/lib/R/lib: ..."
This returned the same string as above, *except* for ~/lib!
I thought, no problem, I'll just append ~/lib to LD_LIBRARY_PATH using 
Sys.putenv() in R under ESS.

It looked like it appended ~/lib correctly according to Sys.getenv(), 
but library(Cairo) still wouldn't work, same error as above to my 
surprise.  Setting LD_LIBRARY_PATH in my .Renviron file didn't change 
the error message either.

Any thoughts on this?  I was able to get the Cairo package loaded in an 
R session started from my Xemacs shell also, so my naive guess is that 
this isn't an Xemacs issue.

Thanks for any help or suggestions anyone can offer, I've tried all I 
can think of!
Erik Iverson




More information about the ESS-help mailing list