checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... NOTE
checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... NOTE
src/Makevars.win: SHLIB_OPENMP_CFLAGS is included in PKG_LIBS but linking is by C++
src/Makevars.win: it is not portable to include SHLIB_OPENMP_*' macros in PKG_CPPFLAGS
Use of these macros is discussed in sect 1.2.1.1 of ‘Writing R
Extensions’. The macros for different languages may differ so the
matching macro must be used in PKG_CXXFLAGS (etc) and match that used
in PKG_LIBS (except for Fortran: see the manual).
PKG_CPPFLAGS is used for both C and C++ code so it is not portable to
use it for these macros.
I confirmed "R CMD check" didn't return the NOTE after modifying Makevars.win as shown below.
replace PKG_CPP_FLAGS with PKG_CXXFLAGS
replace SHLIB_OPENMP_CFLAGS with SHLIB_OPENMP_CXXFLAGS
"R CMD check" returns the following NOTE.
checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... NOTE
checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... NOTE src/Makevars.win: SHLIB_OPENMP_CFLAGS is included in PKG_LIBS but linking is by C++ src/Makevars.win: it is not portable to include SHLIB_OPENMP_*' macros in PKG_CPPFLAGS Use of these macros is discussed in sect 1.2.1.1 of ‘Writing R Extensions’. The macros for different languages may differ so the matching macro must be used in PKG_CXXFLAGS (etc) and match that used in PKG_LIBS (except for Fortran: see the manual). PKG_CPPFLAGS is used for both C and C++ code so it is not portable to use it for these macros.I confirmed "R CMD check" didn't return the NOTE after modifying Makevars.win as shown below.
Is this modification OK?
The following URLs are reference. https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Portable-C-and-C_002b_002b-code https://cran.r-project.org/doc/manuals/r-release/R-exts.html#OpenMP-support