Does Rcpp11 work with RcppArmadillo and RcppEigen

230 views
Skip to first unread message

Gabor Grothendieck

unread,
May 26, 2014, 3:29:00 PM5/26/14
to r-an...@googlegroups.com
Does Rcpp11 work with RcppArmadillo and RcppEigen or will separate versions of those packages be needed?

Romain François

unread,
May 26, 2014, 5:12:25 PM5/26/14
to Gabor Grothendieck, r-an...@googlegroups.com, Douglas Bates
Hello, 

Good question. 

I know less about Eigen than I know about armadillo, my involvement on RcppEigen was more consultative to help Doug at the time.

Conceptually, it would be nice to be able to use RcppArmadillo with Rcpp11. I had made some suggestions in this issue. https://github.com/RcppCore/RcppArmadillo/issues/13 so that RcppArmadillo could be made Rcpp implementation independent. But discussion was ... not really fertile. 

Furthermore, some of the glue code, e.g. how to implement wrap and as, etc … has changed between Rcpp and Rcpp11 so we’d have to write some new glue code. It should however be easier to write it than it was originally when RcppArmadillo was written. 

Now I don’t particularly want to write a new package, say Rcpp11Armadillo. 

A conceptually possible option would be to allow third party code to just get the armadillo code from RcppArmadillo (but not the not compatible Rcpp glue code), and perhaps host the glue code in Rcpp11 itself. 

A client package would then have LinkingTo: Rcpp11, RcppArmadillo

We would not take from RcppArmadillo the not compatible glue code or the useless fastLm etc … from src/

Or we could have a very small Rcpp11Armadillo package that would just host the Rcpp11 specific glue code. In this case client package would need LinkingTo: Rcpp11, Rcpp11Armadillo, RcppArmadillo  but I think I prefer to host the glue code in a future version of Rcpp11. 

What I definitely don’t want to do is maintain another package that would ship all armadillo again. Dirk handles that pretty well. Would be better for me if RcppArmadillo was header only. Quite a shame it is not given armadillo is a header only library. 

So: can be done with some small effort to write Rcpp11 compatible glue code. 

It is probably not a huge effort. Handling wrap should be easy enough as this is pretty much frozen in Rcpp11. We however have some more work to do with `as`. 
https://github.com/Rcpp11/Rcpp11/issues/175. I’ll probably delay production of armadillo/Rcpp11 glue code until this is done. 

Romain 

Le 26 mai 2014 à 21:28, Gabor Grothendieck <ggroth...@gmail.com> a écrit :

Does Rcpp11 work with RcppArmadillo and RcppEigen or will separate versions of those packages be needed?

--
You received this message because you are subscribed to the Google Groups "R and C++" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-and-cpp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Romain François

unread,
May 27, 2014, 6:11:09 AM5/27/14
to Gabor Grothendieck, r-an...@googlegroups.com, Douglas Bates
FYI, I just opened an issue on github about this. https://github.com/Rcpp11/Rcpp11/issues/185

Gabor Grothendieck

unread,
May 27, 2014, 7:06:26 AM5/27/14
to r-an...@googlegroups.com
Ideally it would be Eigen too, not just Armadillo.  

Romain François

unread,
May 27, 2014, 7:43:14 AM5/27/14
to Gabor Grothendieck, r-an...@googlegroups.com
Ideally someone will volunteer to do it :)

I’ve only been following RcppEigen from a distance. From what I see it should not be too hard to use the same approach as proposed for armadillo (i.e. leverage the code base from RcppEigen. But again RcppEigen is polluted by some actually compiled code in src, so again it will have to be done carefully). 

Romain

Reply all
Reply to author
Forward
0 new messages