fix(patches): build RcppParallel against system oneTBB instead of disabling TBB #135

Merged
pat-s merged 1 commit from t3code/rcppparallel-system-tbb into main 2026-07-20 09:56:22 +00:00
3 changed files with 31 additions and 21 deletions

View file

@ -1,16 +0,0 @@
diff --git a/src/Makevars.in b/src/Makevars.in
index be8445f..faee771 100644
--- a/src/Makevars.in
+++ b/src/Makevars.in
@@ -60,7 +60,10 @@ else
endif
ifeq ($(UNAME), Linux)
- USE_TBB=Linux
+ # bincraft patch: the bundled Intel TBB build hangs/fails on musl (Alpine)
+ # and newer toolchains (g++ 15). Skip it (leave USE_TBB unset) and force the
+ # TinyThread backend so RcppParallel still builds.
+ PKG_CXXFLAGS += -DRCPP_PARALLEL_USE_TBB=0
endif
ifeq ($(UNAME), SunOS)

View file

@ -0,0 +1,19 @@
diff --git a/src/Makevars.in b/src/Makevars.in
index be8445f..7cb6c9e 100644
--- a/src/Makevars.in
+++ b/src/Makevars.in
@@ -60,7 +60,13 @@ else
endif
ifeq ($(UNAME), Linux)
- USE_TBB=Linux
+ # bincraft patch: link the system oneTBB (installed in the build-env images)
+ # instead of building the bundled Intel TBB, which fails on musl (Alpine) and
+ # newer toolchains (g++ 15). Leaving USE_TBB unset skips the bundled build;
+ # -DRCPP_PARALLEL_USE_TBB=1 keeps the TBB backend so dependents (rstan, ...)
+ # link TBB, and -ltbb/-ltbbmalloc pull the system library from default paths.
+ PKG_CXXFLAGS += -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -DTBB_INTERFACE_NEW
+ PKG_LIBS += -ltbb -ltbbmalloc
endif
ifeq ($(UNAME), SunOS)

View file

@ -2,17 +2,22 @@
{ {
"package": "RcppParallel", "package": "RcppParallel",
"versions": "*", "versions": "*",
"platforms": ["alpine", "ubuntu-2604"], "platforms": [
"alpine",
"ubuntu-2604"
],
"env": {}, "env": {},
"configure_args": [], "configure_args": [],
"makevars": {}, "makevars": {},
"patch": "RcppParallel/disable-tbb.patch", "patch": "RcppParallel/system-tbb.patch",
"reason": "bundled Intel TBB build hangs/fails on musl (Alpine) and newer toolchains (g++ 15 on ubuntu-2604); patch unsets USE_TBB and forces -DRCPP_PARALLEL_USE_TBB=0 so RcppParallel skips the bundled build and uses the TinyThread backend" "reason": "bundled Intel TBB build hangs/fails on musl (Alpine) and newer toolchains (g++ 15 on ubuntu-2604); link the system oneTBB (now in the build-env images) instead, keeping the TBB backend so dependents (rstan, ...) link TBB"
}, },
{ {
"package": "fs", "package": "fs",
"versions": "*", "versions": "*",
"platforms": ["*"], "platforms": [
"*"
],
"env": {}, "env": {},
"configure_args": [], "configure_args": [],
"makevars": {}, "makevars": {},
@ -22,7 +27,9 @@
{ {
"package": "rstan", "package": "rstan",
"versions": "*", "versions": "*",
"platforms": ["*"], "platforms": [
"*"
],
"env": {}, "env": {},
"configure_args": [], "configure_args": [],
"makevars": { "makevars": {