[Rd] Are R packages supposed to be "relocatable"? (avoiding BioConductor scripts...)

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jul 19 22:41:27 CEST 2012


Short answer:

setRepositories() # chose what you want from BioC
install.packages()

works and always has. 'Smoke and mirrors' are not actually needed.

As for relocatability:

I am guessing you are talking about a Linux cluster ... but the details 
do matter.

The distribution of Windows binaries relies on installed packages being 
relocatable, so most packages are written to be.  There are a very few 
exceptions: the one most frequently encountered is packages linked to 
Rcpp, which on Linux put the path to Rcpp in their DSOs.  So you can 
relocate the package, but not the Rcpp installation it is linked to. 
(Not a problem on other OSes as it statically links elsewhere.)

A question you did not ask is if you can use differently located R: in 
most cases yes (I regularly run different versions of R with the same 
library trees).

We've relocated complete CRAN/BioC installations on Linux several times.

On 19/07/2012 17:13, Paul Johnson wrote:
> I've asked a question in the BioConductor list about package
> management. My solution depends on your answer to the following
> question.
>
> Are installed R packages "relocatable"?
>
> I mean relocatable in the same sense that files in a RedHat RPM file
> might be "relocatable" after compiling
> (http://www.rpm.org/max-rpm/ch-rpm-reloc.html).  This allows one to
> build a package as the ordinary user and then the root user can take
> the result and put it wherever it fits well in the path (say,
> /usr/local/lib/R/library).
>
> Here is why I asked.  I manage packages in our cluster and some users
> have asked me to install some BioConductor packages.  BioConductor
> install documents expect me to run a script as root that does a bunch
> of changes, and I'm just unwilling to do that.  If I have to do
> something as root, it has to be something more focused like running a
> particular R command (install.packages(), for example).  It seems
> insane to me that they expect (http://www.bioconductor.org/install) a
> root user to run
>
> source("http://bioconductor.org/biocLite.R")
> biocLite("limma")
>
> If I could do the installs as me with their script, and then copy the
> install folder into the system, then it would be OK, if the packages
> would work.
>
> Or perhaps post-processing is required to fiddle some paths inside
> package files?
>
> pj
>


-- 
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



More information about the R-devel mailing list