From 4370a7903b4d1041ac4c95e3ea60353f7bc75535 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 7 Oct 2025 18:11:02 +0800 Subject: [PATCH 1/2] Remove unnecessary flag for WINARM64 --- R/tbb.R | 8 -------- inst/include/RcppParallel.h | 3 --- 2 files changed, 11 deletions(-) diff --git a/R/tbb.R b/R/tbb.R index ac1050f3..f9ca5cb5 100644 --- a/R/tbb.R +++ b/R/tbb.R @@ -58,14 +58,6 @@ tbbCxxFlags <- function() { return("-DRCPP_PARALLEL_USE_TBB=0") flags <- c("-DRCPP_PARALLEL_USE_TBB=1") - - # TBB does not have assembly code for Windows ARM64 - # so we need to use compiler builtins - if (TBB_ENABLED && is_windows()) { - if (R.version$arch == "aarch64") { - flags <- c(flags, "-DTBB_USE_GCC_BUILTINS") - } - } # if TBB_INC is set, apply those library paths tbbInc <- Sys.getenv("TBB_INC", unset = TBB_INC) diff --git a/inst/include/RcppParallel.h b/inst/include/RcppParallel.h index c7fdf0bc..87d6eb5c 100644 --- a/inst/include/RcppParallel.h +++ b/inst/include/RcppParallel.h @@ -18,9 +18,6 @@ #endif #if RCPP_PARALLEL_USE_TBB -# if defined(WINNT) && defined(__aarch64__) && !defined(TBB_USE_GCC_BUILTINS) -# define TBB_USE_GCC_BUILTINS 1 -# endif # include "RcppParallel/TBB.h" #endif From 811e8848d04c4e6add5a277ea630fa8971129e80 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 8 Oct 2025 00:06:59 +0800 Subject: [PATCH 2/2] Fix TBB library lookup --- R/tbb.R | 2 +- R/zzz.R | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/R/tbb.R b/R/tbb.R index f9ca5cb5..3d8fbb32 100644 --- a/R/tbb.R +++ b/R/tbb.R @@ -24,7 +24,7 @@ tbbLibraryPath <- function(name = NULL) { # form library names tbbLibNames <- list( "Darwin" = paste0("lib", name, ".dylib"), - "Windows" = paste0( name, ".dll"), + "Windows" = paste0("lib", name, c("12", ""), ".a"), "SunOS" = paste0("lib", name, ".so"), "Linux" = paste0("lib", name, c(".so.2", ".so")) ) diff --git a/R/zzz.R b/R/zzz.R index 28b50d33..54374e09 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -11,7 +11,10 @@ .tbbMallocProxyDllInfo <- NULL loadTbbLibrary <- function(name) { - + # TBB is statically linked on Windows + if (is_windows()) { + return(NULL) + } path <- tbbLibraryPath(name) if (is.null(path)) return(NULL)