Repository navigation
RcppParallel.h disables TBB on Alpine Linux #231
Description
Activity
It looks like this could be fixed via f2f9dc1, at least for packages that include
RcppParallel::CxxFlags()in theirPKG_CXXFLAGSinsrc/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 tbbbut 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.)
I don't think this has been resolved yet, right?
I'm involved in maintenance of four packages out of the list posted by @bastistician , and it seems weird to have to provide non-parallel code as well to resolve this, as this seems to be the result of an interaction between RcppParallel and Alpine Linux (Alpine Linux on itself does support tbb)Thanks for chiming in. AFAIR, the next release of 'RcppParallel' should resolve this issue for Alpine Linux, but note that other systems may indeed lack TBB. I suspect compilation with musl-based Emscripten to WebAssembly might still fail.
Thanks for chiming in. AFAIR, the next release of 'RcppParallel' should resolve this issue for Alpine Linux, but note that other systems may indeed lack TBB. I suspect compilation with musl-based Emscripten to WebAssembly might still fail.
That sounds great! We will look into this from our end as well, thank you for the reply.
We have fixed this now by 'overloading' the tbb namespace and relevant functions/classes, depending on the RCPP_PARALLEL_USE_TBB flag.
See https://github.com/thijsjanzen/junctions/blob/master/src/tbb_stub.h
RcppParallel 6.0.0 now does output
CxxFlagsalso on Alpine Linux (previously empty):R> RcppParallel::CxxFlags() -DRCPP_PARALLEL_USE_TBB=1 -DTBB_INTERFACE_NEW -I/mnt/runner/lib/RcppParallel/includeRevdeps that include that output in their src/Makevars flags now get TBB support, i.e., those that were not prepared for the case RCPP_PARALLEL_USE_TBB=0 no longer fail, e.g., 'bgms'.
Other packages from the original list still fail because they do not incorporateRcppParallel::CxxFlags(), so TBB remains disabled, e.g., 'FLSSS' and 'evesim'.@bastistician are there any other changes we should make on the RcppParallel side to accommodate this?
Thanks. I can confirm that RcppParallel 6.1.0 enables TBB by default on Alpine Linux so packages that use TBB unconditionally no longer fail to install there.
Documentation says packages should call tbb only
#if RCPP_PARALLEL_USE_TBB, which is false on Alpine Linux due toRcppParallel/inst/include/RcppParallel.h
Lines 13 to 17 in 69d50f6
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
CaseBasedReasoningDERGenomeAdmixRScalelinkjunctionssecssefail 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?