0

I ran ./configure, but when I try to make llvm, I get the following error:

[  0%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o
In file included from /opt/static_analysis/llvm/include/llvm/Support/SwapByteOrder.h:19:0,
             from /opt/static_analysis/llvm/include/llvm/Support/MathExtras.h:18,
             from /opt/static_analysis/llvm/include/llvm/ADT/SmallVector.h:20,
             from /opt/static_analysis/llvm/include/llvm/ADT/ArrayRef.h:14,
             from /opt/static_analysis/llvm/include/llvm/ADT/APInt.h:19,
             from /opt/static_analysis/llvm/include/llvm/ADT/APFloat.h:20,
             from /opt/static_analysis/llvm/lib/Support/APFloat.cpp:15:
/opt/static_analysis/build/include/llvm/Support/DataTypes.h:77:3: error: #error "Don't have a definition for uint64_t on this platform"
# error "Don't have a definition for uint64_t on this platform"
^make[2]: \*** [lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o] Error 1
make[1]: \*** [lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2
make: \*** [all] Error 2

P.S. I tried installing it by following these instructions - Getting Started: Building and Running Clang

pl_rock
  • 11,297
  • 1
    What version are you trying to build? is there a particular reason you are trying to install from source rather than using the version provided in the package repository? – steeldriver Sep 12 '15 at 12:50
  • Honestly, I am new to Linux and the source way showed up when I googled how to install clang. May you tell me with a bit more details what the other way to do it would be? I just followed the tutorial, I may only assume it is the latest version. – frostblooded Sep 12 '15 at 12:51
  • Unless you need particular features that are not supported by the packaged version (which is clang-3.4 in 14.04), I'd recommend that you stick with that - at least for now. You should be able to install it just like any other package i.e. from Software Center or from a terminal using sudo apt-get install clang. – steeldriver Sep 12 '15 at 12:55

2 Answers2

0

I had the same problem and it was solved by installing a newer version of gcc, which is basically an answer in this thread: How do I use the latest GCC on Ubuntu?

I guess a newer version of Ubuntu (15) automatically solves this problem because the default gcc there is 4.9 already.

a_m
  • 116
0

I had the same problem, I fixed it by clearing the CMake cache. Just delete CMakeCache.txt and try running make again. CMakeCache.txt should be in the same directory you're trying to execute the CMake command in.

Adam
  • 271
  • I edited the answer for clarity. I also had the uint64_t not defined error, I fixed it by clearing the CMake cache. – Adam Mar 06 '17 at 22:56