There has been a lot of back and forth on this.
The Matrix package has added this in the newest release
<
https://cran.r-project.org/web/packages/Matrix/news.html>:
New R function Matrix.Version, taking no arguments and returning
list(package, abi, suitesparse), a list containing the numeric versions
of the package, its ABI, and the internal SuiteSparse library. ABI
versioning is new: the version is 1 in this release and will be
incremented by 1 in each future release that changes the ABI. Versions
and their components are defined in a header for use by packages with
LinkingTo: Matrix in ‘DESCRIPTION’. See ‘inst/include/Matrix/version.h’.
There is no support in the DESCRIPTION file for requiring a
particular ABI version; the machinery for adding a 'package version
compiled with' tag (stored in inst/<pkg>-version) is here:
https://github.com/glmmTMB/glmmTMB/blob/master/glmmTMB/src/Makevars
and glmmTMB's machinery for checking is here:
https://github.com/glmmTMB/glmmTMB/blob/master/glmmTMB/R/utils.R#L209-L246
What ought to happen when the Matrix ABI version changes is *one* of
the following:
* all binary repository managers (CRAN, RSPM, GitHub Actions folks,
etc etc etc) rebuild their binary versions of the package
* all downstream/LinkingTo: package maintainers issue a 'bump'
release (ideally, _identical_ to the previous release except for version
number to prevent any possibility of breakage) of their package, to
trigger rebuilding by all of the aforementioned binary repositories
The first is not going to happen, so the second is what we will try
to do going forward.
Hope that helps.
Handling the fallout from the Matrix change has been a bigger hassle
than usual: see
https://github.com/lme4/lme4/issues/763
https://github.com/lme4/lme4/issues/760
https://github.com/lme4/lme4/issues/759
https://github.com/lme4/lme4/issues/758
https://github.com/lme4/lme4/issues/757
https://github.com/lme4/lme4/issues/756
https://github.com/glmmTMB/glmmTMB/issues/965
https://stackoverflow.com/questions/77653712/glmmtmb-giving-error-realted-to-log-likelihood
https://stackoverflow.com/questions/77533611/error-in-glmmtmb-after-matrix-update-negative-log-likelihood-is-nan-at-starting/77534375#77534375
https://stackoverflow.com/questions/77466641/error-in-fittmbtmbstruc-negative-log-likelihood-is-nan-at-starting-parameter/77504843#77504843
et cetera ...
On 2023-12-19 1:52 p.m., James Thorson wrote:
> Hi all,
>
> I'm finally distributing packages using TMB via CRAN (e.g., phylosem
> <
https://james-thorson-noaa.github.io/phylosem/>), and appreciate all
> the guidance that's searchable online!
>
> However, I already encounter an issue where users have an old version of
> Matrix (e.g., 1.5.4), then install phylosem which installs a recent TMB
> version (e.g., 1.9.10) and the conflict between Matrix and TMB causes an
> inscrutable user error (in this instance, a "Error in nlminb(start =
> startpar, objective = fn, gradient = gr, control = nlminb.control,
> NA/NaN gradient evaluation" message).
>
> Is there any standard advice to check or enforce an update to Matrix for
> packages using TMB?
>
> I can imagine three options but I'm not knowledgeable about the
> potential tradeoffs:
>
> 1. phylosem (or other package) edits DESCRIPTION to require "Matrix
> (>= 1.6.3)" ... but this presumably requires updating phylosem
> DESCRIPTION periodically.
> 2. phylosem (or other package) includes an .onAttach() that checks
> Matrix and throws an error if it isn't sufficiently updated ... but
> this probably doesn't work on GitHub CI Actions, and might be
> annoying to users
> 3. TMB updates its DESCRIPTION ... on github master branch it lists
> "Matrix (>= 1.0-12), which seems out of date
>
> I don't see options 1-2 in glmmTMB so I'm curious to hear suggestions
> and whether/how others are dealing with the topic?
>
> Jim
>
> --
> To post to this group, send email to
us...@tmb-project.org. Before
> posting, please check the wiki and issuetracker at
>
https://github.com/kaskr/adcomp/ <
https://github.com/kaskr/adcomp/>.
> Please try to create a simple repeatable example to go with your
> question (e.g issues 154, 134, 51). Use the issuetracker to report bugs.
> ---
> You received this message because you are subscribed to the Google
> Groups "TMB Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
tmb-users+...@googlegroups.com
> <mailto:
tmb-users+...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/tmb-users/CAMDbYvb%2BbgQ24P2UAT%2BFevi-gHuMj%2BnRVQitMveg%3D1zRSde4iQ%40mail.gmail.com <
https://groups.google.com/d/msgid/tmb-users/CAMDbYvb%2BbgQ24P2UAT%2BFevi-gHuMj%2BnRVQitMveg%3D1zRSde4iQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
(Acting) Graduate chair, Mathematics & Statistics
> E-mail is sent at my convenience; I don't expect replies outside of
working hours.