[Rcpp-devel] Compiling packages that use RcppArmadillo

Slava Razbash slava.razbash at gmail.com
Tue Oct 18 13:48:32 CEST 2011


Hello,

Could you please confirm/deny if I am compiling "correctly". The
compiled package works, but I want to make sure that things are done
properly and that I am not using a "hack" that could cause unintended
side effects.

I have a pre-existing package, the package previously does use some C
code, but it is through the .C interface. As well as this code, I
wrote some additional code that used RcppArmadillo.

To integrate my code into the package, I ran:
>library(RccpArmadillo)
>RccpArmadillo.package.skeleton("hello_world")

I then renamed and modified the .cpp and .h files in the src directory
and copied them along with the Makevars and Makevars.win files to the
src directory of my actual package.

I added exportPattern("^[[:alpha:]]+") to the NAMESPACE of my package.
I also added:

Depends: Rcpp (>= 0.9.7), RcppArmadillo (>= 0.2.29)
LinkingTo: Rcpp, RcppArmadillo

To the DESCRIPTION of my actual package.

It compiles and runs, but have I missed anything?

Thanks,

Slava


More information about the Rcpp-devel mailing list