Build v0.3 failed on debian-testing (stretch)
Hello! I've been struggling with building cling from source for a while before I finally got a working solution.
I tried to fetch proposed versions for llvm, clang and cling (using cpt.py script as the manual suggested) but then a compilation process would fail with the following error:
Scanning dependencies of target obj.clingInterpreter
[ 69%] Building CXX object tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/AutoSynthesizer.cpp.o
[ 69%] Building CXX object tools/bugpoint/CMakeFiles/bugpoint.dir/ToolRunner.cpp.o
[ 69%] Building CXX object tools/bugpoint/CMakeFiles/bugpoint.dir/bugpoint.cpp.o
[ 69%] Building CXX object tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/AutoloadCallback.cpp.o
[ 69%] Linking CXX executable ../../bin/bugpoint
[ 69%] Built target bugpoint
Scanning dependencies of target obj.clingMetaProcessor
[ 69%] Building CXX object tools/cling/lib/MetaProcessor/CMakeFiles/obj.clingMetaProcessor.dir/Display.cpp.o
In file included from /home/lightn/src/cling/cling-src-master/cling-src/tools/cling/lib/Interpreter/AutoloadCallback.cpp:28:0:
/home/lightn/src/cling/cling-src-master/cling-src/tools/cling/lib/Interpreter/DeclUnloader.h:277:16: error: ‘DeclUnloader’ is already declared in this scope
using clang::DeclUnloader;
^~~~~~~~~~~~
[ 69%] Building CXX object tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/ASTTransformer.cpp.o
tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/build.make:90: recipe for target 'tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/AutoloadCallback.cpp.o' failed
make[2]: *** [tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/AutoloadCallback.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 69%] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86InstrInfo.cpp.o
CMakeFiles/Makefile2:36057: recipe for target 'tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all' failed
make[1]: *** [tools/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Same issue mentioned here #131
Building environment
-- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 All deps are resolved
dpkg-query showed the same
llvm HEAD is on cling-patches-r274612 tag
clang repo's HEAD is on cling-patches-r274612 tag
cling HEAD is on v0.3 tag
Quick fix
I've given quite a thought before arriving to the final solution, my assumption was that there was an issue with a newer gcc compiler that debian testing had. I inspected the header file that the compiler was complaining about and did what FIXME suggested, it didn't work though.
Then I found out that this commit already contains all the necessary changes in a codebase, so
git checkout e1854092b5319b530ce763514b190ff91a2f28bd
And voila, this time it has compiled. I also had to remove following lines:
def init_io(self):
# disable io forwarding
pass
from ......./tools/cling/tools/Jupyter/kernel/clingkernel.py to make jupyter happy
Master issues
Current master compiles and even works for a while but then the kernel starts crashing almost inevitably on every cell call. Shall I create a separate issue for that? I got some idea what's going wrong there, but I might need your guidance to fix it / discuss a solution.
Hm, I am confused. #131 discovered a problem in our release procedure. We are not tagging the patched versions of clang and llvm.
I think the only way to go is to use a specific hash (as you mentioned) of clang or to use the master.
Could you elaborate what's wrong with the using the master and the jupyter kernel?