OS X building broken?


I tried building cling from source today.

When using cmake -DCMAKE_INSTALL_PREFIX=… , I get errors at lines 83 and 84 of tools/cling/CMakeLists.txt saying that 5 arguments are required.

I deleted those lines as they are not related to OS X and the build scripts get generated.

Then I do cmake --build . --config Release --target cling and I get an include file not found error reported below. It seems that the LLVM/clang current sources do not have that .inc file anymore…

Can you please help?


clang/include/clang/AST/ASTFwd.h:22:10: fatal error:
‘clang/AST/DeclNodes.inc’ file not found
#include “clang/AST/DeclNodes.inc”
1 error generated.


I was able to reproduce your error in SLC6. I will forward the question to the appropriate person.

Alternatively, you can try to follow the “Manual build” instructions in:

root.cern.ch/drupal/content/cli … structions

I tried myself and it worked fine.




I have updated the cmake --build step; with that it seems to work.

Cheers, Axel.

I am also having problems building on OSX (cmake) according to the posted instructions as well as the cpt.py tool. In particular, cpt.py exits with unexepected test failures :frowning: :frowning: :frowning:. Can anybody provide a reliably-working build procedure for OSX and cling master?

Also, is cling pinned at an old version of llvm, or is there any chance cling might work against llvm >=3.5?

Finally, I’m trying to build cling from source because I want to try to embed the interpreter in another program. Can this be done from the binary releases? (Do the binaries ship with includes?)

Here’s my procedure:
Checkout cling (twice?), clang, and llvm:
cling/ <-- checkout of cling from root.cern.ch/git
cling/build <-- I created this dir, and it’s the current working dir below
cling/src <-- checkout of llvm from root.cern.ch/git and checkout out cling-patches branch (commit 4f6e66a29b)
cling/src/tools/cling <-- also a checkout of cling (is this right?)
cling/src/tools/clang <-- checkout of clang from root.cern.ch/git and checkout out cling-patches branch (commit 89ccdaef)

in cling/build, I run:
$ cmake -DCMAKE_INSTALL_PREFIX=pwd …/src
(completes ok)
$ cmake --build . --config Release --target cling – -j8

This fails with a traceback similar to the one in the OP:

[ 0%] Building CXX object tools/cling/lib/Utils/CMakeFiles/clingUtils.dir/AST.cpp.o
In file included from
In file included from /xxx/cling/src/tools/cling/…/clang/include/clang/AST/ASTContext.h:18:
In file included from /xxx/cling/src/tools/cling/…/clang/include/clang/AST/ASTTypeTraits.h:19:
/xxx/cling/src/tools/cling/…/clang/include/clang/AST/ASTFwd.h:22:10: fatal error: ‘clang/AST/DeclNodes.inc’ file not found
#include “clang/AST/DeclNodes.inc”
1 error generated.
tools/cling/lib/Utils/CMakeFiles/clingUtils.dir/build.make:54: recipe for target ‘tools/cling/lib/Utils/CMakeFiles/clingUtils.dir/AST.cpp.o’ failed
gmake[3]: *** [tools/cling/lib/Utils/CMakeFiles/clingUtils.dir/AST.cpp.o] Error 1
CMakeFiles/Makefile2:16448: recipe for target ‘tools/cling/lib/Utils/CMakeFiles/clingUtils.dir/all’ failed
gmake[2]: *** [tools/cling/lib/Utils/CMakeFiles/clingUtils.dir/all] Error 2
CMakeFiles/Makefile2:16576: recipe for target ‘tools/cling/tools/driver/CMakeFiles/cling.dir/rule’ failed
gmake[1]: *** [tools/cling/tools/driver/CMakeFiles/cling.dir/rule] Error 2
Makefile:3564: recipe for target ‘cling’ failed
gmake: *** [cling] Error 2

I have also tried the autotools/configure route (following how Travis is set up on the github cling site) and get a similar error.

When I try to use cpt.py with either --current-dev tar or --last-stable, I get unexpected tests failures :frowning: :frowning: :frowning:

OSX 10.9.4
$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

Also, is there a verified-working build procedure for linux? I’ve tried running all this in ubuntu utopic (via Docker on mac) and so far the VM OOMs before compilation finishes… :frowning: but lots of broken builds on Travis here: travis-ci.org/vgvassilev/cling


I don’t see where we say that src/ should contain the cling sources? They should end up only in src/llvm/tools/

We have patches on top of llvm + clang; you cannot use the original sources. Moving cling to current clang + llvm is on my list for this year, likely for begin December.

And FYI, the llvm + clang we use is from February.

Cheers, Axel.

Hi Axel,

src/ is the llvm source code as the instructions specify. src/ is within a cling checkout; I was seeing some CMake errors without this but perhaps I wasn’t building cleanly.

Can you not reproduce the clang/AST/DeclNodes.inc or cpt.py errors? What’s a stable version of cling?

I found the llvm version number reference, I guess this is llvm 3.5 then? Thanks!


Today I discovered clone.sh ( raw.githubusercontent.com/karie … r/clone.sh ) and I was successfully able to build & run using this script (hurray!!). So it looks like:

  • CMake setup is broken for OSX 10.9. It might be that cling is actually OK and llvm/clang CMake setup is actually broken for OSX: llvm.org/bugs/show_bug.cgi?id=11232
  • cpt.py is perhaps broken. AFAICT, the only major difference between cpt.py and clone.sh is --enable-targets=host, which might be significant on OSX due to how Apple sets up the dev tools.

Axel, I believe you authored clone.sh. I noticed it sets up a nice local install with (I believe) the patched clang and llvm. If I wanted to integrate cling in an app, could I just include and link against this local install? Is this effectively what ROOT would do?


Yes, you can link against the local install of cling.

cling needs a few headers from include/ at runtime.

Cheers, Axel.