[Rcpp-devel] Package Development with Rcpp, RcppArmadillo, BH and bigmemory for systems without full C++ extensions
sritchie73 at gmail.com
Wed Jul 30 03:53:05 CEST 2014
I've been developing an Rcpp/RcppArmadillo package that makes use of
BigMatrix objects from the bigmemory package, and I've had a series of
confusing encounters with C++11, so I want to check that I'm doing the
Before using RcppArmadillo, I had enabled C++11 extensions by including
SystemRequires: C++11 in my DESCRIPTION file, in order to turn off compiler
warnings due to the BigMatrix class's use of boost headers.
Now that I've added RcppArmadillo, I've had to use custom Makevars and
Makevars.win files to correctly link the package to LAPACK libraries if
they're installed. I've generated these files using
Now when I try to install my package on a different system (Ubuntu 12.04),
I get the following warnings from files which include the RcppArmadillo.h
WARNING: your C++ compiler is in C++11 mode, but it has incomplete support
> for C++11 features; if something breaks, you get to keep all the pieces
This is because the g++ compiler is version 4.6.3, so it only has limited
support for C++11 extensions (-std=c++0x).
Since I haven't written any code that makes use of C++11 extensions, I have
tried turning them off in my RcppArmadillo files by adding #define
ARMA_DONT_USE_CXX11 before the include statement #include
<RcppArmadillo.h>. However, this does not get added to RcppExports.cpp so I
still get the compiler warning once when I install the package.
I've additionally removed SystemRequirements: C++11 from my DESCRIPTION
file but that seems to make no difference (my Rcpp code that doesnt use the
armadillo headers still compiles without warnings, despite including the BH
I'm not sure how much of an issue this is, because none of my code seems to
be broken when I install on the system without full C++11 extension
support. Can I just ignore this warning, and is what I have done correct?
My package versions on both systems are:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel