<div dir="ltr">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.<div><br></div><div>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)]].</div><div><br></div><div><br></div><div>Mark</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Dec 1, 2018 at 12:14 PM Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Mark,<br>
<br>
You still haven't explained what your actual problem is. Or maybe I missed it.<br>
<br>
<br>
James,<br>
<br>
On 1 December 2018 at 17:59, Balamuta, James Joseph wrote:<br>
| 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:<br>
| <br>
| <a href="https://github.com/RcppCore/Rcpp/blob/b7dc5f16488d5b6f46bf3aadbce3ef06ca72ff3f/R/Attributes.R#L469-L534" rel="noreferrer" target="_blank">https://github.com/RcppCore/Rcpp/blob/b7dc5f16488d5b6f46bf3aadbce3ef06ca72ff3f/R/Attributes.R#L469-L534</a><br>
| <br>
| Perhaps try with:<br>
| <br>
| cppFunction('//Anything', depends="RcppArmadillo", verbose=TRUE)<br>
| <br>
| Full list:<br>
| <br>
| <br>
|   *   cpp98<br>
|   *   cpp11<br>
|   *   cpp0x<br>
|      *   older gcc C++11<br>
|   *   cpp14<br>
|   *   cpp1y<br>
|      *   C++14/C++17 standard under dev<br>
|   *   cpp17<br>
|   *   cpp1z<br>
|      *   C++17 standard under dev<br>
|   *   openmp<br>
|      *   Enable OpenMP<br>
|   *   unwindProtect<br>
|      *   long jump behavior<br>
<br>
Plus, as I said, all the ones brought by packages using Rcpp as eg this<br>
reasonably powerful one for RcppGSL which sets compile and link options:<br>
<br>
<a href="https://github.com/eddelbuettel/rcppgsl/blob/master/R/inline.R#L47-L59" rel="noreferrer" target="_blank">https://github.com/eddelbuettel/rcppgsl/blob/master/R/inline.R#L47-L59</a><br>
<br>
Maybe this could even be answered with a proper GitHub search query for eg<br>
Rcpp.plugin.maker. <br>
<br>
Dirk<br>
<br>
-- <br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div>