[R] R seems to mangle LD_LIBRARY_PATH

Rolf Turner r.turner at auckland.ac.nz
Wed Mar 12 06:30:52 CET 2014


Can't hazard a guess as to why R is tacking on those other components to 
LD_LIBRARY_PATH but it seems that if you use Sys.setenv() from within R 
you can put your personal directory first. Something like:

Sys.setenv(LD_LIBRARY_PATH=paste("~/install/lib",
                            Sys.getenv("LD_LIBRARY_PATH"),sep=":"))

You could put that line into your .Rprofile so that you wouldn't need to 
enter it on each startup.

HTH

cheers,

Rolf Turner


On 12/03/14 16:00, Ross Boylan wrote:

> I am trying to ensure that a directory is searched first, but it gets
> stuck at the end of LD_LIBRARY_PATH:
>
> $ export LD_LIBRARY_PATH=~/install/lib
>
> $ R
>
> R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
> Copyright (C) 2013 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu (64-bit)
> # banner omitted
>
>> Sys.getenv(c("PATH", "LD_LIBRARY_PATH"))
>
> PATH
>
> "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
>
> LD_LIBRARY_PATH
> "/usr/lib64/R/lib:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/home/ross/install/lib"
>>
>
>
> I've seen some reference to $R_HOME/etc/ldpaths but I don't have access
> to system files, and I definitely don't want this visible to other
> users.
>
> I ran into this under Open MPI, but the previous example didn't use MPI
> at all.
>
> I'm picking up the wrong libraries; what do I need to do so that my
> personal library is searched first?
>
>
> Running Debian squeeze.




More information about the R-help mailing list