use configure-detected TBB_LIB during install.libs#254
Merged
Conversation
At the install-libs phase, TBB_LIB was read only from the environment, which is typically unset there -- configure communicates it via make variables, not the environment. On Windows, where configure detects the Rtools copy of TBB, this meant .install.libs() wrongly took the bundled-TBB branch, shipping any stale artifacts present in tbb/build/lib_release (e.g. TBB DLLs built by RcppParallel 5.x in a long-lived working tree, masking the tbb stub library). On Linux and macOS, system-TBB builds silently shipped no libraries at all. Fall back to the configure-detected value from tbb-autodetected.R when the environment variable is unset.
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.
At the install-libs phase,
TBB_LIBwas read only from the environment, which is typically unset there (configure communicates it to the build via make variables, not the environment). Consequences:.install.libs()wrongly took the bundled-TBB branch and copied whatever matched^tbb.*\.dll$out ofsrc/tbb/build/lib_release. In a long-lived working tree, that directory can hold TBB DLLs from the RcppParallel 5.x make-based build (confirmed in the wild: a 5.1.x-eratbb.dll/tbbmalloc.dll/tbbmalloc_proxy.dllset was silently shipped, and the presence of the staletbb.dllalso suppressed the tbb stub build). Fresh trees were unaffected (emptylib_release-> stub built), which is why CRAN/r-universe binaries were correct.TBB_LIBfallback intbbLibraryPath()).Fall back to the configure-detected value from
R/tbb-autodetected.R(already sourced right there, previously unused) when the environment variable is unset. Windows installs now deterministically take the system-TBB branch (copy nothing from Rtools, build the stub), making stalelib_releaseartifacts inert.Note:
tools/config/cleanup.Rdeliberately leavessrc/tbb/buildin place (commented-out unlink), presumably to keep incremental dev builds fast -- left untouched here since this fix makes the stale artifacts harmless.