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
Owner

What

Replace RcppParallel's disable-tbb registry patch with system-tbb: build RcppParallel against the system oneTBB instead of stripping TBB entirely.

Why

disable-tbb skipped the bundled Intel TBB build by forcing the TinyThread backend, which also removed RcppParallel's TBB linkage.
That broke every dependent that links TBB through RcppParallelLibs() -- rstan and the whole Stan cluster -- with symbol not found: tbb::detail::r1::observe.
This is the root cause behind the large "blocked on RcppParallel" / rstan clusters (issues #115, #120): the packages were not individually broken, they were all waiting on one TBB-linkage regression.

Change

system-tbb.patch leaves USE_TBB unset (so the bundled build is still skipped on musl and g++ 15) but keeps the TBB backend and links the system oneTBB now shipped in the build-env images:

PKG_CXXFLAGS += -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -DTBB_INTERFACE_NEW
PKG_LIBS += -ltbb -ltbbmalloc

Scoped to alpine + ubuntu-2604, the only platforms where the bundled build fails; redhat and older ubuntus keep the bundled TBB.

Requires

The companion image change that exports TBB_INC/TBB_LIB so RcppParallelLibs() hands the system-TBB flags to dependents: build-env-images PR #12. Both must ship together.

Verified

In build-env-alpine:3.24 with the new images:

  • RcppParallel builds against oneTBB 2022, no ABI errors, patch applies cleanly to the target clone.
  • RcppParallelLibs() returns -L/usr/lib -Wl,-rpath,/usr/lib -ltbb -ltbbmalloc.
  • rstan links (-ltbb -ltbbmalloc) and loads with no missing symbol -- * DONE (rstan), trial build exit 0.
## What Replace RcppParallel's `disable-tbb` registry patch with `system-tbb`: build RcppParallel against the system oneTBB instead of stripping TBB entirely. ## Why `disable-tbb` skipped the bundled Intel TBB build by forcing the TinyThread backend, which also removed RcppParallel's TBB linkage. That broke every dependent that links TBB through `RcppParallelLibs()` -- `rstan` and the whole Stan cluster -- with `symbol not found: tbb::detail::r1::observe`. This is the root cause behind the large "blocked on RcppParallel" / rstan clusters (issues #115, #120): the packages were not individually broken, they were all waiting on one TBB-linkage regression. ## Change `system-tbb.patch` leaves `USE_TBB` unset (so the bundled build is still skipped on musl and g++ 15) but keeps the TBB backend and links the system oneTBB now shipped in the build-env images: ``` PKG_CXXFLAGS += -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -DTBB_INTERFACE_NEW PKG_LIBS += -ltbb -ltbbmalloc ``` Scoped to `alpine` + `ubuntu-2604`, the only platforms where the bundled build fails; redhat and older ubuntus keep the bundled TBB. ## Requires The companion image change that exports `TBB_INC`/`TBB_LIB` so `RcppParallelLibs()` hands the system-TBB flags to dependents: build-env-images PR #12. Both must ship together. ## Verified In `build-env-alpine:3.24` with the new images: - RcppParallel builds against oneTBB 2022, no ABI errors, patch applies cleanly to the target clone. - `RcppParallelLibs()` returns `-L/usr/lib -Wl,-rpath,/usr/lib -ltbb -ltbbmalloc`. - rstan links (`-ltbb -ltbbmalloc`) and loads with no missing symbol -- `* DONE (rstan)`, trial build exit 0.
The disable-tbb patch skipped the bundled Intel TBB build by forcing the
TinyThread backend, which also stripped RcppParallel's TBB linkage. That
broke every dependent that links TBB through RcppParallelLibs() (rstan and
the whole Stan cluster) with 'symbol not found: tbb::detail::r1::observe'.

Replace it with system-tbb.patch: leave USE_TBB unset (so the bundled build
is skipped on musl and g++ 15) but keep the TBB backend and link the system
oneTBB that the build-env images now ship. RcppParallelLibs() then hands the
system-TBB link flags to dependents, provided TBB_INC/TBB_LIB are exported in
the images (added separately in build-env-images).

Verified in the build-env-alpine:3.24 image: RcppParallel builds against
oneTBB 2022 with no ABI errors, and rstan links (-ltbb -ltbbmalloc) and
loads without the missing-symbol error.
pat-s merged commit 6df945d147 into main 2026-07-20 09:56:22 +00:00
pat-s deleted branch t3code/rcppparallel-system-tbb 2026-07-20 09:56:22 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
devxy/build-cran-binaries!135
No description provided.