Building ROOT with cling

I saw that cling is available and hoped it would be easier to use than cint.
I downloaded and finally compiled and installed llvm and clang, using the tgz tar ball for llvm 2.9
I downloaded using svn cling and placed it in the llvm/tools director before compiling. The patches did not work, leaving lldb unfound.

cling did not compile. Since I discovered svn for Windows 32, I downloaded the trunk of ROOT on Monday, 31 OCT about 4:30 PM New York time (I don’t know how to discover trunk number).

I had received this warning the first time I tried to compile and received it again. Missing mousepad in XFCE did not allow me to copy/paste the new error, but it is the same as the first time.

I am using Fedora 14 default installation on a Pentium III.

g++ -O2 -pipe -m32 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -pthread -I/usr/local/include -DNDEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fomit-frame-pointer -fPIC -Woverloaded-virtual -Wcast-qual -I/home/unk/root/cint/cling/include ‘-DR__LLVMDIR="/usr/local"’ -Wno-shadow -Wno-unused-parameter -o core/meta/src/TCintWithCling.o -c /home/unk/root/core/meta/src/TCintWithCling.cxx
/home/unk/root/core/meta/src/TCintWithCling.cxx: In constructor ˜TCintWithCling::TCintWithCling(const char*, const char*):
/home/unk/root/core/meta/src/TCintWithCling.cxx:144:48: error: ˜class clang::HeaderSearch has no member named ˜configureModules
make: *** [core/meta/src/TCintWithCling.o] Error 1

This first time I did not use --build=debug, second time I did.

Should I just wait a couple weeks for cling in the ROOT tar ball and llvm 3.0?

Trying to add some information about this.

Last night I recomplied and installed llvm and clang. The /usr/local/bin ls then indicated 5 NOV, so that worked.

If I change directries to …/llvm-2.9/tools/cling and issue make, I get this:

[root@localhost cling]# make
make[1]: Entering directory /home/unk/llvm-2.9/tools/cling/include' make[2]: Entering directory/home/unk/llvm-2.9/tools/cling/include/cling’
make[2]: Nothing to be done for all'. make[2]: Leaving directory/home/unk/llvm-2.9/tools/cling/include/cling’
make[1]: Leaving directory /home/unk/llvm-2.9/tools/cling/include' make[1]: Entering directory/home/unk/llvm-2.9/tools/cling/lib’
make[2]: Entering directory /home/unk/llvm-2.9/tools/cling/lib/Interpreter' llvm[2]: Compiling ASTDumper.cpp for Release build ASTDumper.cpp: In member function ‘void cling::ASTDumper::HandleTopLevelSingleDecl(clang::Decl*)’: ASTDumper.cpp:25:48: error: ‘class clang::ASTContext’ has no member named ‘getPrintingPolicy’ make[2]: *** [/home/dbrunk/llvm-2.9/tools/cling/lib/Interpreter/Release/ASTDumper.o] Error 1 make[2]: Leaving directory/home/unk/llvm-2.9/tools/cling/lib/Interpreter’
make[1]: *** [Interpreter/.makeall] Error 2
make[1]: Leaving directory `/home/unk/llvm-2.9/tools/cling/lib’
make: *** [all] Error 1

The patch from …/llvm-2.9/tools results in the formation of a file “Makefile.rej”

The contents of the patch rejections

[root@localhost tools]# more Makefile.reg
Makefile.reg: No such file or directory
[root@localhost tools]# more Makefile.rej
— tools/Makefile (revision 135054)
+++ tools/Makefile (working copy)
@@ -14,7 +14,7 @@

Build LLDB if present. Note LLDB must be built last as it depends on the

wider LLVM infrastructure (including Clang).

+OPTIONAL_DIRS := lldb cling

NOTE: The tools are organized into five groups of four consisting of one

large and three small executables. This is done to minimize memory load

I attempted to rebuild ROOT and received the same error as above.


Do you still have the error with the trunk of cling (which has been moved to ?



I have been loaned now an Asus Eee, running Windows XP. I installed on a partition Scientific Linux 6.1 and added all the libX?? to compile ROOT. I also downloaded and compiled the new llvm 3.0 and clang 3.0 from 1 December release.

Now configure cannot find llvm/clang. I read ./configure --help and saw that I need to include


and assumed that I was to append
I tried that with and without a final / and still no luck.
This is with the lastest ROOT source tar ball release.

I know this has to be a stupid error, but I cannot try enough ways to have ./configure find the include files.

In the /usr/local/include directory is an llvm configure directory. I assume everything compiled and installed correctly.

And now I see the trunk number is listed as I start ROOT.


I finally figured out that I had not put --enable-cling on the ./configure.

Sorry. But after a lot of compilation, it stopped with this error. I’m pasting two stanzas of compiler output to help identify where the problem occured:

bin/rmkdepend -R -fcint/cling/lib/Interpreter/IncrementalParser.d -Y -w 1000 – -pipe -m32 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -pthread -I/usr/local/include -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -I/opt/root/cint/cling/include ‘-DR__LLVMDIR="/usr/local"’ -D__cplusplus – /opt/root/cint/cling/lib/Interpreter/IncrementalParser.cpp
g++ -O2 -I/usr/local/include -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -I/opt/root/cint/cling/include ‘-DR__LLVMDIR="/usr/local"’ -o cint/cling/lib/Interpreter/IncrementalParser.o -c /opt/root/cint/cling/lib/Interpreter/IncrementalParser.cpp
/opt/root/cint/cling/lib/Interpreter/IncrementalParser.cpp: In member function ‘cling::IncrementalParser::EParseResult cling::IncrementalParser::Parse(llvm::StringRef)’:
/opt/root/cint/cling/lib/Interpreter/IncrementalParser.cpp:290: error: no matching function for call to ‘clang::SourceManager::createFileIDForMemBuffer(llvm::MemoryBuffer*&, int, int, clang::SourceLocation&)’
/usr/local/include/clang/Basic/SourceManager.h:643: note: candidates are: clang::FileID clang::SourceManager::createFileIDForMemBuffer(const llvm::MemoryBuffer*, int, unsigned int)
make: *** [cint/cling/lib/Interpreter/IncrementalParser.o] Error 1
[root@localhost root]#

So much closer than before.


Both cling and clang are moving target. At the moment you most often need both the trunk of root/cling and llvm/clang to properly build.