diff --git a/NEWS.md b/NEWS.md index 5b1581ad..71a6d453 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # RcppParallel (development version) +* Fixed bundled oneTBB builds with recent libc++, which no longer includes + `` transitively. `tbb/concurrent_queue.h` uses `std::equal` but + did not include it, giving "no member named 'equal' in namespace 'std'" when + compiling `concurrent_bounded_queue.cpp`, as seen on CRAN's clang-trunk + checks. (#280) + * Fixed bundled oneTBB builds and downstream compilation with Clang and libc++ when targeting macOS 10.12 or earlier, where C++17 aligned allocation is not available. (#219) diff --git a/patches/missing_algorithm_include.diff b/patches/missing_algorithm_include.diff new file mode 100644 index 00000000..b50f92d7 --- /dev/null +++ b/patches/missing_algorithm_include.diff @@ -0,0 +1,26 @@ +Include in concurrent_queue.h, which uses std::equal in the +operator== of both concurrent_queue and concurrent_bounded_queue but relies on +some other header dragging in. + +libc++ trunk (as used by CRAN's clang-trunk / clang 23 checks) no longer +provides that transitive include, so building the bundled oneTBB fails with +'no member named equal in namespace std' when compiling +src/tbb/concurrent_bounded_queue.cpp. Sibling containers -- concurrent_vector.h, +concurrent_lru_cache.h -- already include explicitly; this brings +concurrent_queue.h in line. + +Not yet fixed upstream as of oneTBB master; drop this once it is. + +diff --git a/src/tbb/include/oneapi/tbb/concurrent_queue.h b/src/tbb/include/oneapi/tbb/concurrent_queue.h +index 9d7ec9a2..dd2ff34c 100644 +--- a/src/tbb/include/oneapi/tbb/concurrent_queue.h ++++ b/src/tbb/include/oneapi/tbb/concurrent_queue.h +@@ -24,6 +24,8 @@ + #include "detail/_containers_helpers.h" + #include "cache_aligned_allocator.h" + ++#include // std::equal ++ + namespace tbb { + namespace detail { + namespace d2 { diff --git a/src/tbb/include/oneapi/tbb/concurrent_queue.h b/src/tbb/include/oneapi/tbb/concurrent_queue.h index cfd5db6a..d23948b6 100644 --- a/src/tbb/include/oneapi/tbb/concurrent_queue.h +++ b/src/tbb/include/oneapi/tbb/concurrent_queue.h @@ -24,6 +24,8 @@ #include "detail/_containers_helpers.h" #include "cache_aligned_allocator.h" +#include // std::equal + namespace tbb { namespace detail { namespace d2 {