Skip to content

using R-devel independently of sid packages

5 messages · Sébastien Bihorel, Steffen Möller, Dirk Eddelbuettel

#
Hi,

I'd like to run R-devel in a sid system that has the corresponding R
packages installed (most of them).  I'd be using this primarily for
testing how packages that I maintain would build and check there.  I
know this is available via http://www.r-project.org/nosvn/R.check, but
in some cases I need more control.  I thought I'd have R-devel trunk
live in /usr/local/src/R-devel, and then run it like:

R_LIBS_USER=/usr/local/lib/R-devel/site-library /usr/local/src/R-devel/bin/R

so that I can have packages built with R-devel in a different directory
from those that the Debian packages use (/usr/local/lib/R/site-library).

What is good Debianish practice for running R-devel with an independent
local library for it?

Cheers,
#
On 4 October 2011 at 15:40, Sebastian P. Luque wrote:
| Hi,
| 
| I'd like to run R-devel in a sid system that has the corresponding R
| packages installed (most of them).  I'd be using this primarily for
| testing how packages that I maintain would build and check there.  I
| know this is available via http://www.r-project.org/nosvn/R.check, but
| in some cases I need more control.  I thought I'd have R-devel trunk
| live in /usr/local/src/R-devel, and then run it like:
| 
| R_LIBS_USER=/usr/local/lib/R-devel/site-library /usr/local/src/R-devel/bin/R
| 
| so that I can have packages built with R-devel in a different directory
| from those that the Debian packages use (/usr/local/lib/R/site-library).
| 
| What is good Debianish practice for running R-devel with an independent
| local library for it?

In essence, I do what you do:

 - keep r-devel from svn 

 - configure; make; make install it  to a directory in /usr/local/lib

 - keep the binaries out of the $PATH and use shell wrappers and variables
   to launch it 

Not ideal, but gets the job done and I won't have time do anything fancier.
If you wanted to, you could wrap the above into a local .deb package too.

Dirk
#
On 10/05/2011 12:06 AM, Dirk Eddelbuettel wrote:
If you decide to go for a package, you may want to have a look at the
gcc-snapshot package which basically installs itself to /usr/lib/gcc-snapshot.
So this would be much like /usr/lib/r-devel for you then, I presume. I do
not know if this is the most Debianish way to do it, or even if I like it,
but one gets used it it.

Cheers,

Steffen
#
On Tue, 4 Oct 2011 17:06:17 -0500,
Dirk Eddelbuettel <edd at debian.org> wrote:
[...]
I guess it doesn't matter much where the SVN checkout goes, but I've
been doing:

cd /usr/local/src/R-devel
svn co https://svn.r-project.org/R/trunk

and then configure and make.  What's the advantage of 'make install' to
/usr/local/lib?

I have /usr/local/bin in $PATH, and then wrote a wrapper script
(/usr/local/bin/R-devel) like you suggest:

---<--------------------cut here---------------start------------------->---
#! /bin/sh
R_LIBS_USER=/usr/local/lib/R-devel/site-library \
    /usr/local/src/R-devel/bin/R
---<--------------------cut here---------------end--------------------->---

so that running it would give:

R> .libPaths()
[1] "/usr/local/lib/R-devel/site-library" "/usr/local/src/R-devel/library"     

which allows install.packages(), update.packages(), 'R-devel CMD ...'
for that matter, to work on the first element by default, as is usually
intended.

A neat about this is that if 'exec-path' in Emacs has the path where
this wrapper is (/usr/local/bin in my case), then ESS understands it as
an R version to run with all the goodies that implies.
The above seems comfortable enough to me.  Thanks for these pointers!
#
On 4 October 2011 at 22:16, Sebastian P. Luque wrote:
| On Tue, 4 Oct 2011 17:06:17 -0500,
| Dirk Eddelbuettel <edd at debian.org> wrote:
| 
| [...]
| 
| > In essence, I do what you do:
| 
| >  - keep r-devel from svn
| 
| >  - configure; make; make install it to a directory in /usr/local/lib
| 
| >  - keep the binaries out of the $PATH and use shell wrappers and
| > variables to launch it
| 
| I guess it doesn't matter much where the SVN checkout goes, but I've
| been doing:
| 
| cd /usr/local/src/R-devel
| svn co https://svn.r-project.org/R/trunk

It is completely irrelevant where svn sources live. Mine, by my habit, are
all below ~/svn/

| and then configure and make.  What's the advantage of 'make install' to
| /usr/local/lib?

As I and yu said: to have it tucked away where it does not interfere.

My configure script is:

-----------------------------------------------------------------------------
#!/bin/sh

cd ~/svn/r-devel

R_PAPERSIZE=letter				\
R_BATCHSAVE="--no-save --no-restore" 		\
R_BROWSER=xdg-open				\
PAGER=/usr/bin/pager				\
PERL=/usr/bin/perl				\
R_UNZIPCMD=/usr/bin/unzip			\
R_ZIPCMD=/usr/bin/zip				\
R_PRINTCMD=/usr/bin/lpr				\
LIBnn=lib					\
AWK=/usr/bin/awk                                \
CC="ccache gcc"					\
CFLAGS="-ggdb -pipe -std=gnu99 -Wall -pedantic -DTESTING_WRITE_BARRIER" \
CXX="ccache g++"				\
CXXFLAGS="-ggdb -std=c++0x -pipe -Wall -pedantic" \
FC="ccache gfortran"				\
FCFLAGS="-ggdb -pipe -Wall -pedantic"		\
F77="ccache gfortran"				\
FFLAGS="-ggdb -pipe -Wall -pedantic"		\
MAKE="make -j4"					\
./configure 					\
    --prefix=/usr/local/lib/R-devel 		\
    --enable-R-shlib 				\
    --enable-strict-barrier 			\
    --with-blas 				\
    --with-lapack 				\
    --with-readline 				\
    --without-recommended-packages

make svnonly
-----------------------------------------------------------------------------

and the key is the --prefix=... argument which determines the location. The
rest is similar to the .deb package, plus some debugging switches.

| I have /usr/local/bin in $PATH, and then wrote a wrapper script
| (/usr/local/bin/R-devel) like you suggest:
| 
| ---<--------------------cut here---------------start------------------->---
| #! /bin/sh
| R_LIBS_USER=/usr/local/lib/R-devel/site-library \
|     /usr/local/src/R-devel/bin/R
| ---<--------------------cut here---------------end--------------------->---
| 
| so that running it would give:
| 
| R> .libPaths()
| [1] "/usr/local/lib/R-devel/site-library" "/usr/local/src/R-devel/library"     
| 
| which allows install.packages(), update.packages(), 'R-devel CMD ...'
| for that matter, to work on the first element by default, as is usually
| intended.
| 
| A neat about this is that if 'exec-path' in Emacs has the path where
| this wrapper is (/usr/local/bin in my case), then ESS understands it as
| an R version to run with all the goodies that implies.

Nice! 
| 
| > Not ideal, but gets the job done and I won't have time do anything
| > fancier.  If you wanted to, you could wrap the above into a local .deb
| > package too.
| 
| The above seems comfortable enough to me.  Thanks for these pointers!

Always a pleasure!

Dirk