Skip to content

Commit d65bcd4

Browse files
authored
fix lookup path for tbb stub library on windows (#250)
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.
1 parent 11ba91f commit d65bcd4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

R/zzz.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ loadTbbLibrary <- function(name) {
2020
# DLL search path.
2121
if (is_windows()) {
2222

23-
path <- file.path(tbbRoot(), paste0(name, ".dll"))
23+
# NOTE: resolve against the package's own library directory, where
24+
# install.libs.R places the stub; tbbRoot() would prefer TBB_LIB,
25+
# which on Windows points at Rtools and holds only static libraries
26+
arch <- .Platform$r_arch
27+
parts <- c("lib", if (nzchar(arch)) arch, paste0(name, ".dll"))
28+
path <- system.file(paste(parts, collapse = "/"), package = "RcppParallel")
2429
if (!file.exists(path))
2530
return(NULL)
2631

0 commit comments

Comments
 (0)