From 23b8519db385329f041fbd5072d864c706e15b87 Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Thu, 23 Jul 2026 15:30:37 -0700 Subject: [PATCH] fix lookup path for tbb stub library on windows The stub loader added in #249 resolved tbb.dll via tbbRoot(), which prefers TBB_LIB when set -- and on Windows, configure always sets TBB_LIB to the Rtools library directory, which contains only static TBB libraries. As a result, the lookup silently failed and the stub was never loaded. Resolve against the package's own lib directory instead, which is where install.libs.R places the stub. --- R/zzz.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)