[R] Transferring R to another computer, R_HOME_DIR

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Apr 26 09:48:32 CEST 2013


This is really an R-devel topic: it is not about using R.

R is usually (but not always) built so that everything except Rscript is 
relocatable by editing the 'R' script (and R_HOME and R_HOME_DIR are 
ignored in the environment, intentionally).

So you could edit the script, but not having Rscript working is a 
limitation.

Having said that, not all packages play by the same rules and e.g. some 
use -rpath to hardcode paths in package DSOs.


On 26/04/2013 06:13, lcn wrote:
> Well, to my understanding, you planned to rsync the original compiled
> folder from one machine to somewhere on another machine, and work with it.
> Then how about create a file link on the second machine for "/usr/lib64/R"?
> Or maybe I misunderstand your purpose?

If you have write permission there, you could install the R RPM.

>
>
> On Thu, Apr 25, 2013 at 5:57 PM, Saptarshi Guha <saptarshi.guha at gmail.com>wrote:
>
>> Hello,
>>
>> I was looking at the R (installed on RHEL6) shell script and saw
>> R_HOME_DIR=/usr/lib64/R. Nowhere (and I could have got it wrong) does
>> it read in the environment value R_HOME_DIR. I have the need to rsync
>> the entire folder below /usr/lib64/R to another computer into another
>> directory location. Without changing the R shell script, how can i
>> force it read in R_HOME_DIR?
>>
>> Or maybe i misunderstood the bash source?
>>
>> (Note, i cannot recompile on target machine)
>>
>> Cheers
>> Saptarshi
>>
>> 1. I also realize Rscript will not work (i think path is hard coded in the
>> source)

No, compiled it when it is compiled.

>>
>> Beginning of /usr/lib64/R/bin/R
>>
>> R_HOME_DIR=/usr/lib64/R
>> if test "${R_HOME_DIR}" = "/usr/lib64/R"; then
>>     case "linux-gnu" in
>>     linux*)
>>       run_arch=`uname -m`
>>       case "$run_arch" in
>>          x86_64|mips64|ppc64|powerpc64|sparc64|s390x)
>>            libnn=lib64
>>            libnn_fallback=lib
>>          ;;
>>          *)
>>            libnn=lib
>>            libnn_fallback=lib64
>>          ;;
>>       esac
>>       if [ -x "/usr/${libnn}/R/bin/exec/R" ]; then
>>          R_HOME_DIR=/usr/lib64/R
>>       elif [ -x "/usr/${libnn_fallback}/R/bin/exec/R" ]; then
>>          R_HOME_DIR=/usr/lib64/R
>>       ## else -- leave alone (might be a sub-arch)
>>       fi
>>       ;;
>>    esac
>> fi
>>
>>          [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
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-help mailing list