[Rcpp-devel] Rcpp, bigmemory, package creation

Jay Emerson jayemerson at gmail.com
Fri Apr 12 15:23:14 CEST 2013

Or -- in all our spare time! -- we should really consider doing the right
thing and Rcpp-ifying the bigmemory packages.  It's probably too late for a
GSOC project at this point.  Mike and I will talk about it.  If we think we
could manage it over 2-3 intense days, maybe it will happen this summer.


On Fri, Apr 12, 2013 at 5:47 AM, JJ Allaire <jj.allaire at gmail.com> wrote:

> Alex,
> Glad that you sorted all of this out! Wanted to also point out that there
> is a mechanism for bigmemory to have it's headers automatically included in
> RcppExports.cpp and perhaps this is something Michael can pursue so
> everything works automatically in the future.
> In short, if bigmemory defines an Rcpp inline plugin (by calling
> Rcpp.plugin.maker) that lists the includes required for correct compilation
> then these includes will be inserted at the top of RcppExports.cpp.
> Michael, ping me off list if you have any questions or want to discuss
> further.
> J.J.
> On Thu, Apr 11, 2013 at 5:44 PM, Alex Ustian <alex.l.ustian at gmail.com>wrote:
>> All right!  I think I have it figured out, at least for the toy
>> functions/package.
>> 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.
>> Alex
>> 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
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

John W. Emerson (Jay)
Associate Professor of Statistics, Adjunct, and Director of Graduate Studies
Department of Statistics
Yale University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130412/62515735/attachment.html>

More information about the Rcpp-devel mailing list