[Rd] Detecting development environment

Simon Urbanek simon.urbanek at r-project.org
Mon Jun 13 16:36:11 CEST 2011

On Jun 13, 2011, at 10:21 AM, Hadley Wickham wrote:

> Hi all,
> Is there a straight-forward, cross-platform way of determining if a
> user has all the tools needed to develop R packages (i.e. gcc etc)?
> It doesn't need to be 100%, but should give a rough idea.  One idea I
> had was simply to see if system("R CMD install --help") worked.

That's not really checking pretty much anything (even if you used INSTALL ;)) since all it does is to run R.

More reasonable quick check may be R CMD SHLIB, though, since that involves both make and gcc:

echo 'void foo(int *bar) { *bar=1; }' > foo.c && R CMD SHLIB foo.c

And you could even check feasibility with something like

stopifnot(.C("foo",0L)[[1]] == 1L)

More information about the R-devel mailing list