[R-sig-Debian] using R-devel independently of sid packages

Dirk Eddelbuettel edd at debian.org
Wed Oct 5 06:07:42 CEST 2011


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


-- 
New Rcpp master class for R and C++ integration is scheduled for 
San Francisco (Oct 8), more details / reg.info available at
http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php



More information about the R-SIG-Debian mailing list