Skip to content

Commit

Permalink
Fix windows DLL load error
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jan 12, 2024
1 parent 99db640 commit 10d42cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ with_cmdstan_flags <- function(expr) {
libs <- c("LDLIBS", "LIBSUNDIALS", "TBB_TARGETS", "LDFLAGS_TBB")
libs <- paste(sapply(libs, get_cmdstan_flags), collapse = " ")
if (.Platform$OS.type == "windows") {
libs <- paste(libs, "-fopenmp")
libs <- paste(libs, "-fopenmp -lstdc++")
}
lib_paths <- c("/stan/lib/stan_math/lib/tbb/",
"/stan/lib/stan_math/lib/sundials_6.1.1/lib/")
Expand Down Expand Up @@ -830,7 +830,7 @@ expose_model_methods <- function(env, force_recompile = FALSE, verbose = FALSE)
)
)

env$methods_dll_info <- dyn.load(methods_dll, local = TRUE, now = TRUE)
env$methods_dll_info <- with_cmdstan_flags(dyn.load(methods_dll, local = TRUE, now = TRUE))
initialize_method_functions(env, strip_ext(basename(methods_dll)))
invisible(NULL)
}
Expand Down

0 comments on commit 10d42cd

Please sign in to comment.