[Rcpp-devel] LinkingTo: again

Romain François francoisromain at free.fr
Sun Dec 13 21:06:16 CET 2009


On 12/13/2009 08:40 PM, Dirk Eddelbuettel wrote:
>
> (first off thanks for catching that on r-help -- appreciated!)
>
> On 13 December 2009 at 20:06, Romain François wrote:
> | Hi,
> |
> | Coming back to this previous discussion.
> |
> | Can we deploy the header files in the installed "include" directory of
> | Rcpp, so that a package can use LinkingTo: Rcpp and have the include
> | directory magically added to the -I paths.
> |
> | I do this with parser and highlight, and it works fine : highlight uses
> | parser.h which lives in the include directory of parser.
> |
> | So I have :
> |
> | #include<parser.h>
> |
> | in my C code.
> |
> | and
> |
> | LinkingTo: parser
> |
> | in highlight's DESCRIPTION
>
> I looked at this a few times in the past, and was quite excited about it.
> But as I recall, I concluded it cannot work here because
>
>    a) we would have to declare _every export interface_ including all member
>       function slots etc pp -- that seems like an insance amout of work
>
>    b) there was another C++ reason, it may have to do with the less-clearly
>       defined signature the compiler generates so this may be C only


No, you don't need to do any of that. you can if you want (I think you 
define what Matrix uses), but you don't have to. As far as I can see it, 
adding "LinkingTo: foo" to the DESCRIPTION file just adds 
-Isomewhere/foo/include so that you can then do #include <somefile.h> 
where somefile.h is in the somewhere/foo/include directory.

This is it, no voodoo needed.

> Now, you have some pretty magic coding chops, so maybe you get it to work.  I
> didn't, and won't retry.
>
> The inline stuff is useful though.  For the rest, I think configure +
> Makevars can do it for us even across packages.  Yesterday I just spent some
> time helping the phylobase package santize their use (where they still have
> the insane method Dominick first set up where you build a static lib from
> configure (!!) so that src/Makefile can link to it. Blargh.  Better now, but
> haven't heard from them yet. See the top-level commit for phylobase on R-Forge.
>
> Dirk
>


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/HlX9 : new package : bibtex
|- http://tr.im/Gq7i : ohloh
`- http://tr.im/FtUu : new package : highlight



More information about the Rcpp-devel mailing list