Problem compiling ROOT 6.26 on fresh installed Debian 11


ROOT Version: 6.26.02
Platform: Linux debian 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux

Compiler: g++ (Debian 10.2.1-6) 10.2.1 20210110


I passed the following options to cmake -Droot7=OFF -DCMAKE_CXX_STANDARD=17 -Dxrootd=OFF -Dgdml=ON

I get the following error

[ 50%] Linking CXX executable src/rootcling_stage1
/usr/bin/ld: ../clingutils/CMakeFiles/ClingUtils.dir/src/TClingUtils.cxx.o: in function `dumpDeclForAssert(clang::Decl const&, char const*)':
TClingUtils.cxx:(.text+0x5af3): undefined reference to `clang::Decl::dump() const'
/usr/bin/ld: ../clingutils/CMakeFiles/ClingUtils.dir/src/TClingUtils.cxx.o: in function `ROOT::TMetaUtils::AST2SourceTools::PrepareArgsForFwdDecl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, clang::TemplateParameterList const&, cling::Interpreter const&)':
TClingUtils.cxx:(.text+0xa40c): undefined reference to `clang::Decl::dump(llvm::raw_ostream&, bool, clang::ASTDumpOutputFormat) const'
/usr/bin/ld: TClingUtils.cxx:(.text+0xa5c2): undefined reference to `clang::Decl::dump(llvm::raw_ostream&, bool, clang::ASTDumpOutputFormat) const'
/usr/bin/ld: ../clingutils/CMakeFiles/ClingUtils.dir/src/TClingUtils.cxx.o: in function `ROOT::TMetaUtils::ReSubstTemplateArg(clang::QualType, clang::Type const*) [clone .localalias]':
TClingUtils.cxx:(.text+0xaeef): undefined reference to `clang::Type::dump(llvm::raw_ostream&) const'
/usr/bin/ld: ../dictgen/CMakeFiles/Dictgen.dir/src/rootcling_impl.cxx.o: in function `WriteAST(llvm::StringRef, clang::CompilerInstance*, llvm::StringRef, clang::Module*) [clone .constprop.0]':
rootcling_impl.cxx:(.text+0x1d90a): undefined reference to `clang::CompilerInstance::createOutputFile(llvm::StringRef, bool, bool, llvm::StringRef, llvm::StringRef, bool, bool)'
/usr/bin/ld: ../../lib/libclingInterpreter.a(CIFactory.cpp.o): in function `(anonymous namespace)::AddHostArguments(llvm::StringRef, std::vector<char const*, std::allocator<char const*> >&, char const*, cling::CompilerOptions const&) [clone .constprop.0]':
CIFactory.cpp:(.text+0x9b08): undefined reference to `clang::CompilerInvocation::GetResourcesPath[abi:cxx11](char const*, void*)'
/usr/bin/ld: ../../lib/libclingInterpreter.a(CIFactory.cpp.o): in function `(anonymous namespace)::SetupCompiler(clang::CompilerInstance*, cling::CompilerOptions const&, bool, bool)':
CIFactory.cpp:(.text+0xd730): undefined reference to `clang::CompilerInstance::setTarget(clang::TargetInfo*)'
/usr/bin/ld: ../../lib/libclingInterpreter.a(CIFactory.cpp.o): in function `(anonymous namespace)::createCIImpl(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, cling::CompilerOptions const&, char const*, std::unique_ptr<clang::ASTConsumer, std::default_delete<clang::ASTConsumer> >, std::vector<std::shared_ptr<clang::ModuleFileExtension>, std::allocator<std::shared_ptr<clang::ModuleFileExtension> > > const&, bool, bool)':
CIFactory.cpp:(.text+0xf4ea): undefined reference to `clang::CompilerInvocationBase::CompilerInvocationBase()'
/usr/bin/ld: CIFactory.cpp:(.text+0x1039e): undefined reference to `clang::CompilerInvocation::CreateFromArgs(clang::CompilerInvocation&, char const* const*, char const* const*, clang::DiagnosticsEngine&)'
/usr/bin/ld: CIFactory.cpp:(.text+0x1041f): undefined reference to `clang::CompilerInstance::CompilerInstance(std::shared_ptr<clang::PCHContainerOperations>, clang::InMemoryModuleCache*)'
/usr/bin/ld: CIFactory.cpp:(.text+0x10472): undefined reference to `clang::CompilerInstance::setInvocation(std::shared_ptr<clang::CompilerInvocation>)'
/usr/bin/ld: CIFactory.cpp:(.text+0x10496): undefined reference to `clang::CompilerInstance::setDiagnostics(clang::DiagnosticsEngine*)'
/usr/bin/ld: CIFactory.cpp:(.text+0x1053d): undefined reference to `clang::CompilerInstance::createFileManager(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>)'
/usr/bin/ld: CIFactory.cpp:(.text+0x106a5): undefined reference to `clang::CompilerInstance::setSourceManager(clang::SourceManager*)'
/usr/bin/ld: CIFactory.cpp:(.text+0x10815): undefined reference to `clang::CompilerInstance::createPreprocessor(clang::TranslationUnitKind)'
/usr/bin/ld: CIFactory.cpp:(.text+0x1085b): undefined reference to `clang::CompilerInstance::createASTContext()'
/usr/bin/ld: CIFactory.cpp:(.text+0x1094f): undefined reference to `clang::CompilerInstance::setASTConsumer(std::unique_ptr<clang::ASTConsumer, std::default_delete<clang::ASTConsumer> >)'
/usr/bin/ld: CIFactory.cpp:(.text+0x1098d): undefined reference to `clang::CompilerInstance::createSema(clang::TranslationUnitKind, clang::CodeCompleteConsumer*)'
/usr/bin/ld: CIFactory.cpp:(.text+0x115b8): undefined reference to `clang::CompilerInstance::createFrontendTimer()'
/usr/bin/ld: CIFactory.cpp:(.text+0x117d6): undefined reference to `clang::CompilerInstance::setAuxTarget(clang::TargetInfo*)'
/usr/bin/ld: CIFactory.cpp:(.text+0x1195e): undefined reference to `clang::CompilerInstance::createOutputFile(llvm::StringRef, bool, bool, llvm::StringRef, llvm::StringRef, bool, bool)'
/usr/bin/ld: ../../lib/libclingInterpreter.a(CIFactory.cpp.o): in function `(anonymous namespace)::createCIImpl(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, cling::CompilerOptions const&, char const*, std::unique_ptr<clang::ASTConsumer, std::default_delete<clang::ASTConsumer> >, std::vector<std::shared_ptr<clang::ModuleFileExtension>, std::allocator<std::shared_ptr<clang::ModuleFileExtension> > > const&, bool, bool) [clone .cold]':
CIFactory.cpp:(.text.unlikely+0x1017): undefined reference to `clang::CompilerInvocationBase::~CompilerInvocationBase()'
/usr/bin/ld: ../../lib/libclingInterpreter.a(CIFactory.cpp.o): in function `std::_Sp_counted_ptr_inplace<clang::CompilerInvocation, std::allocator<clang::CompilerInvocation>, (__gnu_cxx::_Lock_policy)2>::_M_dispose()':
CIFactory.cpp:(.text._ZNSt23_Sp_counted_ptr_inplaceIN5clang18CompilerInvocationESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv[_ZNSt23_Sp_counted_ptr_inplaceIN5clang18CompilerInvocationESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv]+0x1e0): undefined reference to `clang::CompilerInvocationBase::~CompilerInvocationBase()'
/usr/bin/ld: CIFactory.cpp:(.text._ZNSt23_Sp_counted_ptr_inplaceIN5clang18CompilerInvocationESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv[_ZNSt23_Sp_counted_ptr_inplaceIN5clang18CompilerInvocationESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv]+0x364): undefined reference to `clang::CompilerInvocationBase::~CompilerInvocationBase()'
/usr/bin/ld: ../../lib/libclingInterpreter.a(Interpreter.cpp.o): in function `cling::Interpreter::ShutDown()':
Interpreter.cpp:(.text+0x5e9f): undefined reference to `clang::CompilerInstance::resetAndLeakSema()'
/usr/bin/ld: Interpreter.cpp:(.text+0x5f12): undefined reference to `clang::CompilerInstance::clearOutputFiles(bool)'
/usr/bin/ld: Interpreter.cpp:(.text+0x5f3b): undefined reference to `clang::CompilerInstance::setPreprocessor(std::shared_ptr<clang::Preprocessor>)'
/usr/bin/ld: Interpreter.cpp:(.text+0x5f75): undefined reference to `clang::CompilerInstance::setSourceManager(clang::SourceManager*)'
/usr/bin/ld: Interpreter.cpp:(.text+0x5f7f): undefined reference to `clang::CompilerInstance::setFileManager(clang::FileManager*)'
/usr/bin/ld: Interpreter.cpp:(.text+0x5f9e): undefined reference to `clang::CompilerInstance::setSema(clang::Sema*)'
/usr/bin/ld: Interpreter.cpp:(.text+0x5fa8): undefined reference to `clang::CompilerInstance::setASTContext(clang::ASTContext*)'
/usr/bin/ld: Interpreter.cpp:(.text+0x5fbb): undefined reference to `clang::CompilerInstance::setASTConsumer(std::unique_ptr<clang::ASTConsumer, std::default_delete<clang::ASTConsumer> >)'
/usr/bin/ld: ../../lib/libclingInterpreter.a(Interpreter.cpp.o): in function `cling::Interpreter::Interpreter(int, char const* const*, char const*, std::vector<std::shared_ptr<clang::ModuleFileExtension>, std::allocator<std::shared_ptr<clang::ModuleFileExtension> > > const&, bool, cling::Interpreter const*)':
Interpreter.cpp:(.text+0x75bc): undefined reference to `clang::CompilerInstance::createModuleManager()'
/usr/bin/ld: ../../lib/libclingInterpreter.a(Interpreter.cpp.o): in function `cling::Interpreter::codeComplete(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) const':
Interpreter.cpp:(.text+0x82f0): undefined reference to `clang::CompilerInstance::setCodeCompletionConsumer(clang::CodeCompleteConsumer*)'
/usr/bin/ld: ../../lib/libclingInterpreter.a(InterpreterCallbacks.cpp.o): in function `cling::InterpreterCallbacks::InterpreterCallbacks(cling::Interpreter*, bool, bool, bool)':
InterpreterCallbacks.cpp:(.text+0x9a4): undefined reference to `clang::CompilerInstance::getModuleManager() const'
/usr/bin/ld: InterpreterCallbacks.cpp:(.text+0xb5a): undefined reference to `clang::CompilerInstance::setASTConsumer(std::unique_ptr<clang::ASTConsumer, std::default_delete<clang::ASTConsumer> >)'
/usr/bin/ld: ../../lib/libclingInterpreter.a(ClangInternalState.cpp.o): in function `clang::RecursiveASTVisitor<cling::DumpLookupTables>::TraverseDecl(clang::Decl*)':
ClangInternalState.cpp:

