Skip to content

use configure-detected TBB_LIB during install.libs#254

Merged
kevinushey merged 1 commit into
masterfrom
bugfix/install-libs-tbb-lib
Jul 23, 2026
Merged

use configure-detected TBB_LIB during install.libs#254
kevinushey merged 1 commit into
masterfrom
bugfix/install-libs-tbb-lib

Conversation

@kevinushey

Copy link
Copy Markdown
Contributor

At the install-libs phase, TBB_LIB was read only from the environment, which is typically unset there (configure communicates it to the build via make variables, not the environment). Consequences:

  • Windows: .install.libs() wrongly took the bundled-TBB branch and copied whatever matched ^tbb.*\.dll$ out of src/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-era tbb.dll/tbbmalloc.dll/tbbmalloc_proxy.dll set was silently shipped, and the presence of the stale tbb.dll also suppressed the tbb stub build). Fresh trees were unaffected (empty lib_release -> stub built), which is why CRAN/r-universe binaries were correct.
  • Linux/macOS with system TBB: the same misdispatch meant no TBB libraries were copied/symlinked into the package at all (loading still worked via the TBB_LIB fallback in tbbLibraryPath()).

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 stale lib_release artifacts inert.

Note: tools/config/cleanup.R deliberately leaves src/tbb/build in place (commented-out unlink), presumably to keep incremental dev builds fast -- left untouched here since this fix makes the stale artifacts harmless.

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.
@kevinushey
kevinushey merged commit 6e20b49 into master Jul 23, 2026
5 checks passed
@kevinushey
kevinushey deleted the bugfix/install-libs-tbb-lib branch July 23, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant