root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.64k stars 1.26k forks source link

Test clingtest-check-cling fails (language mismatch) #10693

Open amadio opened 2 years ago

amadio commented 2 years ago

The test clingtest-check-cling fails for me with the output below. It seems that C++ standard is misconfigured somewhere. I used GCC 11 and did not specify a -DCMAKE_CXX_STANDARD when configuring. GCC 11.3 defaults to C++17, but in this test (see RUN: at line 3 and 4 below) clang is called with -std=c++14 instead (My guess is that's the default for clang 9).

1: FAIL: Cling :: CodeUnloading/PCH/VTables.C (36 of 185)
1: ******************** TEST 'Cling :: CodeUnloading/PCH/VTables.C' FAILED ********************
1: Script:
1: --
1: : 'RUN: at line 1';   mkdir -p "/srv/root/src/build/interpreter/cling/test/CodeUnloading/PCH/Output/Rel/Path" || true
1: : 'RUN: at line 2';   rm -f "CompGen.h.pch" && rm -f "/srv/root/src/build/interpreter/cling/test/CodeUnloading/PCH/Output/Rel/Path/Relative.pch"
1: : 'RUN: at line 3';   clang -x c++-header -fexceptions -fcxx-exceptions -std=c++14 -pthread /srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH/Inputs/CompGen.h -o CompGen.h.pch
1: : 'RUN: at line 4';   clang -x c++-header -fexceptions -fcxx-exceptions -std=c++14 -pthread /srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH/Inputs/CompGen.h -o /srv/root/src/build/interpreter/cling/test/CodeUnloading/PCH/Output/Rel/Path/Relative.pch
1: : 'RUN: at line 5';   cat /srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH/VTables.C | /srv/root/src/build/interpreter/llvm/src/bin/cling --nologo -I/srv/root/src/build/interpreter/llvm/src/tools/clang/include -I/srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH -Xclang -include-pch -Xclang CompGen.h.pch  2>&1 | /srv/root/src/build/interpreter/llvm/src/bin/FileCheck /srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH/VTables.C
1: : 'RUN: at line 6';   cat /srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH/VTables.C | /srv/root/src/build/interpreter/llvm/src/bin/cling --nologo -I/srv/root/src/build/interpreter/llvm/src/tools/clang/include -I/srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH -I/srv/root/src/build/interpreter/cling/test/CodeUnloading/PCH/Output/Rel/Path -include-pch Relative.pch 2>&1 | /srv/root/src/build/interpreter/llvm/src/bin/FileCheck /srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH/VTables.C
1: --
1: Exit Code: 1
1: 
1: Command Output (stderr):
1: --
1: /srv/root/src/root/interpreter/cling/test/CodeUnloading/PCH/VTables.C:11:12: error: CHECK: expected string not found in input
1:  // CHECK: I was executed
1:            ^
1: <stdin>:1:1: note: scanning from here
1: cling: /srv/root/src/root/interpreter/cling/lib/Interpreter/CIFactory.cpp:926: bool {anonymous}::SetupCompiler(clang::CompilerInstance*, const cling::CompilerOptions&, bool, bool): Assertion `LangOpts.CPlusPlus17 && "Language version mismatch"' failed.
1: ^
1: <stdin>:6:52: note: possible intended match here
1:  #4 0x00007faf5092270e __pthread_kill_implementation /usr/src/debug/sys-libs/glibc-2.35-r5/glibc-2.35/nptl/pthread_kill.c:44:76
1:                                                    ^
1: 
1: --

Adding -DCMAKE_CXX_STANDARD=17 to the command line when configuring did not help, clang is still called with -std=c++14 in the test and it still fails.

Axel-Naumann commented 2 years ago

@vgvassilev do we even need the explicit -std=c++14 here?

vgvassilev commented 2 years ago

Probably because we wanted to protect against systems which default to c++11.

dpiparo commented 7 months ago

@vgvassilev is this still an issue or can this be closed?