skip to Main Content

I’m running macOS Monterey 12.6.1 on a Macbook Air and there are no further updates available. I checked my AppleClang version and it’s 14.0.0. If I compile a simple C++ code using e.g. std::boyer_moore_searcher, the function is not found like pointed out in this post. Is there any reason why a C++17 feature is still not supported? Is there any way to get it working? I was unable to install the latest macOS Ventura since it’s not supported to install it even manually. Would the latest macOS solve the problem of seemingly outdated clang headers since I would then be able to further update other software?

2

Answers


  1. https://en.cppreference.com/w/cpp/17

    According to this chart, Apple Clang still has no support for the execution policies you want.

    Since normal Clang does not support this either yet, you can try installing GCC and its standard library to use instead.

    Login or Signup to reply.
  2. @DXPower

    The table is actually not very clear, if you read the line "Parallel algorithms and execution policies" you will find the Intel Parallel STL table marked.

    You can indeed use the parallel algorithms with clang, but you have to link against tbb and tbbmalloc (statically or dinamically), and download and install oneDPL from intel

    Intel oneDPL

    or install it with homebrew:

    brew install onedpl

    Once installed, you can access the algorithms from the folder

    /opt/homebrew/include/oneapi (if installed with homebrew on Mac Os Ventura)

    or in older OS under

    /usr/local/include/oneapi

    To avoid linking errors, it is better to include the headers in the following way (example)

    #include <dpl/algorithm>
    #include <dpl/execution>
    

    and then you can call (example)

    std::for_each(std::execution::par_unseq ... more code)
    

    You can use the parallel stl in the same way in Android or iOS, see

    Android ParallelSTL

    I’ve been using the parallel stl this way since about 2020.

    The procedure is the same whether you use Clang or Apple Clang.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search