Having difficulty compiling cling-patches on linux

Hey Guys,

I’ve been following this guide for compiling on cling (root.cern.ch/cling-build-instructions) linux, however I haven’t have -any- luck doing so

I was able to clone the packages as expected, and checked them (llvm and clang) out to “cling-patches”. I made an out of source build in a folder called “build” and a “prefix” folder for the destination (in the same directory as src)

Running cmake had this output (cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/d4nf/cling/prefix/ …/src/
cmake initialization (out of source): bpaste.net/show/3db5a0d8ee9e

running “cmake --build . --config Release --target cling” failed immediately.
I’m not sure what I’m doing wrong. I’m having similar problems on centos 5 (with gcc 4.9) (same file, different error message, can’t post it right now though)

Any help would be appreciated.

Also, would anybody consider posting snapshots of the source code for cling/clang/llvm in the nightly build folder? (ecsft.cern.ch/dist/cling/)

Thanks in advance
p.s. if more information is needed, I’d be happy to provide


Something is wrong in the setup; CMake uses your clang from /usr/include/ instead of the local one.

Sorry - I never tried to build with clang in /usr/include; could you temporarily move this away? This looks like a CMake /CMakeLists.txt issue; we’d be happy to receive a patch from you!

Publishing nightly snapshots of cling’s sources is a great idea! I will do this - but it will take a few weeks.

Cheers, Axel.

Hey Axel,

I’ll see if i can cook up something, It might involve setting the CMAKE_PREFIX_PATH however, I bet that will spoil the party for all of the other system libraries that cmake probably depends on (don’t count on me succeeding!)

Anywho, I still have an error, this one is identical to the one I had in centos6 (i said 5, but i was wrong #-o )

After temporarily removing clang and llvm from my system, I ran the following again

cmake --build . --config Release --target cling Scanning dependencies of target clingUtils [ 0%] Building CXX object tools/cling/lib/Utils/CMakeFiles/clingUtils.dir/AST.cpp.o In file included from /home/d4nf/cling/src/tools/cling/../clang/include/clang/AST/ASTTypeTraits.h:19:0, from /home/d4nf/cling/src/tools/cling/../clang/include/clang/AST/ASTContext.h:18, from /home/d4nf/cling/src/tools/cling/lib/Utils/AST.cpp:12: /home/d4nf/cling/src/tools/cling/../clang/include/clang/AST/ASTFwd.h:22:35: fatal error: clang/AST/DeclNodes.inc: No such file or directory #include "clang/AST/DeclNodes.inc" ^ compilation terminated. tools/cling/lib/Utils/CMakeFiles/clingUtils.dir/build.make:62: 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:17595: 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:17731: 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

Is there something I’m still messing up on that I haven’t realized, or is this possibly a bug?


edit: here’s what’s in my AST directory: (bpaste.net/show/f6bbe8b26618)


You actually need to run CMake on llvm’s source directory, not just clings: we need to build llvm, clang and then cling. You skipped the first two; building only cling won’t work. Again - if you think you can fix the CMakeLists.txt to enable proper dependencies: your patch is very welcome!

Cheers, Axel.

Hi Axel

I got it to compile after running
cmake --build . --config Release --target clang
followed by

could you by any chance see if the guide could be updated so it could, at the very least, suggest that the installer would possibly need to run the first quoted line?

p.s. llvm isn’t a valid target

lurkers: in case if i fail to figure out how to mark this as solved, consider this issue solved

Thanks a lot, build instructions are updated!

Cheers, Axel.