Undefined Reference Error when building ROOT from Source (Clang)

_ROOT Version:6.32.02
_Platform: Linux AlmaLinux 8.10
Compiler: gcc 11.2.0


Error when building root from source, ~71% through the build.
Used commands in instructions:

$ git clone --branch latest-stable --depth=1 https://github.com/root-project/root.git root_src
$ mkdir root_build root_install && cd root_build
$ cmake -DCMAKE_INSTALL_PREFIX=../root_install ../root_src # && check cmake configuration output for warnings or errors
$ cmake --build . -- install -j4 # if you have 4 cores available for compilation

Then I get a very long series of undefined reference errors when linking

ParseCXXInlineMethods.cpp:(.text._ZN5clang6Parser27ParseLexedMemberInitializerERNS0_27LateParsedMemberInitializerE.part.0+0x34a): undefined reference to `clang::Sema::PopExpressionEvaluationContext()'
../../interpreter/llvm-project/llvm/lib/libclangParse.a(ParseCXXInlineMethods.cpp.o): In function `clang::Parser::ParseCXXInlineMethodDef(clang::AccessSpecifier, clang::ParsedAttributesView const&, clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::VirtSpecifiers const&, clang::SourceLocation)':
ParseCXXInlineMethods.cpp:(.text._ZN5clang6Parser23ParseCXXInlineMethodDefENS_15AccessSpecifierERKNS_20ParsedAttributesViewERNS_17ParsingDeclaratorERKNS0_18ParsedTemplateInfoERKNS_14VirtSpecifiersENS_14SourceLocationE+0x6a0): undefined reference to `clang::Sema::IsInsideALocalClassWithinATemplateFunction()'
ParseCXXInlineMethods.cpp:(.text._ZN5clang6Parser23ParseCXXInlineMethodDefENS_15AccessSpecifierERKNS_20ParsedAttributesViewERNS_17ParsingDeclaratorERKNS0_18ParsedTemplateInfoERKNS_14VirtSpecifiersENS_14SourceLocationE+0x700): undefined reference to `clang::Sema::MarkAsLateParsedTemplate(clang::FunctionDecl*, clang::Decl*, llvm::SmallVector<clang::Token, 4u>&)'
../../interpreter/llvm-project/llvm/lib/libclangParse.a(ParseCXXInlineMethods.cpp.o): In function `clang::Parser::ParseLexedMethodDeclaration(clang::Parser::LateParsedMethodDeclaration&)':
ParseCXXInlineMethods.cpp:(.text._ZN5clang6Parser27ParseLexedMethodDeclarationERNS0_27LateParsedMethodDeclarationE+0x788): undefined reference to `clang::Sema::PushExpressionEvaluationContext(clang::Sema::ExpressionEvaluationContext, clang::Decl*, clang::Sema::ExpressionEvaluationContextRecord::ExpressionKind)'
ParseCXXInlineMethods.cpp:(.text._ZN5clang6Parser27ParseLexedMethodDeclarationERNS0_27LateParsedMethodDeclarationE+0x968): undefined reference to `clang::Sema::PopExpressionEvaluationContext()'
../../interpreter/llvm-project/llvm/lib/libLLVMCodeGen.a(CodeGen.cpp.o): In function `llvm::initializeCodeGen(llvm::PassRegistry&)':
CodeGen.cpp:(.text._ZN4llvm17initializeCodeGenERNS_12PassRegistryE+0x12d): undefined reference to `llvm::initializeLiveDebugVariablesPass(llvm::PassRegistry&)'
/usr/bin/ld: src/rootcling_stage1: hidden symbol `_ZN4llvm18LiveDebugVariables13splitRegisterENS_8RegisterENS_8ArrayRefIS1_EERNS_13LiveIntervalsE' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
gmake[2]: *** [core/rootcling_stage1/CMakeFiles/rootcling_stage1.dir/build.make:246: core/rootcling_stage1/src/rootcling_stage1] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:37159: core/rootcling_stage1/CMakeFiles/rootcling_stage1.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

Any suggestions or help would be greatly appreciated.

Welcome to the ROOT Forum!
That’s weird, maybe @Danilo has an idea what could be the issue

Just wanted to add that I’m running into the same issue when compiling v6.30.08 as well.

Hi Hasung,

Apologies for the delayed answer: it’s summer over here.

I am sorry to read ROOT did not work out of the box for you in this case. We also build nightlies and PRs on Alma8. However, our policy foresees to use what the OS provides by default, including the compiler, which is gcc 8.5.0.

Can it be that your gcc11 or associated libraries installations has issues?

Cheers,
Danilo

1 Like

Hello Danilo,

I tried using our cluster’s shared install of gcc/8.3.0 instead and it worked. ROOT6.30.08 compiled without issue.

Later, I’ll try 6.32 again

Thanks

Thanks for the attempt. Let us know how this goes: this will be useful information for others that might be dealing with similar setups.

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