Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RcppParallel.h disables TBB on Alpine Linux #231

Open
bastistician opened this issue Dec 22, 2024 · 2 comments
Open

RcppParallel.h disables TBB on Alpine Linux #231

bastistician opened this issue Dec 22, 2024 · 2 comments

Comments

@bastistician
Copy link

Documentation says packages should call tbb only #if RCPP_PARALLEL_USE_TBB, which is false on Alpine Linux due to

# if defined(__APPLE__) || defined(__gnu_linux__) || (defined(__sun) && defined(__SVR4) && !defined(__sparc))
# define RCPP_PARALLEL_USE_TBB 1
# else
# define RCPP_PARALLEL_USE_TBB 0
# endif

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
  • FLSSS
  • GenomeAdmixR
  • Scalelink
  • 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?

@bastistician
Copy link
Author

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.

@kevinushey
Copy link
Contributor

kevinushey commented Jan 15, 2025

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.)

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

No branches or pull requests

2 participants