fix(patches): replace the RcppParallel system-TBB patch with a link-order fix #145
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/fix-uvr-glibc-build-failures"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Every build logs:
RcppParallel 6.x rewrote its build system.
src/Makevars.inno longer contains theUSE_TBB=Linuxblock thatsystem-tbb.patchedited (it is now a short@VAR@template driven bytools/config/configure.R), so the patch can never apply again.The workaround it implemented is obsolete too. 6.x bundles oneTBB 2022 and builds it with cmake, which works on musl and with g++ 8-15, so the 5.x reason for linking a system TBB is gone. Linking one is now harmful:
install.libs.Rsymlinks the system libraries intoRcppParallel/lib, so the published binary depends on a TBB the consumer does not have — the same failure mode asfsand libuv.What is still broken upstream is the link order.
configure.Rnames the TBB directory with-Wl,-L, and gcc expands its own search dirs into-Loptions ahead of anything forwarded verbatim with-Wl,:So on any build host with a distro TBB installed,
-ltbbresolves to that library andRcppParallel.sorecords its SONAME (libtbb.so.12, orlibtbb.so.2for the classic Intel TBB on el8/el9) instead of the bundledlibtbb.so.Changes
RcppParallel/system-tbb.patchwithRcppParallel/bundled-tbb-link-order.patch, which changes the three-Wl,-Loccurrences intools/config/configure.Rto plain-L.>=6.0.0and widenplatformsto*.rstanentry: its-DTBB_INTERFACE_NEWis already emitted byRcppParallel::CxxFlags()once the bundled oneTBB is used, and its-I/usr/local/includewas an el8/el9 path applied on every platform..pre-commit-config.yaml: excludelocal/patches/*.patchfromtrailing-whitespace,end-of-file-fixerandeditorconfig-checker. They rewrite blank context lines (-> ``) in every diff in the registry;git applyhappens to tolerate it today, but a patch with meaningful trailing whitespace would be silently corrupted. The excludes are per-hook sovalidate patch registrystill runs.Verification
Built in the published images:
build-env-alpine:3.24libtbb.so$ORIGIN/../libbuild-env-redhat:8libtbb.so,libtbbmalloc.so$ORIGIN/../libbuild-env-ubuntu:noblelibtbb.so$ORIGIN/../libWithout the patch the same builds record
libtbb.so.12(alpine, ubuntu) orlibtbb.so.2(el8, the classic 2018 TBB) and fall back to the system library at load time.rstan 2.32.7 compiles and loads against the patched RcppParallel on ubuntu noble with no makevars override and with the system libtbb moved away. On el8 it also compiles; loading it there is blocked by an unrelated image bug (see below).
Behaviour change
Requires the paired build-env-images PR (drops
TBB_INC/TBB_LIB) and an image rebuild — with those env vars set, configure still takes the system-TBB branch. After that, RcppParallel binaries ship their own oneTBB and are self-contained.Also found, fixed in the paired images PR
uvr lock failed ... GLIBC_2.29 not founderrors in the same log are the-gnuuvr artifact on el8's glibc 2.28; fixed in build-env-images.build-env-redhat:8R 4.5.3/4.6.0 could not loadstats(libRlapack.so: undefined symbol: dgemmtr_), which is why rstan compiled but would not load there. The el8 R RPM symlinkslibRblas.soto openblas 0.3.15, which predates that symbol; the images PR repoints it at the reference BLAS R ships. With all three fixes, rstan 2.32.7 builds and loads on el8.