I attach the full error message:
make_output.txt (106.7 KB)

Any idea? I really compiled ROOT many times, and now I really don’t know how to proceed.

Perhaps I can disable some compilation options?

Hi @Javier_Galan ,
can you please try with the v6-26-00-patches or the master branch instead of v6.26.02?

I am not sure what this might be, maybe @Axel , @vvassilev or @hahnjo have an idea.

Cheers,
Enrico

@Javier_Galan could you try passing -DCMAKE_BUILD_TYPE=Release? From the options you posted, it appears you’re not setting this and I don’t know what happens in this case. I’ll need to check if that explains the errors, and what could be done about that…

If you don’t specify anything ROOT defaults to Release :sweat_smile:

I switched to branch v6-26-00-patches the error is now much shorter. I attach cmake output too.

cmake_output_20220525.txt (15.9 KB)

[ 47%] Built target clang-cmake-exports
[ 47%] Built target CLING
[ 47%] Built target LLVMRES
[ 47%] Built target ClingUtils
[ 47%] Built target Dictgen
[ 47%] Linking CXX executable src/rootcling_stage1
/usr/bin/ld: ../../lib/libclingMetaProcessor.a: error adding symbols: archive has no index; run ranlib to add one
collect2: error: ld returned 1 exit status
make[2]: *** [core/rootcling_stage1/CMakeFiles/rootcling_stage1.dir/build.make:247: core/rootcling_stage1/src/rootcling_stage1] Error 1
make[1]: *** [CMakeFiles/Makefile2:27188: core/rootcling_stage1/CMakeFiles/rootcling_stage1.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
rest@debian:~/git/root/build$ 

Hi @Javier_Galan ,
I just built ROOT v6-26-00-patches from source in a Debian 11 Docker image with no problems.

There is probably something broken in your environment (especially given the last error). Are you running the build from an empty build directory, with no other ROOT installation present in the environment?

This is the recipe that worked:

FROM debian:11

# ROOT deps
RUN apt-get update && \
    apt-get -y -q install \
    dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev \
    libxft-dev libxext-dev python libssl-dev \
    gfortran libpcre3-dev \
    xlibmesa-glu-dev libglew1.5-dev libftgl-dev \
    libfftw3-dev libcfitsio-dev \
    graphviz-dev libavahi-compat-libdnssd-dev \
    libldap2-dev python-dev libxml2-dev libkrb5-dev \
    libgsl0-dev git

# ROOT
RUN git clone --branch v6-26-00-patches https://github.com/root-project/root.git root_src
RUN mkdir root_build
RUN cmake -B root_build -S root_src
RUN cmake --build root_build -- -j16

If you save it in a file called Dockerfile, then you can execute it with docker build -t root-debian11 ., you’ll see that it builds ROOT from source correctly in Debian 11.

Cheers,
Enrico

@Javier_Galan in your cmake_output_20220525.txt, I see that you did a git checkout v6-26-00. This gives you the tag for 6.26/00. What you want is the branch v6-26-00-patches, which will eventually be released as 6.26/04.

Also please try starting from a clean build directory, as mentioned by Enrico.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.