Skip to content

Fix compilation under clang-19 aarch64 #235

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

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

andrjohns
Copy link
Contributor

The development version is failing to compile under the rtools45 pre-release for Windows Arm because one of the methods in the tbb-compat stub is missing an attribute from one the declarations:

Installing package into 'C:/Users/andrew/AppData/Local/R/aarch64-library/4.6'
(as 'lib' is unspecified)
* installing *source* package 'RcppParallel' ...
** this is package 'RcppParallel' version '5.1.10.9000'
** using staged installation
** preparing to configure package 'RcppParallel' ...
*** configured file: 'R/tbb-autodetected.R.in' => 'R/tbb-autodetected.R'
*** configured file: 'src/Makevars.in' => 'src/Makevars'
** finished configure for package 'RcppParallel'
** libs
using C++ compiler: 'clang version 19.1.7'
installing via 'install.libs.R' to C:/Users/andrew/AppData/Local/R/aarch64-library/4.6/00LOCK-RcppParallel/00new/RcppParallel
** creating tbb stub library
using C++ compiler: 'clang version 19.1.7'
clang++ -std=gnu++17  -I"C:/PROGRA~1/R-AARC~1/R-devel/include" -DNDEBUG -I../inst/include -I"C:/rtools45-aarch64/aarch64-w64-mingw32.static.posix/include"    -I"/aarch64-w64-mingw32.static.posix/include"   -DRCPP_PARALLEL_USE_TBB=1   -O2 -Wall      -c tbb-compat/tbb-compat.cpp -o tbb-compat/tbb-compat.o
tbb-compat/tbb-compat.cpp:137:54: error: redeclaration of 'tbb::internal::task_scheduler_observer_v3::observe' cannot add 'dllexport' attribute
  137 | void __TBB_EXPORTED_FUNC task_scheduler_observer_v3::observe( bool enable ) {
      |                                                      ^
tbb-compat/tbb-compat.cpp:43:31: note: previous declaration is here
   43 |    void __TBB_EXPORTED_METHOD observe( bool state=true );
      |                               ^
1 error generated.
make: *** [C:/PROGRA~1/R-AARC~1/R-devel/etc/Makeconf:296: tbb-compat/tbb-compat.o] Error 1
Error in .install.libs(tbbLib) : error building tbb stub library
* removing 'C:/Users/andrew/AppData/Local/R/aarch64-library/4.6/RcppParallel'
* restoring previous 'C:/Users/andrew/AppData/Local/R/aarch64-library/4.6/RcppParallel'
Warning message:
In install.packages(getwd(), type = "source", repos = NULL) :

This errors since clang has different handling of attributes in this case, and attribute needs to be present in both declarations

@kevinushey kevinushey merged commit 11b6913 into RcppCore:master Mar 19, 2025
3 checks passed
@kevinushey
Copy link
Contributor

Thanks for the fix!

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.

2 participants