You are here

cling goes public!

Hi,

We, the cling team, have announced cling, our C++ interpreter prototype! (note: its SVN repository has changed compared with the announcement email; see the build instructions)

To a large extend thanks to Vassil's impressive commitment, cling now behaves like a good C++ interpreter: it runs C++ code that's entered, and prints the results.

[cling]$ #include <cmath>
[cling]$ double x = std::sin(3.1)
(double) 4.158066e-02
[cling]$ .L libz
[cling]$ #include "zlib.h"
[cling]$ zlibVersion()
(const char * const) "1.2.3.4"
$ echo 'extern "C" const char* zlibVersion();
 zlibVersion()' | cling -lz

(const char * const) "1.2.3.4"

We have of course already added a few features that we liked from CINT - but cling is a completely new development, based on clang and llvm, a set of compiler libraries (to simplify the matter a bit :-) Vassil will present the innards of cling probably in October; I will post the slides here.

So what's special about cling? It's based on a production-grade compiler and it's designed taking decades of experience with CINT into account. And it doesn't need dictionaries! (Disclaimer: that does not mean that ROOT can do without, automatically. But that's our goal, of course.)

The next steps will be the ones most relevant for High Energy Physics: integration into ROOT (Paul is already working on that) and reloading of changed code (.x myCode.C, edit, .x myCode.C). That latter part is horrible for a compiler.

If you want to check cling out you can simply compile it yourself - it's really easy. I'd love to have an interactive, web-based interface once, but an online C++ interpreter is an invitation for script kiddies to hack the server :-( If you have an idea how to do it please let me know!

Cheers,
 

Comments

On MacOSX 10.6.8, on on llvm/clang svn r150068; on cling svn r43013, with the patch below to cling/lib/Interpreter/DynamicLookup.cpp:419 to get compilation, I'm getting a crash when I do "using namespace std".

$ ./cling
**** Welcome to the cling prototype! ****
* Type C code and press enter to run it *
* Type .q, exit or ctrl+D to quit       *
*****************************************
[cling]$ #include iostream   // NB: the html wouldnt let me send angle brackets around iostream, but they were there!
[cling]$ using namespace std;
Declaration name has no FETokenInfo
UNREACHABLE executed at DeclarationName.cpp:339!
Illegal instruction

$ cd ~/pkg/llvm-post-3.0-svn/llvm/tools/cling/lib/Interpreter

# patch previously mentioned... to get compilation.
$ svn diff
Index: DynamicLookup.cpp
===================================================================
--- DynamicLookup.cpp	(revision 43039)
+++ DynamicLookup.cpp	(working copy)
@@ -416,7 +416,7 @@
           // resolution of the constructors and then initializes the new
           // variable with it
 	  ExprResult InitExprResult 
-	    = m_Sema->ActOnParenListExpr(m_NoSLoc,
+	    = m_Sema->ActOnParenOrParenListExpr(m_NoSLoc,
 					 m_NoELoc,
 					 move_arg(Inits));
           m_Sema->AddInitializerToDecl(HandlerInstance,


...also the C++11 lambda feature doesn't seem to work; any clue why? (see below for example)

Thanks!

Jason

$  ./cling -Wc++11-extensions

**** Welcome to the cling prototype! ****
* Type C code and press enter to run it *
* Type .q, exit or ctrl+D to quit       *
*****************************************
[cling]$ #include 
[cling]$ using std::cout
[cling]$ auto func = [] () { cout << "Hello world"; };
input_line_6:2:2: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
 auto func = [] () { cout << "Hello world"; };
 ^
input_line_6:2:14: error: expected expression
 auto func = [] () { cout << "Hello world"; };
             ^
[cling]$ 

Hi Jason,

I have converted your comment into this bug report. Thanks! Note that it does work if you toggle to .rawInput for the using directive using namespace std; - but that's just a woraround.

The mismatch in DynamicLookup.cpp should get fixed later.

Cheers, Axel

A quick patch suggestion: Using what seemed to be the latest cling (svn 43039), and the llvm/clang svn r150068 named in LastKnownGoodLLVMSVNRevision.txt, I had to make the following change to the file cint/cling/lib/Interpreter/DynamicLookup.cpp in order to get compilation:

Regards,
Jason

svn diff

=====================
--- DynamicLookup.cpp   (revision 43039)
+++ DynamicLookup.cpp   (working copy)
@@ -416,7 +416,7 @@
           // resolution of the constructors and then initializes the new
           // variable with it
          ExprResult InitExprResult
-           = m_Sema->ActOnParenListExpr(m_NoSLoc,
+           = m_Sema->ActOnParenOrParenListExpr(m_NoSLoc,
                                         m_NoELoc,
                                         move_arg(Inits));
           m_Sema->AddInitializerToDecl(HandlerInstance,



svn info
Path: .
URL: http://root.cern.ch/svn/root/trunk/cint/cling/lib/Interpreter
Repository Root: http://root.cern.ch/svn/root
Repository UUID: 27541ba8-7e3a-0410-8455-c3a389f83636
Revision: 43039
Node Kind: directory
Schedule: normal
Last Changed Author: vvassilev
Last Changed Rev: 42986
Last Changed Date: 2012-02-13 13:20:45 -0600 (Mon, 13 Feb 2012)

Hi Jason,

Thanks to Vassil this is now fixed, including a proper llvm / clang revision number that works. Again, thanks for your report!

Cheers, Axel

I think cling multi-line mode could be less clever, enough to have the following: Enter - expression is fully entered Enter+Shift - expression will be continued in the next line Enter and Enter+Shift - used widely in editors so user is familiar with them

Hi Vladimir,

Thanks for your suggestion! Another option would be start editor-like behavior, where one moves up and down with the cursor keys, until one sends off the input using shift- or ctrl-enter. What do you think?

Note: this is just brainstorming - I'm not claiming that we have the time to implement it in 2012 :-) But if somebody is looking for something to contribute then this could be a nice extension!

Cheers, Axel

I think cling standalone is mainly for evaluating and studying cling before making decision to use it ? Everybody can wrap cling API with rich editor in some way. So, if I understand cling usage correctly, it could be simple as possible with intuitive commands that don't require long explanations so all set of available commands could be printed in the welcome part. Generally current set of commands seem OK, especially I like the last ";" - print/don't print results. There is only 1 problematic thing - multi-line mode, I think Enter / Enter+Shift is the simplest solution from usability point of view.

Hi Vladimir,

There are several possible modes of using the cling binary; for your context it's probably for evaluation. Yes, we need ".help". You do know that cling can run (.x) text files, too, right? For complex input that's usually what people do.

Just to remind you: we are building on almost two decades of experience with CINT, and it being used in production by tens of thousands of people. So when I say "people usually edit files" then that's the result of this experience :-) But that doesn't stop us from making fundamental changes, so who knows: if someone designs (with us) and contributed a nice multiline mode I wouldn't mind uploading it!

Cheers, Axel

Hi; I have just successfully compiled cline for x86 & ARM system and am trying to check some cases. one of the most unexpected behavior to me is that the cling can support only a line interpretation, then I can't use previous my programs.... for example ) if a file has a for loop with multiple line, it should be rewritten with a single line... it is very uncomfortable feature... is there any chance to fix it ?

Hi! I cannot reproduce that:

[cling]$ for(
[cling]$ ?   int i = 0;
[cling]$ ?   i < 2; ++i) {
[cling]$ ?   ;
[cling]$ ?   }
[cling]$ .q

Could you open a bug report here such that I can reproduce your issue? Cheers, Axel

Today I got llvm, clang and cling according the build instructions and tried to compile all in VS2008. All were enough smoothly excluding 1 compilation error in cling, DynamicLookup.cpp: method m_Sema->AddCXXDirectInitializerToDecl(...) is not defined in clang::Sema It's really not defined and seems the latest cling and clang sources are not synchronized ? How it can be fixed ? Thanks, Vladimir

Hi,

Keeping cling in sync with two repos is not an easy job :) I believe it is fixed now! Cheers, Vassil

Hi, I'm also trying to build Cling, getting this: llvm[2]: Linking Debug+Asserts executable cling /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to LLVMInitializeMBlazeAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializeSparcAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to LLVMInitializeXCoreAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializeARMAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to LLVMInitializeMipsAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializePTXAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to LLVMInitializeMSP430AsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializeCellSPUAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to LLVMInitializePowerPCAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializeHexagonAsmPrinter' collect2: ld returned 1 exit status make[2]: *** [/home/matt/dev/llvmbuild/Debug+Asserts/bin/cling] Error 1 make[2]: Leaving directory /home/matt/dev/llvmbuild/tools/cling/tools/driver' make[1]: *** [all] Error 1 make[1]: Leaving directory/home/matt/dev/llvmbuild/tools/cling/tools' Any ideas? Thanks!

Hi Matt,

You must configure with --enable-targets=host, else you will pull in all possible targets. As you are the second one reporting this we should probably work around that on the cling side...

Cheers, Axel.

Big Thanks ! It's fixed and can be compiled ! I think cling svn should contain compatible llvm and clang versions too for cases if cling temporarily not synchronized with them.

Hi Vladimir,

I prefer not to include llvm + clang in cling's repository. Instead cling now contains a file "LastKnownGoodLLVMSVNRevision.txt" which holds the highest revision number that is known to work. It gets updated by the Makefile, so there is a reasonable chance that this number stays relevant. Thanks for your suggestion!

Cheers, Axel

Hi Vladimir,

Thanks for your interest in cling! I would not recommend cling for running an airport. But if this is about e.g. a game - something where you control the consequences - then yes, I believe you can use cling as it is, in production. That's not so much because of cling but because of clang and llvm, which in turn are already used in production. Cling does not destroy them sufficiently to invalidate that :-)

There is one bug, though, that you would probably want to see fixed before you employ it: cling currently sometimes stumbles over the end of file token (or its incremental input) and crashes. I hope that this will get fixed in about four weeks.

I have never built cling on Windows 64bit, but it works nicely on Linux and MacOS 64bit. The biggest problem you might find is the Windows C++ ABI support that is to a large extent still missing in clang and thus in cling. If on Windows you restrain yourself to C you should be fine, though.

Cheers, Axel

Hi Axel, cling is really great, I a bit played with it. As you wrote cling sometimes stumbles and hangs and we should wait until it will be fixed. I put attention on the following things: 1. #include "windows.h" evaluated a bit slow 2. Class methods cannot be defined outside class declaration ? class A{public: A();}; A:A(){} Though the following is OK: A{public: A(){}};

Hi Vladimir,

Glad you like it! :-)

For out-of-class function definitions try the following:

.rawInput
class Foo { public: int f(); };
int Foo::f() { return 42.; }
.rawInput
Foo f;
f.f()

Regarding the slow loading of windows.h: you can see whether it helps to turn some of the interpreter extensions off. You can e.g. use the same .rawInput as above.

Otherwise try a release build - the debug builds of llvm / clang are said to be much slower. And: windows.h is as evil a header as they can get :-) Any compiler chokes on it for a while. You can try to precompile it (e.g. into a module if that already works sufficiently on Windows), that should speed things up.

Cheers, Axel

Additional question, can cling be used in multi-threading environment ? Thanks in advance, Vladimir

Hi Vladimir,

You will be able to use cling in multi-threaded environments. I am not sure whether you can pull it off right now, but it's almost no work. Let me explain what's needed and what you will get.

The only global ("static storage") part in cling / clang / llvm is the setup: default target etc. Once that is done (and this should be done before spawning threads) everything else can be thread local. So once you are behind the setup phase cling is as thread safe as STL: don't access it across threads without locking, but you can have multiple instances, e.g. several per thread.

What still needs to be done is to move the initialization into a separate step, something that you could call before spawning threads. Right now this happens during construction of the Interpreter object and is thus not thread safe.

Contributions are always welcome - you have the source! ;-)

Cheers, Axel

Hi Axel, Amazed by cling I also tried to build it from trunk. I think trunk did not worked (or am i wrong). Have my Apologies for non-Debug build (reasons, 1st:old hardware, 2nd:C and python-new to C++). I think for a while I will use cint, as my intention is to use it in c and C++ learning(oss works). Thank you all for this wonderfull project I think C++ with(out) compilatinon is very good for students. Here is a dump of my build. make[4]: Leaving directory /home/admn/myprojects/build/tools/cling/tools/libcling' make[4]: Entering directory/home/admn/myprojects/build/tools/cling/tools/driver' llvm[4]: Compiling cling.cpp for Release+Asserts build llvm[4]: Linking Release+Asserts executable cling (without symbols) /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to LLVMInitializeMBlazeAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializeSparcAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to LLVMInitializeXCoreAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializeARMAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to LLVMInitializeMipsAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializePTXAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to LLVMInitializeMSP430AsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializeCellSPUAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to LLVMInitializePowerPCAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializeHexagonAsmPrinter' collect2: ld returned 1 exit status make[4]: *** [/home/admn/myprojects/build/Release+Asserts/bin/cling] Error 1 make[4]: Leaving directory /home/admn/myprojects/build/tools/cling/tools/driver' make[3]: *** [all] Error 1 make[3]: Leaving directory/home/admn/myprojects/build/tools/cling/tools' make[2]: *** [all] Error 1 make[2]: Leaving directory /home/admn/myprojects/build/tools/cling' make[3]: *** [all] Error 1 make[1]: Leaving directory/home/admn/myprojects/build/tools' make: *** [all] Error 1 admn@ubuntu:~/myprojects/build$

Hi James,

Thanks for your nice comment!

You were requesting all possible targets; just (also) pass --enable-targets=host to llvm's configure and it will work!

Cheers, Axel.

I'm really excited about cling... been wondering when someone would use llvm/clang to build an interpreter and here it is! Thanks for all the hard work... this should really help speed up C++ development for me. I thought I'd take it for a spin, but I'm running into build issues. Thanks to a few of the comments further down the page, I noticed that the location of the cling trunk got changed from what's listed on the build instructions page (would be nice to update this). Using the new location got rid of all of my errors but one:

Undefined symbols for architecture x86_64:
  "llvm::sys::DynamicLibrary::LoadLibraryPermanently(char const*, std::string*)", referenced from:
     -exported_symbol[s_list] command line option

I'm on Mac OS X, using the latest (trunk) versions of the llvm, clang, and cling source. Trying to do a Release+Asserts build... Any idea what the issue is here? Thanks again!

Hi Dan,

Thanks for your positive feedback! You probably used the old SVN location instead of https://root.cern.ch/svn/root/trunk/cint/cling. I have updated the web pages, sorry about that.

WIth the current svn version of clang and LLVM, cling build for me just fine (also on Mac).

Cheers, Axel.

Hi Axel, Thanks for the reply. It turns out the issue was that I was trying to do a Release build (passing "--enable-optimized" to configure)... since I don't plan on doing any hacking on cling (yet? :-) I thought this seemed appropriate, but the aforementioned error occurs. Doing a regular Debug build is error free for me. This seems like a bug, so I thought I'd let you know. Thanks! Dan

Hi Dan,

Thanks for your comment! That makes perfect sense - we all build in debug mode all the time. These symbol exports are super fragile - platform specific, and as you show even influenced by the optimizer :-( Probably the only way to fix this is by creating a variable in libcling's dummy.cxx and assigning the address of llvm::sys::DynamicLibrary::LoadLibraryPermanently to it...

We do build in optimized mode once a while, to do performance measurements. I'll make sure we then fix this bug!

Cheers, Axel.

Hi axel, I am a c++ user, found cling incidentally. I'd like to say it is an amazing project. I always think that is almost impossible to build a good C++ interpreter. But you really did it. I am really interested in that project, and expecting the future of it. It is a pity that I don't have further document about how to use that interactive interpreter, I can just try some syntax you had mentioned in the slide(and the video). Is there more examples in ROOT?

Hi yoco,

Thanks for trying it out.

You can find documentation in CLING_SRC_FOLDER/www/. It's work in progress but I think it's better than nothing. Vassil

Hi yoco!

Thanks for your comment! We, too, find cling amazing - also because we know from experience how difficult interpreting C++ is.

Regarding your question on how to use it: well, it's an interactive C++ interpreter. You type C++, it gets run, you see the trailing expression's value if you don't put the terminal ';'. There are a few shortcuts: .x MyCode.cxx(12) will load the file MyCode.cxx and call MyCode(12). .L mylib loads mylib.so. But that's basically it - it just understands all of C++.

We can definitely write something up within the cling pages. What exactly are you looking for? An extended version of the information I wrote here, basically a user manual?

Cheers, Axel

Greetings, I am trying to build cling on Mac 10.7.1 and I get the following error: llvm[5]: Compiling TextInputContext.cpp for Debug+Asserts build llvm[5]: Building Debug+Asserts Archive Library libclingUITextInput.a ranlib: file: /Users/rovitotv/MatPlusPlus/build/Debug+Asserts/lib/libclingUITextInput.a(StreamReaderWin.o) has no symbols ranlib: file: /Users/rovitotv/MatPlusPlus/build/Debug+Asserts/lib/libclingUITextInput.a(TerminalDisplayWin.o) has no symbols llvm[4]: Compiling Dummy.cpp for Debug+Asserts build (PIC) llvm[4]: Linking Debug+Asserts Shared Library libcling.dylib Undefined symbols for architecture x86_64: "clang::CompilerInstance::createDiagnostics(clang::DiagnosticOptions const&, int, char const* const*, clang::DiagnosticClient*, clang::CodeGenOptions const*)", referenced from: -exported_symbol[s_list] command line option "clang::FileManager::getFile(llvm::StringRef, bool)", referenced from: -exported_symbol[s_list] command line option (maybe you meant: clang::FileManager::getFile(llvm::StringRef, bool, bool)) ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make[4]: *** [/Users/rovitotv/MatPlusPlus/build/Debug+Asserts/lib/libcling.dylib] Error 1 make[3]: *** [all] Error 1 make[2]: *** [all] Error 1 make[1]: *** [all] Error 1 make: *** [all] Error 1 This is using the latest trunk from llvm and clang. Thanks for the support this looks like an interesting project.

Hi Todd,

Thanks for your question! Yes, cling does build on the Mac. Usually! It's now fixed again, thanks for reporting!

Cheers, Axel

Hi, Thanks for the update on this interesting project. I tried to build the latest trunks of llvm (Rev:141174), clang (Rev:141171), cling (Rev:41120) on Darwin 10.8.0 and came across the following problem:

llvm[4]: Linking Debug+Asserts Shared Library libcling.dylib Undefined symbols: "clang::Diagnostic::~Diagnostic()", referenced from: -exported_symbol[s_list] command line option "clang::BuiltinType::getName(clang::LangOptions const&) const", referenced from: -exported_symbol[s_list] command line option "clang::CompilerInvocation::CreateFromArgs(clang::CompilerInvocation&, char const* const*, char const* const*, clang::Diagnostic&)", referenced from: -exported_symbol[s_list] command line option "clang::CreateLLVMCodeGen(clang::Diagnostic&, std::basic_string, std::allocator > const&, clang::CodeGenOptions const&, llvm::LLVMContext&)", referenced from: -exported_symbol[s_list] command line option "clang::ASTReader::getOriginalSourceFile(std::basic_string, std::allocator > const&, clang::FileManager&, clang::Diagnostic&)", referenced from: -exported_symbol[s_list] command line option ld: symbol(s) not found collect2: ld returned 1 exit status

Any thoughts of what can be wrong? Cheers, Karolos

Hi Karolos,

Thanks for reporting! This is now fixed. But cling has moved (we'll update the web page); it's now at svn co http://root.cern.ch/svn/root/trunk/cint/cling - you will find the update there.

Cheers, Axel.

Regarding on-line availability -- perhaps you can contact ideone -- http://www.ideone.com/about -- for security & deployment tips? // Ideone allows to "run your code on server side in more than 40 programming languages (number still growing)"

Hi MD

Thanks a lot for your comment! I did not know that site. You are right, they must be doing exactly what we need.

Would you (or someone else) be interested in creating a PHP or whatever setup that can interface with cling?I will then take care of the protections - now that I know who to ask :-)

Cheers, Axel

Hi Alex! I'm not much into web-development nowadays, but perhaps you could go and ask the IDEone guys whether they'd be willing to add cling as a feature on their end? Since they already have the existing infrastructure and two C++ compilers so far (gcc-4.3.4 and gcc-4.5.1 (C++0x)), perhaps it's not much of a stretch (and would certainly bring exposure and testing that goes with it) -- and if the interpreter would lower the loads on their server for the cases when it suffices over a compiler, this could be a win-win. Good luck!

Hi MD,

Thanks for your suggestion! Will do; let's see what they say! Interpreters are stateful (and so the web server would need to keep the connection open etc) while compilers are not - but let's see, maybe we can come up with something.

Cheers, Axel

Hi Axel, thanks for so much useful information on your blog, i am learning a lot with them. What exactly do you mean with "But that's our goal, of course" when you talk about cling not needing dictionaries. Does this mean I will not need rootcint to generate the dictionaries in future versions? Would there be any change in defining a class with ClassDef and ClassImp? How serialization of C++ object will be handled? I do not understand very well how all these work toguether in root so it would be nice to have some hints from you. Many thanks Marcelo

Hi Marcelo,

Thanks a lot for the flowers! And you've asked some excellent questions. I think the answers actually warrant a separate blog entry: it's interesting and magic enough, and I know several people out there always wondered what these dictionaries are.

Sorry to make you wait, but not for long: I'll be on a workshop next week, a good moment for that new post :-)

Cheers, Axel.

hi, great! but perhaps one should mention it needs a trunk version of llvm/clang to build ? at least, it does not seem to build cleanly against llvm/clang-2.9:

[ 8%] Building CXX object lib/Interpreter/CMakeFiles/clingInterpreter.dir/ChainedConsumer.cpp.o

cling-svn/lib/Interpreter/ChainedConsumer.cpp: In member function ‘virtual void cling::ChainedMutationListener::AddedCXXTemplateSpecialization(const clang::FunctionTemplateDecl*, const clang::FunctionDecl)’: cling-svn/src/cling-svn/lib/Interpreter/ChainedConsumer.cpp:169:59: error: no matching function for call to ‘clang::ASTMutationListener::AddedCXXTemplateSpecialization(const clang::FunctionTemplateDecl&, const clang::FunctionDecl*&)’

cling-svn/lib/Interpreter/ChainedConsumer.cpp:169:59: note: candidate is: /usr/include/clang/AST/ASTMutationListener.h:42:16: note: virtual void clang::ASTMutationListener::AddedCXXTemplateSpecialization(const clang::ClassTemplateDecl*, const clang::ClassTemplateSpecializationDecl) /usr/include/clang/AST/ASTMutationListener.h:42:16: note: no known conversion for argument 1 from ‘const clang::FunctionTemplateDecl’ to ‘const clang::ClassTemplateDecl*’

cling-svn/lib/Interpreter/ChainedConsumer.cpp: In member function ‘virtual void cling::ChainedMutationListener::CompletedImplicitDefinition(const clang::FunctionDecl*)’: cling-svn/lib/Interpreter/ChainedConsumer.cpp:174:23: error: ‘class clang::ASTMutationListener’ has no member named ‘CompletedImplicitDefinition’

cling-svn/lib/Interpreter/ChainedConsumer.cpp: In member function ‘virtual void cling::ChainedMutationListener::StaticDataMemberInstantiated(const clang::VarDecl*)’: cling-svn/lib/Interpreter/ChainedConsumer.cpp:179:23: error: ‘class clang::ASTMutationListener’ has no member named ‘StaticDataMemberInstantiated’ make[2]: *** [lib/Interpreter/CMakeFiles/clingInterpreter.dir/ChainedConsumer.cpp.o] Error 1 make[1]: *** [lib/Interpreter/CMakeFiles/clingInterpreter.dir/all] Error 2 make: *** [all] Error 2

-s

Hi Sebastian,

Thanks for your comment! Yes, in good ROOT spirit, the trunk is the best. There are still constant changes in clang and llvm, so please use the trunk. I'll update the web page accordingly.

Thanks for trying it out!

Cheers, Axel.

Hi Axel,

thanks for your blog.

I also tried to compile but figured out that some interfaces in clang changed between your post and my reading/trials. I already wasted It took me one day to find a (not properly) working combination of revisions in SVN and to hack into cling and clang ;-)

Now I managed to build cling with clang/llvm and it (kind of) works standalone - but then I could not get it up and running with root (neither compiling with clang nor gcc) :-(

Could you please give your working combination of SVN revision numbers for LLVM, clang and cling to get me (and maybe others) started?

Thanks&bests, Daniel

Hi Daniel,

You just did one of the first few bug reports on cling! ;-) Apologies, with Vassil having been on vacation and me being at a workshop, cling wasn't updated to clang's changes for a while. It now is, i.e. the trunk works again.

If the trunk ever doesn't work then it's a bug. Please complain and we'll fix it. Thanks for test driving it!

Cheers, Axel

Is there any progress to support Windows x64 ?
Clang already understands Windows headers ...

We have been focusing on 32bit first (for ROOT); that's getting closer to production grade now. If you want to help with Win64 please submit pull requests, they are definitely welcome!

Cheers, Axel.

Pages