[Rd] regenerate Rscript after moving R installation

Simon Urbanek simon.urbanek at r-project.org
Tue Sep 24 12:42:10 CEST 2013


Murray,

On Sep 24, 2013, at 2:18 AM, Murray Stokely <murray at stokely.org> wrote:

> Simon, do you have some examples of packages with this attribute?

As Brian pointed out, some of them concern linking (I'm typically worried about OS X and Dirk has fixed Rcpp there), but there are also others that store package paths in variables or in supplementary files. Others store system paths as well (i.e. you can move R but not any dependent resources). Unfortunately this is hard to detect, because of lazy-loading (all lazy-load files have the paths baked in the namespace, so they will always include the path that you installed to originally) -- one example of a hard-coded variable is race.


>  Removing the hard-coding of paths in base R and Rscript is one of the many local patches we've maintained in the R I use at my workplace since at least the R 2.5 days.  We do this to enable us to send R and all its dependencies off to build farms, unit test clusters, and production clusters for running parallel computations among other use cases where the path of the build server is irrelevant to the server running the R code.
> 
> I don't recall running into any packages where an absolute path from the build host was hard-coded into the package such that we had to update code to get it to work.  But maybe I'm just not using those packages.
> 

It is hard to detect. The linking ones typically fail right away, but those with hard-coded paths inside may fail only in some use cases.

Cheers,
Simon


>               - Murray
> 
> 
> On Sat, Sep 21, 2013 at 6:45 PM, Simon Urbanek <simon.urbanek at r-project.org> wrote:
> I forgot to mention that some packages bake-in paths as well, so even if you fix both R and Rscript, it will still not work in general.
> 
> On Sep 22, 2013, at 3:42 AM, Simon Urbanek <simon.urbanek at r-project.org> wrote:
> 
> > On Sep 21, 2013, at 8:43 PM, Tobias Verbeke <tobias.verbeke at openanalytics.eu> wrote:
> >
> >> L.S.
> >>
> >> In this bug report
> >>
> >> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14493#c1
> >>
> >> it is mentioned that after moving an R installation
> >> one should regenerate the Rscript executable.
> >>
> >> Is there an easy way to do so (after an R installation has been
> >> moved)?
> >>
> >
> > You cannot move installed R. Once you run make install, there are several places in which paths get baked in - mainly Rscript and the R start script. What I typically do for deployment on the Labs machines is to use make install rhome=<xxx> where <xxx> is some path that I can always create a symlink in (I also use DESTDIR so that path doesn't actually need to exist on the build machine and it avoid polluting --prefix which is not needed). That way you can move R wherever you want as long so you keep that one symlink up to date.
> >
> > Cheers,
> > Simon
> >
> >
> >> I have not found any information in the R installation and
> >> administration manual.
> >>
> >> Many thanks in advance for any pointer.
> >>
> >> Best wishes,
> >> Tobias
> >>
> >> P.S. The background to this question is the usage of Rscript
> >> calls in the Makevars files of some R packages on CRAN, so
> >> the 'broken' Rscript prevents installation of certain R packages.
> >>
> >> --
> >>
> >> Tobias Verbeke
> >> Manager
> >>
> >> OpenAnalytics BVBA
> >> Jupiterstraat 20
> >> 2600 Antwerp
> >> Belgium
> >>
> >> E tobias.verbeke at openanalytics.eu
> >> M +32 499 36 33 15
> >> http://www.openanalytics.eu
> >>
> >> ______________________________________________
> >> R-devel at r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-devel
> >>
> >>
> >
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 



More information about the R-devel mailing list