Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-6566

Missing dependency of gcc on tbb

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None

      Trying to compile a C++ translation unit that uses C++17 STL parallelism fails with gcc 9.1:

      #include <execution>
      
      int main()
      {
          return 0;
      }
      
      $ g++ test.c++ -o test -std=c++17
      In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.1/include/g++-v9.1.1/pstl/parallel_backend.h:14,
                       from /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.1/include/g++-v9.1.1/pstl/algorithm_impl.h:25,
                       from /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.1/include/g++-v9.1.1/pstl/glue_execution_defs.h:52,
                       from /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.1/include/g++-v9.1.1/execution:32,
                       from test.c++:2:
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.1/include/g++-v9.1.1/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.
      

      The way to get it to work is to emerge dev-cpp/tbb and then link against it:

      $ g++ test.c++ -o test -std=c++17 -ltbb
      

      As STL parallelism is a core feature of C++17 I think it should work out of the box, i.e. sys-devel/gcc should (runtime) depend on dev-cpp/tbb.

            drobbins drobbins
            calrama calrama
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: