I used to build llvm/clang like this (and install it in /opt):
git clone --branch llvmorg-15.0.2 --depth=1 GitHub - llvm/llvm-project: The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.
cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/opt/llvm -DLLVM_ENABLE_PROJECTS=“clang;clang-tools-extra;lld;lldb;openmp” -DLLVM_ENABLE_RUNTIMES=“libcxx;libcxxabi;libunwind;compiler-rt” …/llvm
sudo ninja install
and then ensure the /opt/llvm/bin is in my path, and also create a file: /etc/ld.so.conf.d/clanglib.conf
with the following content:
Anf obviously do “sudo ldconfig” at the end.
This recipe has worked for many clang versions, and now also allows to build clang15, but some items (the one not found, mentioned in the title) are now in a new subdirectory x86_64-unknown-linux-gnu.
The result is:
- some small test applications do build, but can’t run (they don’t find libc++.so.1), during compilation the correct <__config_site> was picked up (checked by inserting an illegal statement in it, and compiler spots that)
- when trying to build the boost libraries, they don’t even compile, since they don’t find the <__config_site>
I build boost like this:
./bootstrap.sh --with-toolset=clang --prefix=/home/ldco/SelfBuild/Deployed/boostclang
./b2 -j12 cxxflags=“-std=c++20 -stdlib=libc++” linkflags=“-stdlib=libc++” install
Any suggestions on what I am missing, or doing wrong ?
OS : Linux OpenSuse Leap 15.4 (or 15.2, tried on 2 systems)
GCC : 12.2 (and a 11.3)