After updating to R-4.0.5 rstan has broken. Code which previously was working crashes when calling stan. It seems the problem is some environment variable but I am unable to corrrect it.
(This happens for every model)
The error message is as follows:
Translate model to C++ and compile to DSO:
stanDso ← stan_model( model_code=modelString )
Error in inDL(x, as.logical(local), as.logical(now), …): unable to load shared object ‘C:/Users/josep/AppData/Local/Temp/Rtmpw5K3Oc/file413c70f952de.dll’:
LoadLibrary failure: A dynamic link library (DLL) initialization routine failed.
Traceback:
-
stan_model(model_code = modelString)
-
cxxfunctionplus(signature(), body = paste(" return Rcpp::wrap("",
. model_name, “”);", sep = “”), includes = inc, plugin = “rstan”,
. save_dso = save_dso | auto_write, module_name = paste(“stan_fit4”,
. model_cppname, “_mod”, sep = “”), verbose = verbose) -
pkgbuild::with_build_tools(cxxfunction(sig = sig, body = body,
. plugin = plugin, includes = includes, settings = settings,
. …, verbose = verbose), required = rstan_options(“required”) &&
. !identical(Sys.getenv(“WINDOWS”), “TRUE”) && !identical(Sys.getenv(“R_PACKAGE_SOURCE”),
. “”)) -
withr::with_path(rtools_path(), code)
-
force(code)
-
cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes,
. settings = settings, …, verbose = verbose) -
dyn.load(libLFile)
-
inDL(x, as.logical(local), as.logical(now), …)
Error in sink(type = “output”): invalid connection
Traceback: -
stan_model(model_code = modelString)
-
cxxfunctionplus(signature(), body = paste(" return Rcpp::wrap("",
. model_name, “”);", sep = “”), includes = inc, plugin = “rstan”,
. save_dso = save_dso | auto_write, module_name = paste(“stan_fit4”,
. model_cppname, “_mod”, sep = “”), verbose = verbose) -
sink(type = “output”)