Unable to build and install LLVM on Mac OSX 10.11

Greetings dear developers!!

I’ve been faced with several difficulties yet I’m unable to do a complete build of LLVM on my system.

I’ve tried to build with Xcode once, ninja + cmake, and several other ways as shown in the web.

Currently, while building on Xcode for the umpteenth time I got an error which says outdated version of svn being used and then architecture not supported.

When using ninja or make to complete the install, it ends with prompt saying that it ended in a fatal error and the header file <stdio.h> couldn’t be found.

I’ve tried building the same several times.

I’ve 4gb ram with an i5 processor and running the latest OSX on my macintosh.

I’ve tried most of the solutions stated in the web.

Can anyone help me with regarding the same. with a detailed instruction set as to how to go about getting the build complete properly.

Thank you.

Yours sincerely,
Sumedh Arani.

Hi,

Building on OS X with Xcode is well tested: http://lab.llvm.org:8080/green/

What does `xcrun clang -v` returns on your system?
What is your cmake command line?

Starting simple I'd expect this sequence of command to work:

git clone http://llvm.org/git/llvm.git
mkdir build
cd build
xcrun cmake ../llvm
make

If this does not work, please post more information on what failure do you see.

Another good way to reproduce the tested configuration is to look at the log on the bots and use the same cmake args: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/25897/console

Arani:~ Sumedh$ xcrun clang -v

Apple LLVM version 7.3.0 (clang-703.0.31)

Target: x86_64-apple-darwin15.4.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Greetings!!

I followed the instructions given by you to the letter and it worked like a charm.

Just this time I didn’t download compiler-rt or any other extra tools.

How can I upgrade to them??

And also how can I change my version of clang to the one which has been built now? As on doing clang --version or xcrun clang -v still gives the version as the one that comes pre built with apple’s machine.

Thank you.

Yours sincerely,

Sumedh Arani.

Arani:~ Sumedh$ xcrun clang -v

Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.4.0
Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Greetings!!

I followed the instructions given by you to the letter and it worked like a charm.

Just this time I didn’t download compiler-rt or any other extra tools.

How can I upgrade to them??

Repeat the process, cloning them in their place according to the documentation (for instance compiler-rt goes into projects).

And also how can I change my version of clang to the one which has been built now? As on doing clang --version or xcrun clang -v still gives the version as the one that comes pre built with apple’s machine.

The xcrun prefix means “run the version from the Xcode toolchain”. You need to provide the path to your own build clang (or add its path to the PATH env var).