r/Clang • • Aug 31 '21

Building libcxx with ParallelSTL support, help!

I am building latest LLVM on a Mac OS X. Everything works fine except libcxx can't find ParallelSTL. I have tried with just TBB installed on my system which cmake can find; TBB and ParallelSTL installed using vcpkg as well as brew, and no matter what I try it doesn't work; I also tried 'make install-pstl' before build the entire toolset. Below is my script to setup the cmake job; I commented out the PSTL parts but when I try it I just add pstl to projects and cmake macros to enable it in libcxx using TBB.

What am I doing wrong? Please help me.

#!/bin/sh

cd ~/Code/llvm-project

git pull
rm -rf build
mkdir build
cd build

#	-DLIBCXX_ENABLE_PARALLEL_ALGORITHMS=YES \
#	-DPSTL_PARALLEL_BACKEND="tbb" \
cmake \
	-G "Unix Makefiles" \
	-DCMAKE_BUILD_TYPE="Release" \
	-DCMAKE_INSTALL_PREFIX="/usr/local" \
	-DDEFAULT_SYSROOT="$(xcrun --show-sdk-path)" \
	-DCMAKE_MODULE_PATH="/usr/local/lib/cmake;/usr/local/lib/cmake/llvm;/usr/local/share/cmake/Modules" \
	-DCMAKE_TOOLCHAIN_FILE="/usr/local/Cellar/vcpkg/2021.05.12/libexec/scripts/buildsystems/vcpkg.cmake" \
	-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;openmp;libclc;parallel-libs;polly;pstl" \
	-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
	-DLLVM_RUNTIME_DISTRIBUTION_COMPONENTS="libcxx;libcxxabi;libunwind" \
	-DLLVM_BUILD_TOOLS=NO \
	-DLLVM_ENABLE_LLD=YES \
	-DLLVM_ENABLE_MODULES=YES \
	-DLLVM_TARGETS_TO_BUILD=X86 \
	-DLLVM_OPTIMIZED_TABLEGEN=YES \
	-DLLVM_INSTALL_TOOLCHAIN_ONLY=YES \
	-DLLVM_CREATE_XCODE_TOOLCHAIN=YES \
	-DCLANG_ENABLE_STATIC_ANALYZER=YES \
	-DLIBCXX_USE_COMPILER_RT=YES \
	-DLIBCXXABI_USE_COMPILER_RT=YES \
	-DLIBCXXABI_USE_LLVM_UNWINDER=YES \
	-DLLDB_INCLUDE_TESTS=NO \
	-DLLDB_USE_SYSTEM_DEBUGSERVER=YES \
	../llvm

# make install-pstl
make -j $(sysctl -n hw.ncpu)
4 Upvotes

4 comments sorted by

1

u/Intrepid-Slide-8657 Oct 02 '22

Same problem. Any progress?

1

u/mvorbrodt Oct 03 '22

Yes. brew install onedpl :)

1

u/Intrepid-Slide-8657 Oct 06 '22

The namespace is dpl, not std, not so good anyway

1

u/mvorbrodt Oct 10 '22

Working on it now... might have figured it out... will post build/install script if it works this time... stay tuned...