[Rd] Building packages

Oleg Sklyar osklyar at ebi.ac.uk
Fri Dec 7 17:21:54 CET 2007


These files in the SVN tree does not harm the things that are checked
in. However it is indeed reasonable to keep the rubbish out, so:

> I've started a new package and I'm trying to work out the best way to do 
> it. I'm managing my package source directory with SVN, but "R CMD build" 
> likes to dump things in the inst/doc directory when making vignette PDF 
> files. I don't want to keep these in SVN (they aren't strictly 
> 'source'), so it set me thinking.
Solution 1: copy the package SVN dir elsewhere and build/install from
there
Solution 2: a better one, make a 2-liner shell script that runs solution
1 (what I do)

This will also prevent gcc from populating your svn src directory
with .o, .so, .d, .dll files.

> One of the other projects I work with has an out-of-source build system. 
> You make a 'build' directory, run a config system (cmake-based) and then 
> 'make' does everything in the build directory without touching the 
> source tree. Very nice and neat. How much work would it take to have 
> something similar for building R packages? At present I've just got some 
> svn:ignore settings to stop SVN bothering me.
R does understand 'configure' which is more reasonable then to require
cmake to be installed. Think of multiplatform builds etc.

>   I also hit the problem of vignettes needing the package to be 
> installed before being able to build them, but not being able to install 
> the package because the vignettes wouldn't build without the package 
> already being installed. The fix is to build with --no-vignettes, then 
> install the package, then build with the vignettes enabled. Seems 
> kludgy, plus it means that vignettes are always built with the currently 
> installed package and not the currently-being-installed package. So I 
> install and do a second pass to get it all right again.
If I am not mistaken R CMD build builds the package temporarily and uses
that build to build the vignette, so where is the problem? All my
vignettes build fine on both Linux and Windows and on Windows you
actually see that running R CMD build --binary builds the source code
two times - exactly for the above purposes.

> 
>   Or am I doing it wrong?
> 
>   Once I get smooth running of R package development and SVN I might 
> write it up for R-newsletter - there's a couple of other tricks I've had 
> to employ...
What exactly?

> 
> Barry
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
-- 
Dr Oleg Sklyar * EBI-EMBL, Cambridge CB10 1SD, UK * +44-1223-494466



More information about the R-devel mailing list