Parallel algorithms and <execution> (requires Thread Building Blocks 2018 or newer). Emerging dev-cpp/tbb-2018.20180312 works here. I guess it at least should mention it in postinst messages.
(In reply to Michael Cook from comment #0) > Parallel algorithms and <execution> (requires Thread Building Blocks 2018 or > newer). > > Emerging dev-cpp/tbb-2018.20180312 works here. Can you provide a small example that exhibits the failure? > I guess it at least should mention it in postinst messages.
Created attachment 575370 [details] C++17 parallel execution example g++ -std=c++17 par.cpp -ltbb should compile it fine.
Thank you! Yeah, tbb is effectively a dependency of pstl: $ LANG=C g++ -std=c++17 a.cc -o a In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/pstl/parallel_backend.h:14, from /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/pstl/algorithm_impl.h:25, from /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/pstl/glue_execution_defs.h:52, from /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/execution:32, from a.cc:1: /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/pstl/parallel_backend_tbb.h:19:10: fatal error: tbb/blocked_range.h: No such file or directory 19 | #include <tbb/blocked_range.h> | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. I'm surprised it's enabled by default even if I don't have <tbb/tbb.h> in my system. It should yield nicer error about missing backend: // For now this defaults to being based on the presence of Thread Building Blocks # ifndef _GLIBCXX_USE_TBB_PAR_BACKEND # define _GLIBCXX_USE_TBB_PAR_BACKEND __has_include(<tbb/tbb.h>) # endif // This section will need some rework when a new (default) backend type is added # if _GLIBCXX_USE_TBB_PAR_BACKEND # define __PSTL_USE_PAR_POLICIES 1 # endif #if __PSTL_PAR_BACKEND_TBB #include "parallel_backend_tbb.h" #else __PSTL_PRAGMA_MESSAGE("Parallel backend was not specified"); #endif
> I'm surprised it's enabled by default even if I don't have <tbb/tbb.h> in my > system. It should yield nicer error about missing backend: Ah, that is probably enabled by default with: #if __PSTL_USE_PAR_POLICIES #if !defined(__PSTL_PAR_BACKEND_TBB) #define __PSTL_PAR_BACKEND_TBB 1 #endif #else #undef __PSTL_PAR_BACKEND_TBB #endif