[Rcpp-devel] finding plugins

M A markoilcan at gmail.com
Sat Dec 1 22:05:51 CET 2018


Sorry, I, in fact, wasn't clear about my problem. Essentially I'm going to
benchmark some matrix operations using R, RcppEigen, and RcppArmadillo so
when I do my real problem I'm using fast code. Part of this involves seeing
the effect of multithreading (with either openmp or through a multithreaded
BLAS, while making sure I'm only doing one of those at a time) and other
possible compiler flags. Right now, I'm just trying to learn how to do
these things with Rcpp.

The matrix operation code is not long, so I thought the easiest thing for
now would be to use cppFunction. Documentation in RcppEigen, for instance,
uses cxxfunction which specifies the plugin "RcppEigen", and this is also
what is mostly used in the Rcpp FAQ with an "RcppArmadillo" plugin. The
help page for cppFunction also says that the plugins argument is a
character vector of *inline* plugins. James' message has made me realize
that, actually, there's a difference between a plugin in the cxxfunction
and a plugin in cppFunction. At least for RcppEigen and RcppArmadillo the
correct translation is from cxxfunction(..., plugin="RcppX") to
cppFunction(..., depends="RcppX"). To get the compiler flags I want, I
think I have to write my own Rcpp plugin, which would then be a plugin for
cppFunction (and presumably in c++ source file in the attribute //
[[Rcpp::plugins(myflags)]].


Mark


On Sat, Dec 1, 2018 at 12:14 PM Dirk Eddelbuettel <edd at debian.org> wrote:

>
> Mark,
>
> You still haven't explained what your actual problem is. Or maybe I missed
> it.
>
>
> James,
>
> On 1 December 2018 at 17:59, Balamuta, James Joseph wrote:
> | Armadillo is not a plugin but a library. Plugins are for changing the
> C++ compilation standard, enabling OpenMP, or changing the long jump
> behavior. Examples of built-in plugins can be found here:
> |
> |
> https://github.com/RcppCore/Rcpp/blob/b7dc5f16488d5b6f46bf3aadbce3ef06ca72ff3f/R/Attributes.R#L469-L534
> |
> | Perhaps try with:
> |
> | cppFunction('//Anything', depends="RcppArmadillo", verbose=TRUE)
> |
> | Full list:
> |
> |
> |   *   cpp98
> |   *   cpp11
> |   *   cpp0x
> |      *   older gcc C++11
> |   *   cpp14
> |   *   cpp1y
> |      *   C++14/C++17 standard under dev
> |   *   cpp17
> |   *   cpp1z
> |      *   C++17 standard under dev
> |   *   openmp
> |      *   Enable OpenMP
> |   *   unwindProtect
> |      *   long jump behavior
>
> Plus, as I said, all the ones brought by packages using Rcpp as eg this
> reasonably powerful one for RcppGSL which sets compile and link options:
>
> https://github.com/eddelbuettel/rcppgsl/blob/master/R/inline.R#L47-L59
>
> Maybe this could even be answered with a proper GitHub search query for eg
> Rcpp.plugin.maker.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20181201/d3c33ee6/attachment.html>


More information about the Rcpp-devel mailing list