You are here

Cling integrated in our CI tool

It's been a while since the last activity on our blog. However, it doesn't mean that we are not spending every minute to work on improving the ROOT Framework.

We talk a lot about Cling these days not only because it will be important part of ROOT 6, but because we are very excited and proud of what we are doing. To be honest that's my first interpreter I develop. I had worked on simple compilers and currently I am involved (in my free time) in a .NET decompiler tool chain (don't tell Fons!!! :)). I have to admit that nothing is more fun than working on what we classify as interpreter. I call it interactive-compiler interface since Cling is just the handle of a huge iron gate to leading to the core of clang.

Maybe I should dedicate a couple of other posts on what are the exciting parts in making a C++ compiler behave like an interpreter. What I wanted to share was of course different. I always get distracted...

As most of you maybe know Cling has been in ROOT's trunk since a while. However, we still think that Cling should be able to integrate as a tool in LLVM's tool chain. The reason is we want to have Cling standalone for ROOT-independent use. This means we have two build systems and a lot of well-hidden by make details.

There are many user complains about Cling being not in sync with LLVM's and Clang's mainlines. Finally we have had a week to tackle this problem. Thanks to Axel's expertise in Electric Commander (our continuous integration tool) Cling is a part of the continuous integration done here! We even have our source releases built every night here!

We don't announce it too loudly but we have cling as a library (aka libCling). Those of you who use or are going to use libCling: the documentation of that library is regenerated every night as well and could be found here



I found a little bug in TerminalDisplayWin.h at least mingw needs #include


Could you report this bug at our bug tracker, please? Don't forget to quote the error message and what exactly you did. Thanks!


"Maybe I should dedicate a couple of other posts on what are the exciting parts in making a C++ compiler behave like an interpreter" -- YES, please, I'd be quite interested in such a series! :-)

Hi Matt,

Will do. I can't promise when though.

Stay tuned :)


Thanks for making it available. I have been toying around with building cling, but having to maintain two trees for an upstream and a patched (maybe not anymore) and fixed version for cling wasn't something I liked. So the tarballs you provide are really useful. I just tried it out, but unfortunately there is an build RPATH encoded in bin/cling. If that wouldn't be there I would even be able to run it ;) Thanks again for your work on this, I am really looking forward to using Boost in header files which are available in an interpreter!

Hi Benjamin,

Thanks for the interest! And thanks for reporting the problem.

What you pointed out was an issue. I believe it is fixed now with the latest releases being built. Now we have standalone, runnable cling :)

Please let me know if it works for you

Just out of curiosity: Why do you intend to use Boost in the (cling's?) header files?


Hi Vassil, thank you for taking care of this. I will report back about it once the download like becomes available again. As for Boost in headers, I don't care that much about having all of it available in the interpreter (but it would still be cool). What I am really looking forward to is that some day one won't need to hide away the fact that one uses Boost, only because some tool like rootcint also needs to look at the headers. Having to hide stuff in a compiled unit works (at least with my clang and gcc compiler and linker toolchains) at least partially against e.g. deep inlining or efficient template code (think expression templates). Not that I don't appreciate what ROOT has included as batteries, but for some problems the C++-world has moved on. Boost makes some useful extensions available, no matter if the compiler supports C++11 or not, and e.g. smart pointers from C++11 or Boost can make existing code much safer (and more fun to work with for people who don't care/know too much about safety).

Hi Benjamin,

We were experiencing temporary problems with EC and that's why the website with the cling binaries was down.

I completely agree with you that the C++ world is moving on. We try to keep up and that's why we offer cling. Everybody wants these things to happen faster, but it's not easy :)

I am really looking forward to seeing your progress with Boost! That would be really interesting use case and topic. I hope, once you have it working, to share it with us (maybe a blog post or how to do it).


What happened to the SL5 build? It was there for the previous build.

Hi Bendjamin,

SL5 had an old gcc, which miscompiled LLVM.


Hi Danie,

Thanks for your question! We are waiting for clang to support the MSVC / Windows C++ ABI. Until then you can build and run cling in Windows in C mode, using cling -x c.

Cheers, Axel.