19

When trying to compile llvm/clang

../llvm/configure --enable-cxx11=yes --enable-libcpp=yes 
  --enable-optimized=yes --prefix=/usr/local --enable-targets=all 
  --with-gcc-toolchain=/usr/local/bin --enable-bindings=auto 

the following error occurs:

[...]llvm/include/llvm/Support/AlignOf.h:19:10: fatal error: 'cstddef' file not found
#include <cstddef>
         ^
1 error generated.
rm: [...]/llvm_build/lib/Support/Release+Asserts/APFloat.d.tmp: No such file or directory
make[1]: *** [[...]/llvm_build/lib/Support/Release+Asserts/APFloat.o] Error 1
make: *** [all] Error 1

But cstddef does indeed exist (in /usr/local/include/c++/4.8.0/). Adding --includedir=/usr/local/include/c++/4.8.0/ to the configure does not help also.

What can be the cause for this?

3
  • 1
    Two remarks: IMHO the correct option is -I<path>, not --includedir<pat>. In addition, at least at my OSX machine, cstddef is in /usr/include/c++/..., not in /usr/local/include/c++/..., but YMMV.
    – Matthias
    Commented May 21, 2013 at 8:21
  • --includedir, along with the other options, is what is mentioned in ./configure --help. cstddef is in /usr/local/..., because I also have installed the recent GCC to that location.
    – Appleshell
    Commented May 21, 2013 at 10:43
  • Sorry, I thougt the option goes to clang. Have you checked the calling parameters for clang?
    – Matthias
    Commented May 21, 2013 at 12:33

2 Answers 2

10
$ sudo apt install libstdc++-12-dev

it solves my problem in ubuntu 22.04. See https://community.intel.com/t5/Intel-oneAPI-Base-Toolkit/On-upgrading-to-Ubuntu-22-0-4-the-standard-libraries-are-no/td-p/1455303.

You can find different versions of libstdc++ by searching https://www.debian.org/distrib/packages#search_packages, such as this results page for the amd64 architecture.

1

Try building with cmake or re-installing dependancies below

mkdir build
cd build/
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="X86_64;JSBackend" \
-DLLVM_INCLUDE_EXAMPLES=OFF

I ran into similar errors and installed the essential gcc-4.8 and libstdc++-4.8 libraries. Worked for me atleast.

sudo apt-get install build-essential

Good luck. Hope it works

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.