title: How to use <execution> library in c++17
body: <p>Learning how to use the execution libraries in c++17. I am using Linux, but have also tried on my Mac. I get this error:</p>
  
  <blockquote>
    <p>fatal error: 'execution' file not found</p>
  </blockquote>
  
  <p>when i compile in both OS's.</p>
  
  <p>I would rather stick with linux where i type:</p>
  
  <p><code>g++ -g -std=c++17 ModuleDevelopmentStage13.cc -lboost_system -lboost_thread -pthread</code></p>
  
  <p>Perhaps I need to add some more libraries in the <code>-l....</code> arguments here. I am new to c++ and not sure where to find out which ones to add? I have installed the LLVM and tried a few options out there on similar posts but with no luck. Any advice?</p>
  
  <p>so on my mac i did gcc -v and got: </p>
  
  <p><code>gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin</code></p>
  
  <p>Ok, so an update- I am now switched to gcc-9.1 installed via homebrew.</p>
  
  <p>There are no "include" errors as before but I now have this issue when I try to compile simple code examples which use the c++17 libraries:</p>
  
  <p><code>g++-9 -std=c++17 example.cc 
  In file included from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/pstl/parallel_backend.h:14,
                   from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/pstl/algorithm_impl.h:25,
                   from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/pstl/glue_execution_defs.h:52,
                   from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/execution:3,
                   from example.cc:6:
  /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/pstl/parallel_backend_tbb.h:19:10 fatal error: tbb/blocked_range.h: No such file or directory
     19 | #include &lt;tbb/blocked_range.h&gt;
        |          ^~~~~~~~~~~~~~~~~~~~~
  compilation terminated.</code></p>
  
  <p>I found the missing library and compiled like:</p>
  
  <p><code>g++-9 -std=c++17 example.cpp -I/usr/local/Cellar/tbb/2019_U8/include/  -I/usr/local/Cellar/tbb/2019_U8/lib/</code></p>
  
  <p>I got the following error:
  <code>
  Undefined symbols for architecture x86_64:
    "tbb::interface7::internal::task_arena_base::internal_current_slot()", referenced from:
        tbb::interface7::task_arena::current_thread_index()      in ccnPixdL.o
    "tbb::interface7::internal::isolate_within_arena(t..........</code></p>
  
  <p>followed by many lines of similar.....feel like im closer but no idea how to move on this one?</p>
  
  <p>Resolved with  <code>g++-9 -std=c++17 example.cpp -I/usr/local/Cellar/tbb/2019_U8/include/  -L/usr/local/Cellar/tbb/2019_U8/lib/ -ltbb</code></p>