[Rcpp-devel] Rcpp, bigmemory, package creation

Alex Ustian alex.l.ustian at gmail.com
Thu Apr 11 23:44:23 CEST 2013

All right!  I think I have it figured out, at least for the toy

What wasn't compiling wasn't my functions, it was RcppExports.cpp.
sourceCpp (and hence also the knit example) have been working for me all
along.  The only issue (apparently) was that RcppExports.cpp was not
including the bigmemory headers.  It complained about not knowing the type
"BigMatrix" for example.  However since RcppExports.cpp is automatically
generated, I didn't know how to force it to include more headers.

It dawned on me that somewhere in the Rcpp-attributes vignette creating
custom headers came up, sure enough using // [[Rcpp::interfaces(r, cpp)]]
and following along in that section 3.5 discussion and then rebuilding did
the trick.  In the end I just I added the required bigmemory header
"MatrixAccessor.hpp" to the generated "package.h" file, which is then
automatically included into the RcppExports.cpp file.

Thanks again, and thanks everybody for developing and providing support for
this incredible software.

On Thu, Apr 11, 2013 at 4:33 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

> On 11 April 2013 at 16:14, Alex Ustian wrote:
> | Sorry to be dense, but you mean to copy and paste the source into an Rmd
> file
> | and knit it?  If yes, then I did just that and it did work.
> Good.
> Now try to find the differences to your code, which as I understand your
> post, does not compile.  As you just demonstrated that your compiler, R,
> Rcpp,
> bigmemory, ... setup is fine.
> Dirk
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130411/f3ce8aa5/attachment.html>

More information about the Rcpp-devel mailing list