Reputation: 2503
I am the mantainer of few R packages that use Rcpp for some core calculations. Wishing to try a new feature of the Rcpp package as described in Rcpp 0.12.18 Rbloggers
To do so I did the following:
CPPFLAGS += -DRCPP_USE_UNWIND_PROTECT
Btw that raises some issues that I wounder will make my package rejected on CRAN:
I would like to know if it is possible to rewrite the Makevars to remove the warning and possibly, the Gnu make requirement
Thanks in advance for the attention
Upvotes: 0
Views: 270
Reputation: 368261
You want to use PKG_CPPFLAGS
(or PKG_CXXFLAGS
) as that is the per-package variant. What you altered is the system-wide version hence the warning.
More details are as always in the Writing R Extensions manual, otherwise the many existing example packages (all on CRAN and browseable at GitHub) can help too.
For example, here is the one-toggle-setting use case from the RcppExamples package:
PKG_CXXFLAGS = -DRCPP_NEW_DATE_DATETIME_VECTORS
(which is strictly-speaking no longer needed as the "new" Date and Datetime vector classes became the default a while ago).
Also, if you use this form you do not need the +=
and have no requirement to declare on GNU make -- another win.
Upvotes: 2