<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/116088>116088</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Building libcxxabi throws “cannot find -lcxx-headers” error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++,
libc++abi
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jonathonmckay
</td>
</tr>
</table>
<pre>
Apologies in advance if this isn't the right place to raise this.
I maintain a small HPC cluster. As a result, I often have to install things in non standard ways.
I already have LLVM and Clang 16.0.6 compiled and installed. While attempting to build a 3rd party program, it became clear that I also needed libc++ and libc++abi.
I found instructions on installing libc++ and libc++abi on CentOS7 from Stack Overflow [here](https://stackoverflow.com/questions/25840088/how-to-build-libcxx-and-libcxxabi-by-clang-on-centos-7/25840107#25840107). These are essentially the steps I followed, making path and other settings changes as needed. I downloaded the .src.tar.xz files for libcxx and libcxxabi from https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.6
Step 5 involves building libcxx without libcxxabi. After some minor problems, I got the following cmake command to do what I want:
`cmake -DCMAKE_INSTALL_PREFIX=/minerva/opt/llvm-16.0.6/ -DCMAKE_BUILD_TYPE=Release -DLIBCXX_INCLUDE_BENCHMARKS=OFF -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIBCXX_CXX_ABI=none ..`
Once that worked and was built and installed with `make install`, I then moved on to Step 6, which involves building libcxxabi with the libcxx I just built. After a few more minor problems, I got the following cmake command:
`cmake -DCMAKE_INSTALL_PREFIX=/minerva/opt/llvm-16.0.6/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIBCXXABI_LIBCXX_INCLUDES=../../libcxx-16.0.6.src/include/ -DLIBCXXABI_LIBCXX_PATH=../../libcxx-16.0.6.src/ ..`
This finished successfully.
Then when trying to actually compile with `make`, while it is trying to link libc++abi.so, I get the following error:
`/usr/bin/ld: cannot find -lcxx-headers`
>From what I can tell, this is supposed to be part of libcxx, but I cannot find any "libcxx-headers" in either the source code or in the installed location.
I found that libcxx has make targets generate-cxx-headers, but I verified those have been done and finished without errors.
I expect I'm missing something fundamental, and have likely done something somewhat daft due to the way we install things on our HPC system.
If anyone has any insight, it would be greatly appreciated (There has already been two days of searching and trying things). If any additional information is required, please don't hesitate to ask.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vltv47oR_jX0y8CCTV_iPPjBlxhrnOxusMlp06dgLI4sbihShxxZcX99QUrObXFatCjOw3oViZzL931zwRD00RItxWwtZtsBNlw6v_zpLHLpbJU_43lwcOq8XNXOuKOmANoCqhPanEAXwKUOoIMV8oqBSwKvjyVDbTAnYAcedaB0KhOjrRit9lChtozRDIQKjYEvdxvITROYfAarAAieQmNYyA3swRVMFko8JXvaBo53uNT2mIKxzkJgtAq9ghbPb47QeEJ17u7e3v7tK6BVsDFojzCeZ6NsDrmram1IpS-9bVIZ_L3UhgCZqapZ22N0fWi0UYAw8Qpq9HyG2rujxyrGqRkOlGNFkBtCD1wiQwwhOLBEihQYfciFXAu5Tt7e_sSD7mO-RF64po_HNzlrZwM4e4kvhvPvbMWjG7L8_f4KCu8quGfMn-H7iXxhXAtiti7Jk5hthVyUzHUQk5WQOyF3IZ50_cEsd5WQuz8aCikEIXdytpiORouFkLvStUN2wwTKMPp_eRmivTziQQ8P52EesR46O8zJsgvDq4uN8ehKyMnb43UGDyUFAvQEFAJZ1mjMOUkqMNUBIirGuJZUxLvC54hDjVwmBByX5CEQc9JFXqI9UgAMPfoZ7EG51hqHkYtoNgs-zxh99vJPKLShAIXz0MX_impKpYPxI1RHzWVz6DEy5nT5b1h795NyFnLnyRAGisAxHvvvzh-HnfjeU37PVMMMtD05c6LQae1C9MsLtJpL1_BbSBmsCo4Zu4qg0tb5qMaDoSp0ZXN0XT12oEVTeYXPFBVfxeTYgXLQdjJt0XLMr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