[R] install R in relative path
Tom Graves
tgraves_cs at yahoo.com
Thu Nov 3 21:44:06 CET 2016
Do you know if there is anyway to not have to put it in the PATH or symlink to the original build location? I was hoping just calling it in relative path like ./R-3.3.1/bin/Rscript would do it but it errors Rscript execution error: No such file or directory. is there any sort of RPATH (similar to like a PYTHONPATH) that I could use. It looks like just building it is still expecting it to be in the path it was built. In your example you are still symlinking R to be the original build location so everything is there.
What I need to do is build it, tar it up and ship it with my hadoop job which would untar it into something like ./R_install/.... I need to point to that ./R_install/bin/Rscript.
I am currently using R-3.2.1 so I'll try upgrading too.
Thanks,Tom
On Wednesday, October 19, 2016 3:38 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>>>>> Tom Graves via R-help <r-help at r-project.org>
>>>>> on Tue, 18 Oct 2016 21:06:54 +0000 writes:
> Hello everyone, I am trying to figure out if I can install
> R in a relative path?
Yes. Even better you don't have to "install" it at all in the
strict sense.
Just *build* it and run it from the build directory.
If you use the source tarball
currently, R-3.3.1.tar.gz, in 12 days will be R-3.2.2.tar.gz
Let's assume you'd want everything in your
$HOME/R-inst/
Then you do
----------------------------------------------------
cd ~/R-inst
tar xfz <whereever>/R-3.3.1.tar.gz
# now has created R-3.3.1
# we strongly recommend to use a *separate* build directory :
mkdir R-3.3.1-build
cd R-3.3.1-build
../R-3.3.1/configure
make
[[elided Yahoo spam]]
make check-all
----------------------------------------------------
Note that you do *NEVER* type 'make install' in the above setup
The only important remaining step is
make a symbolic link of R-3.3.1-build/bin/R
to a directory part of your PATH. If you are on a standard
unix/linux/(Mac?) setup :
mkdir -p ~/bin
cd ~/bin
ln -s ~/R-inst/R-3.3.1-build/bin/R .
Alternatively, you could do
export PATH=$HOME/R-inst/R-3.3.1-build/bin/R:$PATH
but I never do that.
Indeed, I use many R versions in this way, and in the above case
would use
ln -s ........../R-3.3.1-build/bin/R R-3.3.1
and then have R-3.0.0, R-3.0.1, ..., R-3.2.5 R-3.3.0 R-3.3.1
all in my PATH and all via symbolic links
(and ESS = Emacs Speaks Statistics finds all these
automagically, so I can each start easily from within Emacs).
Martin Maechler
ETH Zurich
> The reason I need to do this is to
> send R along to a Hadoop cluster so that I can use sparkR
> with the R version I shipped. The Hadoop cluster doesn't
> have R installed and the admin won't install it. I tried
> a few things but the things I had tried didn't work. Are
> there any options to configure or PATHs I could use to do
> this? Any help is appreciated. Thanks,Tom [[alternative
> HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and
> more, see 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]]
More information about the R-help
mailing list