Axel Naumann on
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
Submitted by Anonymous (not verified) on Fri, 02/17/2012 - 14:57 Permalink
"using namespace std" and c++11 lambdas don't work?
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".
...also the C++11 lambda feature doesn't seem to work; any clue why? (see below for example)
Thanks!
Jason
Submitted by Anonymous (not verified) on Fri, 02/17/2012 - 14:57 Permalink
Re: using namespace std
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 directiveusing namespace std;
- but that's just a woraround.The mismatch in DynamicLookup.cpp should get fixed later.
Cheers, Axel
Submitted by Anonymous (not verified) on Fri, 02/17/2012 - 03:10 Permalink
small adjustment needed to compile DynamicLookup.cpp
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
Submitted by Anonymous (not verified) on Fri, 02/17/2012 - 18:39 Permalink
Re: trunk
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
Submitted by Anonymous (not verified) on Wed, 02/15/2012 - 13:00 Permalink
Multi-line mode
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
Submitted by Anonymous (not verified) on Wed, 02/15/2012 - 14:59 Permalink
Re: multi-line mode
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
Submitted by Anonymous (not verified) on Thu, 02/16/2012 - 08:24 Permalink
I think cling standalone is
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.
Submitted by Anonymous (not verified) on Thu, 02/16/2012 - 14:46 Permalink
re: cling binary
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
Submitted by Anonymous (not verified) on Mon, 06/03/2013 - 22:01 Permalink
how to handle a context which has multi lines
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 ?
Submitted by Anonymous (not verified) on Thu, 06/06/2013 - 11:31 Permalink
Re: multi-line input
Hi! I cannot reproduce that:
Could you open a bug report here such that I can reproduce your issue? Cheers, Axel
Submitted by Anonymous (not verified) on Mon, 02/13/2012 - 17:01 Permalink
cling compilation error
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
Submitted by Anonymous (not verified) on Mon, 02/13/2012 - 20:27 Permalink
Cling Compilation
Hi,
Keeping cling in sync with two repos is not an easy job :) I believe it is fixed now! Cheers, Vassil
Submitted by Anonymous (not verified) on Wed, 02/15/2012 - 20:46 Permalink
cling compile 2 days later ;)
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 to
LLVMInitializeSparcAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializeXCoreAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to
LLVMInitializeARMAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializeMipsAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to
LLVMInitializePTXAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializeMSP430AsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to
LLVMInitializeCellSPUAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference toLLVMInitializePowerPCAsmPrinter' /home/matt/dev/llvmbuild/Debug+Asserts/lib/libcling.so: undefined reference to
LLVMInitializeHexagonAsmPrinter' 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!Submitted by Anonymous (not verified) on Thu, 02/16/2012 - 14:39 Permalink
Re: targets=host!
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.
Submitted by Anonymous (not verified) on Wed, 02/15/2012 - 10:10 Permalink
Big Thanks ! It's fixed and
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.
Submitted by Anonymous (not verified) on Wed, 02/15/2012 - 14:54 Permalink
Re: last good revsision
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
Submitted by Anonymous (not verified) on Sat, 02/11/2012 - 17:40 Permalink
Is cling stable enough to be used in production application ?
Hello, I'm searching a suitable scripting engine for a production application, what's status of cling, is it enough stable for this ? Can it be embedded into a Windows x64 application ? Thanks, Vladimir
Submitted by Anonymous (not verified) on Mon, 02/13/2012 - 17:12 Permalink
Re: cling @ Windows, cling @ production
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
Submitted by Anonymous (not verified) on Wed, 02/15/2012 - 10:27 Permalink
Hi Axel, cling is really
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(){}};
Submitted by Anonymous (not verified) on Wed, 02/15/2012 - 12:05 Permalink
Re: secret cling hacks!
Hi Vladimir,
Glad you like it! :-)
For out-of-class function definitions try the following:
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
Submitted by Anonymous (not verified) on Sun, 02/12/2012 - 14:54 Permalink
Additional question
Additional question, can cling be used in multi-threading environment ? Thanks in advance, Vladimir
Submitted by Anonymous (not verified) on Mon, 02/13/2012 - 17:18 Permalink
Re: cling-mt
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
Submitted by Anonymous (not verified) on Tue, 02/07/2012 - 09:50 Permalink
The trunk did not worked as on 6Feb2012(not varified)
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 toLLVMInitializeMBlazeAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to
LLVMInitializeSparcAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializeXCoreAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to
LLVMInitializeARMAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializeMipsAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to
LLVMInitializePTXAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializeMSP430AsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to
LLVMInitializeCellSPUAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference toLLVMInitializePowerPCAsmPrinter' /home/admn/myprojects/build/Release+Asserts/lib/libcling.so: undefined reference to
LLVMInitializeHexagonAsmPrinter' 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$Submitted by Anonymous (not verified) on Wed, 02/08/2012 - 11:26 Permalink
Re: Unresolved symbol in trunk
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.
Submitted by Anonymous (not verified) on Sun, 10/23/2011 - 08:43 Permalink
Build Issue
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:
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!
Submitted by Anonymous (not verified) on Mon, 10/24/2011 - 09:46 Permalink
Re: Build Issue
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.
Submitted by Anonymous (not verified) on Mon, 10/24/2011 - 11:59 Permalink
Hi Axel, Thanks for the reply
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
Submitted by Anonymous (not verified) on Mon, 11/14/2011 - 18:02 Permalink
Optimized cling
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.
Submitted by Anonymous (not verified) on Sat, 10/22/2011 - 17:12 Permalink
Just want to say thank you
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?
Submitted by Anonymous (not verified) on Sun, 11/06/2011 - 11:03 Permalink
Documentation
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
Submitted by Anonymous (not verified) on Sat, 10/22/2011 - 23:00 Permalink
How to use cling
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
Submitted by Anonymous (not verified) on Thu, 09/15/2011 - 04:33 Permalink
Does cling build on mac?
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.
Submitted by Anonymous (not verified) on Mon, 09/19/2011 - 16:32 Permalink
cling @ Mac
Hi Todd,
Thanks for your question! Yes, cling does build on the Mac. Usually! It's now fixed again, thanks for reporting!
Cheers, Axel
Submitted by Anonymous (not verified) on Wed, 10/05/2011 - 15:58 Permalink
Hi, Thanks for the update on
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
Submitted by Anonymous (not verified) on Wed, 10/19/2011 - 15:43 Permalink
Missing exports
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.
Submitted by Anonymous (not verified) on Sat, 09/03/2011 - 18:30 Permalink
Regarding on-line
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)"
Submitted by Anonymous (not verified) on Sun, 09/04/2011 - 11:58 Permalink
Thanks!
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
Submitted by Anonymous (not verified) on Mon, 09/12/2011 - 02:51 Permalink
Hi Alex! I'm not much into
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!
Submitted by Anonymous (not verified) on Wed, 09/14/2011 - 15:12 Permalink
IDEone
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
Submitted by Anonymous (not verified) on Fri, 09/02/2011 - 15:24 Permalink
Hi Axel, thanks for so much
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
Submitted by Anonymous (not verified) on Fri, 09/02/2011 - 21:09 Permalink
Excellent Questions!
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.
Submitted by Anonymous (not verified) on Thu, 09/01/2011 - 14:12 Permalink
hi, great! but perhaps one
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
Submitted by Anonymous (not verified) on Fri, 09/02/2011 - 11:41 Permalink
clang trunk
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.
Submitted by Anonymous (not verified) on Tue, 09/06/2011 - 17:20 Permalink
Working revision combination
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
Submitted by Anonymous (not verified) on Wed, 09/07/2011 - 11:58 Permalink
Trunk!
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
Submitted by Vladimir (not verified) on Mon, 03/05/2018 - 16:23 Permalink
Cling Windows x64 support
Is there any progress to support Windows x64 ?
Clang already understands Windows headers ...
Submitted by Axel Naumann on Fri, 06/15/2018 - 14:45 Permalink
Re: Cling Windows x64 support
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