[Rcpp-devel] Rcpp+bigmemory+inline

Kevin Ushey kevinushey at gmail.com
Tue Jan 28 01:15:39 CET 2014


The error says that it can't find the boost header file
'boost/interprocess/mapped_region.hpp'. Previously, when the article
was written, this part of boost was packaged as part of bigmemory.
Now, bigmemory links to BH
(http://cran.r-project.org/web/packages/BH/index.html), a CRAN package
assembled by Dirk et al, to get the boost libraries it needs.

This means you likely have to do the same -- change the depends
statement in the C++ to

    // [[Rcpp::depends(BH, bigmemory)]]

and all should be well -- Rcpp will then know where to find the
necessary boost headers. (Alternatively, of course, you can download
boost yourself.) The article should be updated to reflect that as
well, I think.

-Kevin

On Mon, Jan 27, 2014 at 3:58 PM, Tiago Fragoso <fragoso2718 at gmail.com> wrote:
> Hi all,
>
> I'm trying to use Rcpp with bigmemory, and I'm using the exact same example
> from http://gallery.rcpp.org/articles/using-bigmemory-with-rcpp/  , but I'm
> encountering the following error:
>
>> sourceCpp("example.cpp")
> In file included from
> /home/tiago/R/x86_64-pc-linux-gnu-library/3.0/bigmemory/include/bigmemory/MatrixAccessor.hpp:4:0,
>                  from example.cpp:7:
> /home/tiago/R/x86_64-pc-linux-gnu-library/3.0/bigmemory/include/bigmemory/BigMatrix.h:5:48:
> fatal error: boost/interprocess/mapped_region.hpp: No such file or directory
> compilation terminated.
> make: *** [example.o] Error 1
> g++ -I/usr/share/R/include -DNDEBUG
> -I"/home/tiago/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include"
> -I"/home/tiago/R/x86_64-pc-linux-gnu-library/3.0/bigmemory/include"    -fpic
> -O2 -pipe -g  -c teste.cpp -o teste.o
> Error in sourceCpp("example.cpp") :
>   Error 1 occurred building shared library.
>
> Any ideas?
>
>
>
> _______________________________________________
> 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


More information about the Rcpp-devel mailing list