Cannot build ParallelSTL

I can no longer build the parallel STL library. I have made the following attempts:

cmake -G Ninja -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;pstl" -DPSTL_PARALLEL_BACKEND="gcd" -DLIBCXX_ENABLE_PARALLEL_ALGORITHMS="ON"

cmake -G Ninja -S llvm -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;pstl" -DPSTL_PARALLEL_BACKEND="gcd" -DLIBCXX_ENABLE_PARALLEL_ALGORITHMS="ON" -DCMAKE_BUILD_TYPE=Debug

They both fail with the error CMake Error at /Users/csnelson/projects/llvm-project/libcxx/src/CMakeLists.txt:191 (message): Could not find ParallelSTL

Could you check whether ⚙ D129452 [runtimes] Add pstl to the list of default runtimes to fix the build fixes your problem?

If I apply the patch and then run:

cmake -G Ninja -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libunwind;libcxxabi;pstl;libcxx;" -DPSTL_PARALLEL_BACKEND="gcd" -DLIBCXX_ENABLE_PARALLEL_ALGORITHMS="ON"

It does indeed fix the first problem. However, I get a new error:

In file included from /Users/csnelson/projects/llvm-project/libcxxabi/src/cxa_default_handlers.cpp:13:
/Users/csnelson/projects/llvm-project/build/include/c++/v1/memory:1136:13: fatal error: '__pstl_memory' file not found
#   include <__pstl_memory>

It breaks the same way on my machine, so something is obviously broken currently. (should have actually built the thing) I’ll have to investigate further, but that will probably take some time. Once it’s not broken anymore I’ll add a runner, so things don’t fall apart anymore.

Has a solution been found to this?

Not yet. We’re currently focusing on ranges, so I didn’t have much time trying to fix the PSTL.

Great! Ranges are important!

From the status page, it looks unrealistic that (C++20) ranges support would be finished before LLVM 15 branches in about a week, or is that the intention? (would be great if so! :upside_down_face:)

If it’s not going to be complete for LLVM 15 anyway, I’d think that having a PSTL that’s at least buildable would at least be equally important than progressing on ranges?

25 algorithms aren’t landed yet. Of these we have 11 under review and 14 still to do. We’re currently cleaning some things up, so it should be quite fast to implement the last few algorithms. I don’t know whether these will be done before the branch, but we’re trying to get them in. Either way we plan to mark them as stable soon.
I also don’t have much experience with the PSTL, so it will probably take me some time to get it working. I think this time is currently spent better trying to get as much ranges stuff in as possible.

FYI ⚙ D103198 [libc++] Add a CI configuration where we test the PSTL integration fixes the build problem and adds a CI bot to make sure this doesn’t regress again.

1 Like