[Bioc-devel] Rscript on Bioconductor test servers

Henning Redestig henning.red at googlemail.com
Tue Jan 5 07:11:33 CET 2010

Hi Seth,

2010/1/5 Seth Falcon <sfalcon at fhcrc.org>:
> It seems like this should be a case where LinkingTo should help you.
> From Writing R Extensions:
> * WRE 5.4 Registering native routines
>> A package that wishes to make use of header files in other packages
>> needs to declare them as a comma-separated list in the field
>> LinkingTo in the DESCRIPTION file. For example
>> Depends: link2, link3 LinkingTo: link2, link3
>> It should also `Depend' on those packages for they have to be
>> installed prior to this one, and loaded prior to this one (so the
>> path to their compiled code can be found).
>> This then arranges that the include directories in the installed
>> linked-to packages are added to the include paths for C and C++ code.

According to the author of Rcpp, Dirk Eddelbuettel, this is tricky for C++.

>From http://dirk.eddelbuettel.com/code/rcpp.html :
   What about using LinkingTo in the DESCRIPTION file?  Great
   question, but nobody has explained yet how to do that for C++. For
   C, we could do what lme4 and matrix do. But for C++? The 'name
   mangling' really gets in the way. Let us know if you know how to do this.

and therefore he suggests the Makevars script approach.

> Your suggested solution has two potential problems:
> 1. You are proposing to use ":::" to access private functions from within a
> package.  If these functions are meant to be used outside of Rcpp, then they
> should be exported and then be accessible using "::".

Good point, I have forwarded this to the Rcpp-devel list.

> 2. Calling Rscript or even R without qualification can be a problem since it
> may not refer to the version of R that is doing the installation. I will do
> some looking, but I think a better way would be to refer to $(R_HOME)/bin/R
> in Makevars. You don't need Rscript for this, the following would work:
> $(R_HOME)/bin/R --slave -e "1:5" # your code here

On my computer (ubuntu) I could get:

PKG_CPPFLAGS = $(shell $(R_HOME)/bin/R --slave -e 'Rcpp:::CxxFlags()')
PKG_LIBS = $(shell $(R_HOME)/bin/R --slave -e 'Rcpp:::LdFlags()')

to work, and am now waiting to see what Bioconductors servers think.


/Henning Redestig

Metabolomics Research Group | RIKEN Plant Science Center

More information about the Bioc-devel mailing list