[Rcpp-devel] R CMD check not happy about -std=c++0x

Romain Francois francoisromain at free.fr
Mon Jan 18 13:43:46 CET 2010


Hello,

With a lot of hard work this weekend, we finally found a decent 
workaround, using the CXXOPTS variable as follows:

PKG_CPPFLAGS=$(shell Rscript -e "Rcpp:::CxxFlags()" )
PKG_LIBS = $(shell Rscript -e "Rcpp:::LdFlags()" )
CXXOPTS = $(shell Rscript -e "Rcpp:::Cxx0xFlags()" )

where Rcpp:::Cxx0xFlags will be available in the next version (already 
in the development version)

- Rcpp:::CxxFlags() will no longer include "-std=c++0x" because this is 
forbidden by R.
- Rcpp:::Cxx0xFlags() checks which compiler is in use, and iif this is 
GCC >= 4.3 it adds "-std=c++0x"

This makes both R CMD check and us happy.

Romain

On 01/15/2010 08:27 AM, Romain François wrote:
> Hi,
>
> I'm getting a warning when I try to build my CPP package that depends on
> Rcpp and uses the classic Makevars :
>
> PKG_CXXFLAGS=`Rcpp:::CxxFlags()` -I.
> PKG_LIBS=`Rcpp:::LdFlags()`
>
>
> I get this warning from R CMD check :
>
> * checking for portable compilation flags in Makevars ... WARNING
> Non-portable flags in variable 'PKG_CXXFLAGS':
>     -std=c++0x
>
>
> Is there a workaround ? We probably would then have to update the new
> skeleton generator to use it.
>
> Romain
>


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/KfKn : Rcpp 0.7.2
|- http://tr.im/JOlc : External pointers with Rcpp
`- http://tr.im/JFqa : R Journal, Volume 1/2, December 2009



More information about the Rcpp-devel mailing list