I want to use RcppGSL and RcppArmadillo at the same time, is that possible to use multiple plugins in cxxfunction (of the inline CRAN package) ? I found a way to do:
plug.ArmaGSL <- Rcpp:::Rcpp.plugin.maker(include.before='#include <RcppArmadillo.h>
#include <RcppGSL.h>
#include <gsl/gsl_rng.h>',
Depends=c("RcppGSL", "RcppArmadillo", "Rcpp"),
LinkingTo=c("RcppGSL", "RcppArmadillo", "Rcpp"),
libs="-lgsl -larmadillo")
registerPlugin("RcppArmaGSL", plug.ArmaGSL)
foo <- cxxfunction(signature(sM="numeric"), body=bodytxt, inc=inctxt, plugin="RcppArmaGSL")
but it seems not that intuitive.
A simple way is to start from an existing plugin, say:
require(inline)
require(RcppArmadillo)
foo <- getPlugin("RcppArmadillo" )
and then mess with foo, and use it as the settings argument in the cxxfunction call. More on that in ?cxxfunction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With