Sitelet https://github.com/RcppCore/RcppParallel/pull/280/files
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# RcppParallel (development version)

* Fixed bundled oneTBB builds with recent libc++, which no longer includes
`<algorithm>` 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)
Expand Down
26 changes: 26 additions & 0 deletions patches/missing_algorithm_include.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Include <algorithm> 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 <algorithm> 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 <algorithm> 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 <algorithm> // std::equal
+
namespace tbb {
namespace detail {
namespace d2 {
2 changes: 2 additions & 0 deletions src/tbb/include/oneapi/tbb/concurrent_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "detail/_containers_helpers.h"
#include "cache_aligned_allocator.h"

#include <algorithm> // std::equal

namespace tbb {
namespace detail {
namespace d2 {
Expand Down
Loading