Hi everyone, I need again your help
I’m making a project that uses both GLUT and ROOT and compiling with CMake. The compilation seems to go well, but as I execute the file I get this error:
Error in <UnknownClass::InitInterpreter()>: LLVM SYMBOLS ARE EXPOSED TO CLING! This will cause problems; please hide them or dlopen() them after the call to TROOT::InitInterpreter()!
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
Thread 2 (Thread 0x7f92561e3700 (LWP 6802)):
#0 pthread_cond_wait
GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x00007f925a5d352b in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_dri.so
#2 0x00007f925a5d3257 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_dri.so
#3 0x00007f925fa9e6da in start_thread (arg=0x7f92561e3700) at pthread_create.c:456
#4 0x00007f925f7d817f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 1 (Thread 0x7f9261f95ac0 (LWP 6801)):
#0 0x00007f925f79c4aa in __GI___waitpid (pid=6816, stat_loc=stat_loc
entry=0x7ffc7c6e0640, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1 0x00007f925f7152cb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2 0x00007f9261a31999 in TUnixSystem::StackTrace() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#3 0x00007f9261a3405c in TUnixSystem::DispatchSignals(ESignals) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#4 <signal handler called>
#5 0x00007f9257003a82 in llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#6 0x00007f925700635c in llvm::PMTopLevelManager::schedulePass(llvm::Pass*) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#7 0x00007f92543c6708 in addPassesToGenerateCode(llvm::LLVMTargetMachine*, llvm::legacy::PassManagerBase&, bool, void const*, void const*, void const*, llvm::MachineFunctionInitializer*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#8 0x00007f92543c6cb5 in llvm::LLVMTargetMachine::addPassesToEmitMC(llvm::legacy::PassManagerBase&, llvm::MCContext*&, llvm::raw_pwrite_stream&, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#9 0x00007f9257de9d1a in std::_Function_handler<llvm::object::OwningBinary<llvm::object::ObjectFile> (llvm::Module&), llvm::orc::SimpleCompiler>::_M_invoke(std::_Any_data const&, llvm::Module&) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#10 0x00007f925316ad88 in llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer> >::EmissionDeferredSetImpl<std::vector<llvm::Module*, std::allocator<llvm::Module*> >, std::unique_ptr<cling::Azog, std::default_delete<cling::Azog> >, std::unique_ptr<llvm::orc::LambdaResolver<cling::IncrementalJIT::addModules(std::vector<llvm::Module*, std::allocator<llvm::Module*> >&&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}, cling::IncrementalJIT::addModules(std::vector<llvm::Module*, std::allocator<llvm::Module*> >&&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}>, std::default_delete<{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}> > >::emitToBaseLayer(llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer>&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#11 0x00007f925316c2c8 in std::_Function_handler<unsigned long (), llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer> >::EmissionDeferredSet::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer>&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#12 0x00007f9253155bf5 in cling::IncrementalExecutor::runStaticInitializersOnce(cling::Transaction const&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#13 0x00007f92531335c3 in cling::Interpreter::executeTransaction(cling::Transaction&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#14 0x00007f92531d4b6e in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*> > >&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#15 0x00007f9253134223 in cling::Interpreter::Interpreter(int, char const* const*, char const*, bool, cling::Interpreter const*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#16 0x00007f92530b1dd3 in TCling::TCling(char const*, char const*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#17 0x00007f92530b2dee in CreateInterpreter () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#18 0x00007f9261978a4e in TROOT::InitInterpreter() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#19 0x00007f9261978d66 in ROOT::Internal::GetROOT2() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#20 0x00007f9261a089a5 in TInterpreter::Instance() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#21 0x00007f926195fa9c in TSystem::GetLibraries(char const*, char const*, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#22 0x00007f926196332e in TSystem::Load(char const*, char const*, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#23 0x00007f926197648a in ROOT::EnableThreadSafety() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#24 0x00005556f9442004 in main ()
===========================================================
The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum.
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5 0x00007f9257003a82 in llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#6 0x00007f925700635c in llvm::PMTopLevelManager::schedulePass(llvm::Pass*) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#7 0x00007f92543c6708 in addPassesToGenerateCode(llvm::LLVMTargetMachine*, llvm::legacy::PassManagerBase&, bool, void const*, void const*, void const*, llvm::MachineFunctionInitializer*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#8 0x00007f92543c6cb5 in llvm::LLVMTargetMachine::addPassesToEmitMC(llvm::legacy::PassManagerBase&, llvm::MCContext*&, llvm::raw_pwrite_stream&, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#9 0x00007f9257de9d1a in std::_Function_handler<llvm::object::OwningBinary<llvm::object::ObjectFile> (llvm::Module&), llvm::orc::SimpleCompiler>::_M_invoke(std::_Any_data const&, llvm::Module&) () from /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1
#10 0x00007f925316ad88 in llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer> >::EmissionDeferredSetImpl<std::vector<llvm::Module*, std::allocator<llvm::Module*> >, std::unique_ptr<cling::Azog, std::default_delete<cling::Azog> >, std::unique_ptr<llvm::orc::LambdaResolver<cling::IncrementalJIT::addModules(std::vector<llvm::Module*, std::allocator<llvm::Module*> >&&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}, cling::IncrementalJIT::addModules(std::vector<llvm::Module*, std::allocator<llvm::Module*> >&&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}>, std::default_delete<{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#2}> > >::emitToBaseLayer(llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer>&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#11 0x00007f925316c2c8 in std::_Function_handler<unsigned long (), llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer> >::EmissionDeferredSet::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer>&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#12 0x00007f9253155bf5 in cling::IncrementalExecutor::runStaticInitializersOnce(cling::Transaction const&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#13 0x00007f92531335c3 in cling::Interpreter::executeTransaction(cling::Transaction&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#14 0x00007f92531d4b6e in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*> > >&) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#15 0x00007f9253134223 in cling::Interpreter::Interpreter(int, char const* const*, char const*, bool, cling::Interpreter const*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#16 0x00007f92530b1dd3 in TCling::TCling(char const*, char const*) () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#17 0x00007f92530b2dee in CreateInterpreter () from /home/matteo/Downloads/root-6.08.06//lib/libCling.so
#18 0x00007f9261978a4e in TROOT::InitInterpreter() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#19 0x00007f9261978d66 in ROOT::Internal::GetROOT2() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#20 0x00007f9261a089a5 in TInterpreter::Instance() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#21 0x00007f926195fa9c in TSystem::GetLibraries(char const*, char const*, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#22 0x00007f926196332e in TSystem::Load(char const*, char const*, bool) () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#23 0x00007f926197648a in ROOT::EnableThreadSafety() () from /home/matteo/Downloads/root-6.08.06//lib/libCore.so
#24 0x00005556f9442004 in main ()
===========================================================
Segmentation fault (core dumped)
The CMakeLists.txt file is the following:
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(parallel)
#Command for ROOT (taken from the guide on the ROOT guide).
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
find_package(ROOT REQUIRED COMPONENTS RIO Net)
include(${ROOT_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
ROOT_GENERATE_DICTIONARY(G__Event Event.h LINKDEF EventLinkDef.h)
#---Find packaged for GLUT and OPENGL and add libraries
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} )
#---Adding other libraries
set(G_LIBRARIES ~/...)
add_library( V_LIB ${G_LIBRARIES}/... )
add_library( G_LIB ${G_LIBRARIES}/... )
include_directories(${G_LIBRARIES})
#---Create the executing program using the libraries
add_executable(Parallel parallel.cpp ${G_LIBRARIES}/... ${G_LIBRARIES}/... )
target_link_libraries(G_LIB V_LIB)
target_link_libraries(Parallel ${ROOT_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} G_LIB )
I used to compile with a normal makefile, but since I got the previous error I thought that passing to CMake somehow could have fixed it.
I have found that it may be connected to linking libCling, but it doesn’t seem that the compilation links it.
If it could help: a friend of mine has tried to compile on his computer with a makefile he made (the one I had been using before) and it works: I think he has used Freeglut3 and ROOT 5.
My ROOT is 6.08/06 and as GLUT I use Freeglut 3.
Any kind of help is appreciated.