Skip to content

Commit

Permalink
Matrix version check disable by default #387
Browse files Browse the repository at this point in the history
- Use options("TMB.check.Matrix"=TRUE) to re-enable
  • Loading branch information
kaskr committed Oct 12, 2023
1 parent 09de3e7 commit 8181d4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TMB/R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## library.dynam("TMB", pkg, lib)
## }

checkMatrixPackageVersion <- function() {
checkMatrixPackageVersion <- function(warn=TRUE) {
## It is unsafe to use the TMB package with versions of 'Matrix'
## other than the one TMB was originally built with.
file <- paste0(system.file(package="TMB"),"/Matrix-version")
Expand All @@ -14,7 +14,7 @@ checkMatrixPackageVersion <- function() {
writeLines(cur.Matrix.version, con = file)
}
TMB.Matrix.version <- readLines(file)
if(!identical(TMB.Matrix.version, cur.Matrix.version)) {
if(warn && !identical(TMB.Matrix.version, cur.Matrix.version)) {
warning(
"Package version inconsistency detected.\n",
"TMB was built with Matrix version ",
Expand All @@ -31,7 +31,7 @@ checkMatrixPackageVersion <- function() {

.onLoad <- function(lib, pkg) {
library.dynam("TMB", pkg, lib)
checkMatrixPackageVersion()
checkMatrixPackageVersion(isTRUE(getOption("TMB.check.Matrix")))
## Select AD framework (CppAD or TMBad) used by TMB::compile
tmb.ad.framework <- getOption("tmb.ad.framework", NULL)
if (is.null(tmb.ad.framework))
Expand Down

0 comments on commit 8181d4b

Please # to comment.