Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685062 - sys-devel/gcc-9 C++17 Parallel algorithms support dependency on dev-cpp/tbb-2018.20180312
Summary: sys-devel/gcc-9 C++17 Parallel algorithms support dependency on dev-cpp/tbb-2...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-04 19:25 UTC by Michael Cook
Modified: 2021-03-09 05:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
C++17 parallel execution example (par.cpp,353 bytes, text/plain)
2019-05-05 23:00 UTC, Michael Cook
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Cook 2019-05-04 19:25:12 UTC
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.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-05-05 21:49:54 UTC
(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.
Comment 2 Michael Cook 2019-05-05 23:00:13 UTC
Created attachment 575370 [details]
C++17 parallel execution example

g++ -std=c++17 par.cpp -ltbb should compile it fine.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-05-06 07:28:51 UTC
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
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2019-05-06 08:07:30 UTC
> 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