[Rcpp-devel] finding plugins

Balamuta, James Joseph balamut2 at illinois.edu
Sat Dec 1 18:59:21 CET 2018


Mark,

Consider:

cppFunction('//Anything', depends="RcppArmadillo", plugin="RcppArmadillo", verbose=TRUE)

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

Sincerely,

JJB

From: Rcpp-devel <rcpp-devel-bounces at lists.r-forge.r-project.org> on behalf of M A <markoilcan at gmail.com>
Date: Saturday, December 1, 2018 at 11:31 AM
To: "edd at debian.org" <edd at debian.org>
Cc: "rcpp-devel at lists.r-forge.r-project.org" <rcpp-devel at lists.r-forge.r-project.org>
Subject: Re: [Rcpp-devel] finding plugins

Yes, thanks, I did at least manage to read through the FAQ, but, unfortunately, none of the mentions of 'plugins' was helpful for my questions. I can search through the source to find the plugins that come with Rcpp, but I'm not familiar enough with the necessary mechanisms to know what hooks to look for or use to be able to list currently registered plugins.

An issue is that I can't get at least some plugins to work with cppFunction. For instance:
library(Rcpp)
library(RcppArmadillo)
library(inline)
cppFunction('//Anything', depends="RcppArmadillo", plugin="RcppArmadillo", verbose=TRUE)

just gives error:
Error in .findPlugin(pluginName) :
  Inline plugin 'RcppArmadillo' could not be found within the Rcpp package. You should be sure to call registerPlugin before using a plugin.

Thanks,
Mark

On Sat, Dec 1, 2018 at 9:18 AM Dirk Eddelbuettel <edd at debian.org<mailto:edd at debian.org>> wrote:

On 30 November 2018 at 21:49, M A wrote:
| Is there a standard way to list what plugins are available in Rcpp? And,
| given a plugin, how do I find out what exactly is in that plugin? I did
| find in the inline package inline::getPlugin() for the second of these
| questions, but it does not work on Rcpp plugins (e.g. the openmp plugin)
| and I can't find an equivalent in Rcpp. These seem like they should be easy
| questions with obvious solutions, but I can't find anything. Sorry if I did
| miss something obvious.

Have you found this obvious answer yet:

   Rcpp FAQ Question 3.6
   "How do I write a plugin for inline and/or Rcpp Attributes"

My pdf reader shows me 36 hits for 'plugin' in that Rcpp FAQ document.

As for 'what exists': there is no central registry as packages can bring
their own; the mechanism is such that when a package loads it can register
upon load.  You could use the same hooks to a) scan all your installed (but
not yet loaded) packages and b) list currently registered plugins. I don't
think anybody has written such a helper yet.

As for 'what is in it':  "Use the source, Luke."

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org<mailto:edd at debian.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20181201/007cc3a5/attachment-0001.html>


More information about the Rcpp-devel mailing list