Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++11 with R and Rcpp: supported by CRAN policies?

Tags:

c++

r

c++11

rcpp

cran

This blog entry by Dirk Edelbuettel states:

Rcpp, as a CRAN package, follows CRAN policy in not (yet at least) supporting this standard [C++11] for its purported non-portable status.

The blog entry is two years old, and I've been wondering if this is still true (both with regard to the CRAN policies, where I did not find any hint about C++11, and Rcpp support).

Moreover, I would like to know what this means exactly. I used a CXX_STD = CXX11 statement in the src/MAKEVARS file (rather than Sys.setenv("PKG_CXXFLAGS"="-std=c++11") as proposed in the blog entry). This seems to work with the C++11 features I am using (mainly the tgamma function), Rcpp, and R. But will I get ripleyed when I submit my package to CRAN? Will the package not be available for some operating systems?

like image 526
Philip Leifeld Avatar asked Feb 01 '15 11:02

Philip Leifeld


1 Answers

All of the above comments, and try:

// [[Rcpp::plugins(cpp11)]]

There are several packages which require C++11, search CRAN for SystemRequirements: C++11, and Rcpp. E.g. http://cran.us.r-project.org/web/packages/contoureR/index.html which has about the simplest possible package configuration without using Rcpp::plugins(cpp11).

My case is peculiar because, for obscure CRAN maintainer reasons, on esoteric platforms, OpenMP and C++11 don't go together (see https://github.com/jackwasey/icd for how to accomplish this with a configure script).

like image 117
Jack Wasey Avatar answered Nov 19 '22 07:11

Jack Wasey