Re: [Rd] Detecting development environment

From: Hadley Wickham <hadley_at_rice.edu>
Date: Mon, 13 Jun 2011 16:57:45 -0500

>> 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.

Well I guess it checks that you have your path set up right. But this is why I asked ;)

> 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
>
> dyn.load(paste("foo",.Platform$dynlib.ext,sep=''))
> stopifnot(.C("foo",0L)[[1]] == 1L)

Perfect - thanks!

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 13 Jun 2011 - 22:04:13 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 15 Jun 2011 - 11:40:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive