[ROOT-8180] Error when building ROOT 5 with GCC 6 Created: 12/May/16  Updated: 05/Jul/17  Resolved: 04/Jul/16

Status: Closed
Project: ROOT
Component/s: Build System
Affects Version/s: 5.34/36
Fix Version/s: 5.34/38

Type: Bug Priority: Medium
Reporter: Nicola Mori Assignee: Pere Mato Vila
Resolution: Fixed Votes: 1
Labels: None
Environment:

ArchLinux 64 bit


Attachments: File ROOT-v5.34-GCC6-2.patch     File ROOT-v5.34-GCC6.patch     File gcc6.patch    
Development:
Actual End:

 Description   

I'm building ROOT 5.34.36 with GCC 6, after patching with the attached patch which fixes the same issue that was fixed by commit 7dec562d1d5723b7eea08d08659dc9dc4e79c8ca for GCC 5 and a change in fortran libraries shipped by GCC. I get this error:

Generating dictionary cint/reflex/src/G__Reflex.cxx...
core/utils/src/rootcint_tmp -cint -f cint/reflex/src/G__Reflex.cxx -c -p -Icint/reflex/inc /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/PluginService.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Scope.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Callback.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Type.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Any.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Base.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Tools.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/PropertyList.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/TypeTemplate.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Object.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Kernel.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Member.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/ValueObject.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/MemberTemplate.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/OnDemandBuilderForScope.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/EnumBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/CollectionProxy.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/NewDelFunctions.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/ClassBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/DictSelection.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/UnionBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/NamespaceBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/OnDemandBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/TypedefBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/VariableBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/FunctionBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/TypeBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/Reflex/Builder/GenreflexMemberBuilder.h /home/mori/software/source/root_v5.34.36.gcc6/cint/reflex/inc/LinkDef.h
Error: class,struct,union or type decltype(nullptr) not defined /usr/include/c+/6.1.1/x86_64-pc-linux-gnu/bits/c+config.h:202:

followed by others. It seems that the decltype keyword in /usr/include/c+/6.1.1/x86_64-pc-linux-gnu/bits/cconfig.h is not understood by rootcint. Since it is a c11 feature I suspect that it might be generated by GCC 6 defaulting to c14. It appears when using the flag -enable c11 as well, and also when forcing c98 with the second attached patch. So it seems that rootcint does not understand some c+11 features and still it tries to parse code protected by guards like #if __cplusplus >= 201103L.



 Comments   
Comment by Bastian Beischer (Inactive) [ 20/May/16 ]

One has to modify the CPPPREP variable so that rootcint calls '${CXX} -std=c++98 -E -C' for the GCC 6 case.

Patch is attached (gcc6.patch). This is working for the CMake build, I haven't tested the ./configure build.

Comment by Nicola Mori [ 20/May/16 ]

The patch from Bastian works also with configure; however, it is still necessary to remove the reference to libgfortranbegin.a as in the last block of the attached ROOT-v5.34-GCC6.patch. It works without specifying the c++ standard (so defaulting to c++14).

Comment by Bastian Beischer (Inactive) [ 20/May/16 ]

Yes Nicola I agree. We still need to remove libgfortranbegin.a. I don't know what that library is used for so I don't know if it can be removed also for builds with GCC < 6.

If it is required for GCC 4 and GCC 5 we need to add version detection logic to Makefile.linuxx8664gcc I think.

Comment by Nicola Mori [ 20/May/16 ]

From here:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40267

I understand that libgfortranbegin.a is not needed since long time, but has been removed only during the recent GCC 6 development phase. I compiled Root on a SL5 32 bit machine with a custom built GCC 4.5.2 without patching but just removing the reference to libgfortranbegin.a from config/Makefile.linux, and it worked (had to disable python due to a mess in my system, though, but I think there's no relationship with libgfortranbegin.a). Unfortunately I have no other compiler available to make other tests, but at least there are indications that the library is not necessary even with older versions of GCC.

Comment by Bastian Beischer (Inactive) [ 20/May/16 ]

Thanks - very thorough

Comment by Adrian Sevcenco [ 29/Jun/16 ]

Hi everyone! i have the same problem with root5 on fedora 24 (gcc 6.1.1) but my errors are slight different:
[ 30%] Generating G_Reflex.cxx, G_Reflex.h
Error: class,struct,union or type decltype(nullptr) not defined /usr/include/c+/6.1.1/x86_64-redhat-linux/bits/c+config.h:2092:
Error: unrecognized language construct /usr/include/c++/6.1.1/bits/atomic_base.h:162:
Error: Symbol default is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:162:
Error: unrecognized language construct /usr/include/c++/6.1.1/bits/atomic_base.h:163:
Error: Symbol default is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:163:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:164:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:165:
Error: unrecognized language construct /usr/include/c++/6.1.1/bits/atomic_base.h:166:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:166:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:181:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:198:
Error: Symbol bool is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:244:
Error: Function alignof(bool) is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:244:
Error: Invalid type 'constexpr' in declaration of 'int _S_alignment' /usr/include/c++/6.1.1/bits/atomic_base.h:244:
Syntax error /usr/include/c++/6.1.1/bits/atomic_base.h:246:
Error: unrecognized language construct /usr/include/c++/6.1.1/bits/atomic_base.h:246:
Error: unrecognized language construct /usr/include/c++/6.1.1/bits/atomic_base.h:249:
Error: Symbol default is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:249:
Error: unrecognized language construct /usr/include/c++/6.1.1/bits/atomic_base.h:250:
Error: Symbol default is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:250:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:251:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:252:
Error: unrecognized language construct /usr/include/c++/6.1.1/bits/atomic_base.h:253:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/bits/atomic_base.h:253:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:380:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:401:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:420:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:462:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:506:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:519:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:529:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:539:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:549:
Error: Redefinition of default argument /usr/include/c++/6.1.1/bits/atomic_base.h:559:
Error: abstract class object '__atomic_base<bool> _M_base' declared /usr/include/c++/6.1.1/atomic:61:
Error: unrecognized language construct /usr/include/c++/6.1.1/atomic:64:
Error: Symbol default is not defined in current scope /usr/include/c++/6.1.1/atomic:64:
Error: unrecognized language construct /usr/include/c++/6.1.1/atomic:65:
Error: Symbol default is not defined in current scope /usr/include/c++/6.1.1/atomic:65:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/atomic:66:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/atomic:67:
Error: unrecognized language construct /usr/include/c++/6.1.1/atomic:68:
Error: Symbol delete is not defined in current scope /usr/include/c++/6.1.1/atomic:68:
Error: Redefinition of default argument /usr/include/c++/6.1.1/atomic:98:
Error: Redefinition of default argument /usr/include/c++/6.1.1/atomic:106:
Error: Redefinition of default argument /usr/include/c++/6.1.1/atomic:115:
Error: Redefinition of default argument /usr/include/c++/6.1.1/atomic:135:
Error: Redefinition of default argument /usr/include/c++/6.1.1/atomic:155:
Error: Missing one of '
;:=+-)(*&^%$#@!~'"|][}

{/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][} {/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][} {/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][} {/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][} {/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][} {/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][} {/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][} {/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][} {/?.>,<' expected at or after line 42833. Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833: Error: Missing one of ' ;:=+-)(*&^%$#@!~'"\|][}

{/?.>,<' expected at or after line 42833.
Error: Unexpected end of file (G__fgetstream():2) /usr/include/c++/6.1.1/atomic:42833:
Error: Unexpected end of file (G__fgetc()) /usr/include/c++/6.1.1/atomic:42833:
cint/reflex/CMakeFiles/ReflexDict.dir/build.make:90: recipe for target 'cint/reflex/G__Reflex.cxx' failed
make[2]: *** [cint/reflex/G__Reflex.cxx] Error 1
make[2]: *** Deleting file 'cint/reflex/G__Reflex.cxx'
CMakeFiles/Makefile2:2499: recipe for target 'cint/reflex/CMakeFiles/ReflexDict.dir/all' failed
make[1]: *** [cint/reflex/CMakeFiles/ReflexDict.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Comment by Andreas Neiser [ 02/Jul/16 ]

I created a pull request on GitHub https://github.com/root-mirror/root/pull/188
Don't know exactly how maintainers of ROOT want to receive contributions. Let's see

Comment by Pere Mato Vila [ 04/Jul/16 ]

Thanks for the PR. I have committed them to the 5.34 branch. We plan to do a new 5.34 patch release ASAP.

Comment by Thomas Zimmermann (Inactive) [ 15/Jul/16 ]

When including the patch form Andreas Neiser root builds fine with gcc6 on x86_64 but fails to build on i586, since it is missing libgfortranbegin.a.

Can you remove libgfortranbegin.a also from the other architectures than x86_64?

Generated at Tue Aug 09 21:24:28 CEST 2022 using Jira 8.22.6#822006-sha1:a60819604027c401cc97bed69f4574413f3aa3b8.