enable tbb by default on musl-based linux (e.g. alpine)#263
Merged
Conversation
RcppParallel.h gated the default RCPP_PARALLEL_USE_TBB on __gnu_linux__, a glibc-only predefined macro. On musl-based systems such as Alpine, which define __linux__ but not __gnu_linux__, the default fell through to 0 -- disabling TBB for any downstream package that does not pass -DRCPP_PARALLEL_USE_TBB explicitly (i.e. does not use RcppParallel::CxxFlags() in its Makevars), even when RcppParallel itself was built with a working TBB. Match Linux via __linux__ instead, which covers both glibc and musl. This is consistent with the bundled TBB sources, which use __linux__ broadly and only guard on __GLIBC__ where glibc-specific behavior is required. Fixes #231
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.
Fixes #231.
RcppParallel.hgated the defaultRCPP_PARALLEL_USE_TBBon__gnu_linux__, a glibc-only predefined macro. musl-based systems such as Alpine define__linux__but not__gnu_linux__, so the default fell through to0— disabling TBB for any downstream package that doesn't pass-DRCPP_PARALLEL_USE_TBBexplicitly (i.e. doesn't useRcppParallel::CxxFlags()in its Makevars), even when RcppParallel itself was built with a working TBB.This matches packages like FLSSS and evesim still failing on Alpine in #231 despite 6.0.0 emitting the flag from
CxxFlags()(which fixed only the packages that do use it, e.g. bgms).Fix
Match Linux via
__linux__, which covers both glibc and musl:Consistent with the bundled TBB sources, which use
__linux__broadly and only guard on__GLIBC__where glibc-specific behavior is required. On glibc Linux the header already defaulted to1regardless of build-time TBB status, so this introduces no new mismatch — it just brings musl in line with every other Linux.