File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,10 @@ tbbLdFlags <- function() {
8181 return (sprintf(fmt , asBuildPath(tbbLib )))
8282 }
8383
84+ # on Aarch64 builds, use the version of TBB provided by Rtools
85+ if (is_windows() && R.version $ arch == " aarch64" )
86+ return (" -ltbb12 -ltbbmalloc" )
87+
8488 # on Mac, Windows and Solaris, we need to explicitly link (#206)
8589 needsExplicitFlags <- is_mac() || is_windows() || (is_solaris() && ! is_sparc())
8690 if (needsExplicitFlags ) {
Original file line number Diff line number Diff line change @@ -27,8 +27,12 @@ loadTbbLibrary <- function(name) {
2727
2828.onLoad <- function (libname , pkgname ) {
2929
30+ tbbLibraryName <- " tbb"
31+ if (is_windows() && R.version $ arch == " aarch64" )
32+ tbbLibraryName <- " tbb12"
33+
3034 # load tbb, tbbmalloc
31- .tbbDllInfo <<- loadTbbLibrary(" tbb " )
35+ .tbbDllInfo <<- loadTbbLibrary(tbbLibraryName )
3236 .tbbMallocDllInfo <<- loadTbbLibrary(" tbbmalloc" )
3337
3438 # load tbbmalloc_proxy, but only if requested
Original file line number Diff line number Diff line change @@ -88,6 +88,14 @@ ifeq ($(USE_TBB), Windows)
8888 # Linker needs access to the tbb dll; otherwise you get errors such as:
8989 # "undefined reference to `tbb::task_scheduler_init::terminate()'"
9090 PKG_LIBS += -Ltbb/build/lib_release -ltbb -ltbbmalloc
91+
92+ # override for aarch64 (experimental) to use Rtools TBB
93+ ARCH=$(shell "${R_HOME}/bin/R" --vanilla -s -e 'cat(R.version$$arch)')
94+ ifeq "$(ARCH)" "aarch64"
95+ TBB_LIB = ${R_TOOLS_SOFT}
96+ TBB_INC = ${R_TOOLS_SOFT}
97+ PKG_LIBS = -ltbb12 -ltbbmalloc
98+ endif
9199
92100endif
93101
You can’t perform that action at this time.
0 commit comments