diff --git a/R/zzz.R b/R/zzz.R index 9637367a..e22615a8 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -20,7 +20,12 @@ loadTbbLibrary <- function(name) { # DLL search path. if (is_windows()) { - path <- file.path(tbbRoot(), paste0(name, ".dll")) + # NOTE: resolve against the package's own library directory, where + # install.libs.R places the stub; tbbRoot() would prefer TBB_LIB, + # which on Windows points at Rtools and holds only static libraries + arch <- .Platform$r_arch + parts <- c("lib", if (nzchar(arch)) arch, paste0(name, ".dll")) + path <- system.file(paste(parts, collapse = "/"), package = "RcppParallel") if (!file.exists(path)) return(NULL)