From edd at debian.org  Sat Sep 21 23:03:37 2013
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sat, 21 Sep 2013 16:03:37 -0500
Subject: [Rd] regenerate Rscript after moving R installation
In-Reply-To: <1021845929.1859.1379792352728.JavaMail.zimbra@openanalytics.eu>
References: <847693355.1777.1379787265680.JavaMail.zimbra@openanalytics.eu>
	<145722967.1797.1379789012433.JavaMail.zimbra@openanalytics.eu>
	<21053.60604.509740.183222@max.nulle.part>
	<1021845929.1859.1379792352728.JavaMail.zimbra@openanalytics.eu>
Message-ID: <21054.2473.846704.526560@max.nulle.part>


Tobias,

On 21 September 2013 at 21:39, Tobias Verbeke wrote:
| The package that made me discover this was RcppEigen which has indeed

Never heard of it :)
 
| PKG_LIBS=`$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
|  
| > where a key part is the `$(R_HOME)/bin` which permits you to transparently
| > switch between R-release, R-devel, R-beforeMove, R-afterMove, R-whatevr, ...
| > simply by adjusting your shell's $PATH variable, or the R wrapper you for R
| > CMD, or ...
| > 
| > It. Just. Works.
| 
| It is neat and certainly works, unless R is built on another location (on a build machine)
| prior to being put on its final location.
| 
| If I read the strace output below correctly, the origin of the problem is the hardcoded
| location of the R binary.
[...]
| There is no way to build again since R itself is shipped (in a Debian/Ubuntu package
| and as part of Architect) prior to being installed and used on another computer.
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I do not know what 'Architekt' is -- but maybe you just mistakenly assume
that you can mv(1) installations at will?  And maybe you can't?  Consider the

        configure --prefix=/some/location/ ...
        make
        make install

where /some/location gets set at compile-time. 

You seem to wish it didn't.  But wishing alone may not make it so. In all
seriousness, these binaries may not be relocatable at will.

| The buildstamp that is part of the final installation path of the application is 
| generated after the R build (since R is only one component), so changing the --prefix
| on the build machine would not work (currently).
| 
| I hope this gives more background to the question and would be curious if there are alternatives
| to rapidly regenerate the Rscript executable only.
| 
| (My other alternative of messing with the path in a hex editor has not been successful :-)

I'd go back to rebuilding for the target location. 

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



[Rd] regenerate Rscript after moving R installation
Dirk Eddelbuettel