[Rcpp-devel] Compilation errors when building a package with RcppArmadillo code and using attributes

JJ Allaire jj.allaire at gmail.com
Sun Dec 2 15:14:49 CET 2012


On Sun, Dec 2, 2012 at 8:35 AM, Howard Zail <howard at zail.org> wrote:
> I am trying to build a package with RcppArmadillo code and using the new
> attributes-type methodology.  When I compile using sourceCpp() the functions
> compile and work.  However when I use "Rcpp.package.skeleton("NewPackage",
> example_code = FALSE, cpp_files = c("test_arma3.cpp"))", and then "R CMD
> INSTALL...." I get compilation errors.  Here is some sample Armadillo code
> (the fastLM example) which is then followed by the compilation errors.  Any
> help would be much appreciated.
> Thanks,

For building packages with attributes dependencies are specified using
Depends and LinkingTo rather than the Rcpp::depends attribute (this is
covered in the attributes vignette but it certainly could be missed).

Note also that we have an outstanding work item to have
Rcpp.package.skeleton look for Rcpp::depends attribute in cpp_file and
automatically add depended on packages to the DESCRIPTION. For now
though this has to be done manually.

J.J.


More information about the Rcpp-devel mailing list