Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error when compiling llvm/clang - 'cstddef' file not found

Tags:

c++

macos

clang

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?

like image 445
Appleshell Avatar asked May 21 '13 02:05

Appleshell


1 Answers

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

like image 61
Tom Siwik Avatar answered Sep 30 '22 00:09

Tom Siwik