build tbb stub from static library on older toolchains#258
Merged
Conversation
Rtools42-era toolchains provide an older (non-oneTBB) copy of TBB, so tbb-compat.cpp -- which wraps the oneTBB runtime -- cannot build there, and the install would fail at the stub link. But the old static library already provides the old ABI, so re-export it wholesale instead. Also: - remove stale tbb-compat build artifacts before building the stub; 'make' would otherwise consider a tbb.dll built by a different toolchain (or against a different TBB) up-to-date and re-ship it - clean tbb-compat artifacts in cleanup.R - return invisibly from useTbbPreamble(), so 'NULL' is no longer printed when install.libs.R is run via R -f - standardize on lowercase 'tbb' in logging messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Discovered testing on R 4.2 / Rtools42, which provides an older (non-oneTBB) TBB (
libtbb_static.a,interface5headers). Three issues:R CMD SHLIB -o tbb-compat/tbb.dllconsiders a leftovertbb.dllup-to-date and re-ships it -- observed shipping an Rtools45/oneTBB-built stub into an Rtools42/R 4.2 installation. The stub outputs are now deleted before building, andcleanup.Rremoves them too.tbb-compat.cppwraps the oneTBB runtime (tbb::detail::r1::observe), which doesn't exist in old TBB, so the stub link (and the install) would fail. Skipping the stub isn't an option either: downstream-ltbb(StanHeaders) needs atbb.dllto link, since Rtools42 ships onlylibtbb_static.a. Instead, build the stub by re-exporting the static library wholesale (-Wl,--whole-archive) -- old TBB already provides the old ABI, no shim needed. Dispatch is by presence of<TBB_INC>/oneapi.useTbbPreamble()now returns invisibly (a strayNULLwas printed viaR -fauto-printing), and logging messages standardize on lowercase 'tbb'.The whole-archive path needs validation on a real Rtools42 setup (in progress).