[R-pkg-devel] CRAN and CMake

Duncan Murdoch murdoch.duncan at gmail.com
Wed Jun 10 19:56:31 CEST 2015


On 10/06/2015 1:14 PM, Gábor Csárdi wrote:
> On Wed, Jun 10, 2015 at 11:28 AM, Tim Keitt <tkeitt at utexas.edu> wrote:
> [...]
> >
> > Is there  a way to allow the user to use a system installed cmake if they
> > choose? The issue is R package dependencies -- a package author may put the
> > R cmake package in depends and then everyone is forced to install the R
> > package version even if they already have cmake.
>
> It is not easy IMO. You can't declare that you need an R package or a
> system package. AFAIK you can't even say that you need either this
> package or that package.
>
> cmake is clearly a build time dependency, like knitr for building
> vignettes, but you can't explicitly declare build dependencies either.
>
> The closest would be 'Suggests', and then at build time you get an
> error message if there is no system cmake and no 'cmaker' package
> either. Not quite perfect, though.
>
> Gabor
>
> [...]
That's not quite right.  I would guess that cmake would normally be an 
install time dependency:  you need it to compile the code in the 
package.  If so, then listing it in the SystemRequirements field is 
fine.  Only the maintainer needs to build a package (i.e. produce a 
.tar.gz file).  Vignettes are a little weird:  CRAN wants to check that 
they can be built (that's the point of them),
but maintainers may have special resources needed for them.  So they get 
built and installed in the tarball.  And you can declare packages needed 
only for building vignettes:  use Suggests as well as VignetteBuilder.

Generally we want R packages to be open source, so big transformations 
of the code at build time (the kind that lose the source) are discouraged.

If you want to declare a dependence on a system resource at install time 
(when the package code is compiled), use SystemRequirements. There's 
also LinkingTo, to declare that you are linking to code in another 
package.  We don't have something that says "this package is needed to 
install mine", but I suspect one of LinkingTo, Imports or Depends would 
be fine, even though they aren't strictly correct.

Duncan Murdoch



More information about the R-package-devel mailing list