Skip to content
Prev 8880 / 12125 Next

[R-pkg-devel] How to update "SystemRequirements: C++11"?

On 06/02/2023 3:46 p.m., Winston Chang wrote:
After reading the discussion here and the manuals, I think this is how 
to do it.  I'm assuming your code is compatible with both C++11 and 
C++17, but not some earlier standards.

1.  In SystemRequirements, state that it needs C++11 or higher.  That 
field is supposed to be human readable (though I think there are scripts 
that try to read it; maybe they will suggest a particular wording to use).

2.  Have a configure script (e.g. like the one Ivan posted) that 
specifies CXX_STD=CXX11 in Makevars if the R version is less than 4.0.0, 
and gives no specification otherwise (because from 4.0.0 onwards, if C++ 
is available, it will be C++11 or higher).

I think it wouldn't hurt to look through the available versions and pick 
from them, but I don't think it's supposed to be necessary.

If it eventually turns out that your code is not compatible with some 
later standard, I'm sure CRAN will let you know.

Duncan Murdoch