[Rd] R CMD Check should allow packages with C and C++ and OpenMP without generating a NOTE

Sebastian Martin Krantz @eb@@t|@n@kr@ntz @end|ng |rom gr@du@te|n@t|tute@ch
Tue Jun 7 20:44:39 CEST 2022

Dear Developers,

I have the following issue with my package collapse:
whose code base is 34.5% C code and 28.3% C++, and to which I now want to
add OpenMP multithreading and send it to CRAN. For this I have set up a
Makevars file with


as linking is through C++ via Rcpp. The problem is that this generates a
NOTE on R CMD Check:

src/Makevars: SHLIB_OPENMP_CFLAGS is included in PKG_CFLAGS but not in

If I alternatively put


I get another NOTE stating that this is not portable. Finally putting


gives a note (or warning) that linking is through C++. CRAN maintainers
have not engaged constructively with me on the issue, but I do believe this
is an issue requiring constructive engagement i.e. I believe R CMD Check
should be adjusted to allow for such a configuration, and possibly some
instructions should be added to the Writing R Extensions Manual. I have
also asked Dirk Eddelbuettel (
https://github.com/SebKrantz/collapse/issues/258) who agrees that this is
an upstream issue. I am happy for any proactive comments or suggestions.

Best regards,

Sebastian Krantz

	[[alternative HTML version deleted]]

More information about the R-devel mailing list