RcppCore / RcppParallel

High-level functions for parallel programming with Rcpp
http://rcppcore.github.io/RcppParallel/
171 stars 58 forks source link

CRAN asking for C++17 #194

Closed aadler closed 1 year ago

aadler commented 1 year ago

My package lamW depends on RcppParallel. Its results tab is now showing a note "Specified C++11: please update to current default of C++17". Is addressing this as simple as updatinge Makevars and Makevars.win to read CXX_STD = CXX17 or will that create issues? Thank you

eddelbuettel commented 1 year ago
  1. That's an ongoing conversation in several places, see eg my tweet here
  2. Nobody has (AFAIK) been asked to update a package, the check is not (AFAIK) "on" for uploads to CRAN. It's just that a few of use have seen the NOTE for our own packages.
  3. The note is in your package, and not in RcppParallel. So why do you ask here? Did you maybe mean to email rcpp-devel?
  4. Yes it is exactly that easy and Writing R Extensions is actually quite clear on it too. Also see for example thiss code search at GitHub's cran mirror for CXX_STD = CXX17; feel free to vary for CXX14 or CXX20.

In short, "it's all good". No need to panic.

eddelbuettel commented 1 year ago

Actually, even easier is to just remove the line from Makevars and Makevars.win. Recall that we added these when C++11 was still new and barely support (esp on Windows) which got so much better with more recent Rtools (and other C++ compilers). So one possibility now is to not speficify anything. R 4.2. will get you C++14 already as default; R 4.3. will give you C++17. And that would be a better general recommendation than hardcoding another language standard.

aadler commented 1 year ago

Hi, @eddelbuettel.

Thanks. The reason I asked here is, as you surmised, because RcppParallel itself is why those lines are in Makevars (see https://rcppcore.github.io/RcppParallel/#r_packages). I'm using Rtools43 so I'll probably still get the std:iterators issue from #191 and #192, but I know that's being taken care of. Thanks!

eddelbuettel commented 1 year ago

Oh I see -- thanks for the reminder, and my bad.

RcppParallel was one of many packages switching to C++11 as it needed, and could now consider relaxing that. We are getting into new territory here: some libraries will soon set new minimum values as e.g. some Boost libraries now need C++14 or better.

eddelbuettel commented 1 year ago

And apologies -- I have since learned that CRAN does indeed require / suggest a CXX11 -> CXX17 update for CXX_STD, whether that is wise or not. I just helped another package with a quick ad-hoc PR so if you need a second set of eyes let us know.

aadler commented 1 year ago

Thank you for the update and no need to apologize at all! I should have been clearer in my initial request.