RcppParallel.h disables TBB on Alpine Linux
Documentation says packages should call tbb only #if RCPP_PARALLEL_USE_TBB, which is false on Alpine Linux due to
https://github.com/RcppCore/RcppParallel/blob/69d50f65fa6cfc8163cccf09c6a500e55f1e24a7/inst/include/RcppParallel.h#L13-L17
I was able to successfully install RcppParallel using the system TBB (via --configure-vars='TBB_LIB=/usr/lib TBB_INC=/usr/include'), but the above means packages LinkingTo RcppParallel won't usually use TBB anyway.
Furthermore, several packages don't seem to use TBB conditionally, at least
- CaseBasedReasoning
- DER
- FLSSS
- GenomeAdmixR
- RcppMeCab
- ~Scalelink~
- evesim
- junctions
- secsse
fail to compile on Alpine Linux with errors such as "error: 'tbb' does not name a type" or "error: 'tbb' has not been declared" (see the corresponding outputs at https://github.com/bastistician/Rcheck/tree/results/musl/issues).
Is there something RcppParallel[.h] could do better with regard to its default setting so TBB is used by packages on Alpine Linux if RcppParallel was installed with the system TBB?
It looks like this could be fixed via f2f9dc1, at least for packages that include RcppParallel::CxxFlags() in their PKG_CXXFLAGS in src/Makevars, because that will now include -DRCPP_PARALLEL_USE_TBB=1 (if RcppParallel was installed with enabled TBB as usual). Thanks!
BTW, the new TBB version bundled here seems to successfully compile on Alpine Linux -- well, I don't actually get any output between
*** building tbb
*** finished building tbb
but assuming all went well a system installation is no longer needed.
Awesome! Thanks for reporting back. I'm going to start trying to prepare a CRAN release of RcppParallel soon as well, but this will take some time to verify since the ABI changes in TBB means all downstream dependencies need to be rebuilt.
The output here is hidden mostly to discard compiler warnings and the like that might make certain CRAN maintainers unhappy. (I don't have any control over these and I don't want to be forced to ship a patched version of TBB here.)