Skip to content
Prev 45334 / 63421 Next

compiling C code using headers from another R package

On 03/12/2013 12:53 PM, Simon Urbanek wrote:
OK, thanks for the clarification. I agree with you that putting
libgsl.* inside RGSL sounds like a complicated solution and that
LinkingTo wouldn't work.

FWIW I was suggesting the use of LinkingTo with a setup where RGSL
contains the GSL source code under src/ and the header files
under inst/include/. Plus an extra file under src/ for registering
the GSL API. As mentioned earlier, this is probably not the best
way to go, but that *should* work.

The reason I'm interested in clarifying this is that we are facing
a similar situation with other libraries (e.g. the BOOST library)
used by some Bioconductor packages. Right now, each Bioconductor
package includes its own version of the BOOST source code, which
is of course less than optimal. Ideally we'd want to wrap the BOOST
source (or a subset of it, it's huge!) in something like an rBOOST
package and use a setup similar to what I describe above for RGSL
(i.e. using LinkingTo). Are there better ways? Is there something
like an RcppBOOST package? Sounds like, like for the GSL, it would
be better to install the static BOOST libs on the build machine and
have client packages link against that (but that also means more
complexity in the client packages since they need a configure script).

Thanks,
H.
ke