Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RcppArmadillo #200

Closed
mattfidler opened this issue Sep 1, 2022 · 0 comments · Fixed by #203
Closed

RcppArmadillo #200

mattfidler opened this issue Sep 1, 2022 · 0 comments · Fixed by #203
Assignees

Comments

@mattfidler
Copy link
Member

Dear fellow R package maintainers,

RcppArmadillo needs you to do it a small favor. This affects packages

ACEt autostsm BAMBI BayesPPD BNPMIXcluster cccp finity greed grove
handwriter HARModel mdgc minimaxdesign MRS nlmixr nlmixr2est pedmod
smog SparseFactorAnalysis spBFA spCP specs TreeBUGS UComp womblR

and you are maintainer of one or more of these.

The Armadillo package, which we all enjoy and use, goes back some time. In a
recent release, Conrad deprecate an older feature of initializating matrices
or vectors via '<<' redirect. The preference is to use the newer (since
C++11, which by now has long been standard for R) brace initialization. From
his docs (and also see an R + C++ example below):

vec v = { 1, 2, 3 };

mat A = { {1, 3, 5},
{2, 4, 6} };

The replacement should in most cases be a simple edit in your package.

Right now, in CRAN release 0.11.2.3.1 of RcppArmadillo, we simply disabled the
deprecation. This goes against Conrad's wishes, but accomodates CRAN by not
triggering warnigns.

The current release candidate version of RcppArmadillo is available via
'install_github("RcppCore/RcppArmadillo")' or via the drat repo using
'install.packages("RcppArmadillo", repos=c("https://rcppcore.github.io/drat"))'
allows a finer grained setup. By default, deprecation warnings are off so if
you rebuild your package with it you see no warning.

However, if you use '#define RCPPARMADILLO_FORCE_NO_DEPRECATE 1' then the
deprecation is not deactivated -- ie it is on as Conrad intends. So you see
the warning and change your change until it no longer appears.

I have set up issue RcppCore/RcppArmadillo#391 to
track this. It has (hidden under the first 'details' you can expand) all the
warning messages I got from CRAN.

And under a second 'details' is the simple example included below. You can call
'Rcpp::sourceCpp()' on it, and depending on whether the #define is commented out
you get either a quiet compilation, or one with the warning from the use in
function oldCode().

RcppArmadillo would benefit if you could update your package to not trigger the
warning. It is understood that such a change, across several packages, may take
some time. I think aiming six months is realistic. Hopefully by then we can
turn off the deprecation suppressant we currently need for your packages.

This affects 25 out of just over 1000 packages. It will be a bit of work, but I
think we can manage this. Rcpp recently did a larger transition, and while it
was some work, we ended up with a nice improvement.

We now count on you ti either update your package and upload with new code no
longer using << to initialize matrices and vector. Or, at a minimum, you can add
-DARMA_IGNORE_DEPRECATED_MARKER to the file(s) src/Makevars and src/Makevars.win
as a compiler flag passing the define on. That would suppress deprecation
warnings 'locally' at your package level (but allow us to enable them 'globally').
That define is in the release candidate, and should be in future release as
it is currently in a merge request to Armadillo too.

Please do not hesitate to contact me, preferably at the GitHub issue ticket at
RcppCore/RcppArmadillo#391, if you have any questions.

With best regards, Dirk

@mattfidler mattfidler self-assigned this Sep 1, 2022
@mattfidler mattfidler linked a pull request Sep 1, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant