Skip to content

Dictionary generation of some classes fails on gcc12 (at least in part due to the use of modules) #11329

@pcanal

Description

@pcanal

The Failure is visible on the GCC 12 / Fedora 36 build: https://lcgapp-services.cern.ch/root-jenkins/job/root-nightly-master/3285/LABEL=ROOT-fedora36,SPEC=default,V=master/testReport/junit/projectroot.roottest.root.tree/branches/roottest_root_tree_branches_make/
for example:

+Error in <TTree::Branch>: The class requested (vector<int>) for the branch "vec" is an instance of an stl collection and does not have a compiled CollectionProxy. Please generate the dictionary for this collection (vector<int>) to avoid to write corrupted data.

This indicates that the generation of the dictionary for std::vector<int> failed even-though it is explicitly requested as part of the G__Core.cxx dictionary.

And indeed when inspecting the build log we see for G__Core.cxx:

Warning: Unused class rule: vector<Int_t> 

I narrowed down the problem to the presence of:

-cxxmodule -s /home/sftnight/build/manual/build/lib/libCore.so  -m _Builtin_intrinsics -mByproduct _Builtin_intrinsics -mByproduct ROOT_Foundation_Stage1_NoRTTI -mByproduct ROOT_Foundation_C -mByproduct ROOT_Rtypes 

on the command line.

And it can easily be reproduce with the files:

// a.h
#include <vector>

and

// aLinkDef.h 
#pragma link C++ class vector<Int_t>+;

and with

/home/sftnight/build/manual/build/core/rootcling_stage1/src/rootcling_stage1 -v2 -f G__Core.cxx  a.h aLinkDef.h

we get a proper dictionary for the vector. While with

/home/sftnight/build/manual/build/core/rootcling_stage1/src/rootcling_stage1 -v2 -f G__Core.cxx -cxxmodule -s /home/sftnight/build/manual/build/lib/libCore.so  -m _Builtin_intrinsics -mByproduct _Builtin_intrinsics -mByproduct ROOT_Foundation_Stage1_NoRTTI -mByproduct ROOT_Foundation_C -mByproduct ROOT_Rtypes  a.h aLinkDef.h 

we get an empty dictionary and the warning:

Warning: Unused class rule: vector<Int_t> 

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions