Bug #21865

Problem with std::bitset in lariatsoft

Added by Kirsty Duffy almost 2 years ago. Updated almost 2 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
4.00 h
Spent time:
Duration: 14


We have made changes in lardataobj related to the anab::ParticleID object. Part of this involves a std::bitset to encode the plane(s) used. Because of this, std::bitset<8> and _Base_bitset<1> were added to lardataobj/AnalysisBase/classes_def.xml. This has caused no problems in most experimental code, but does cause an issue in lariatsoft:

When compiling with c2 qualifier, we see a compiler error:

'Warning: Unused class rule: _Base_bitset<1>'

When removing the _Base_bitset<1> line from the classes_def.xml file, the code compiles in both e17 and c2, but we get this error at run time:

 No dictionary found for the following classes:
      Most likely they were never generated, but it may be that they were generated in the wrong package.
      Please add (or move) the specification
           <class name="MyClassName"/>
      to the appropriate classes_def.xml file.
List of branches in use:
  • larana: feature/alister1_chi2_pidclassupgrade
  • lardataobj: feature/alister1_pid_ioread
  • lariatsoft: feature/kduffy_updatedPIDdataprod

Additional information from emails:

From: Kyle Knoepfel
Sent: Thursday, February 7, 2019 2:03 PM
To: Philippe G Canal
Cc: Kyle Knoepfel; Lynn A Garren; Christopher H Green; Hunter C. Sullivan; larsoft-team; Johnny Ho; Erica Snider; Adam Lister; Giuseppe B. Cerati
Subject: Re: Dictionary for std::bitset

Okay, thanks Philippe. In that case, a new version of art will be required that makes the appropriate adjustments.


On Feb 7, 2019, at 1:45 PM, Philippe G Canal <<mailto:>> wrote:

Hi Kyle,

In this case, the guidance is straightforward, the checker needs to recognize that the class is std::bitset and ignore its base class. The dictionary for the base should never be requested.


On 2/7/19 1:21 PM, Kyle Knoepfel wrote:
Hi Lynn, Chris,

I have talked with Philippe (cc’d), who has told me that ROOT does not transparently support std::bitset—i.e. it is necessary for the user to generate the dictionary for a given std::bitset instantiation. The problem here is that Clang and GCC implement the std::bitset template differently: std::bitset<1>’s base class in GCC is _Base_bitset<1>, whereas in Clang it is __bitset<1,1>.

Philippe and Chris, our dictionary checker in canvas_root_io recursively checks the presence of dictionaries (going through all base classes) until it either reaches a type/template that is transparently handled by ROOT, or until there are no more base classes. What is the guidance for handling this particular case? Are there alternative XML tags that users should specify depending on what STL implementation is being used?



#1 Updated by Kyle Knoepfel almost 2 years ago

  • Estimated time set to 4.00 h
  • Assignee set to Kyle Knoepfel
  • Status changed from New to Assigned

#2 Updated by Kyle Knoepfel almost 2 years ago

  • Target version set to 3.01.02

#3 Updated by Kyle Knoepfel almost 2 years ago

  • Description updated (diff)

#4 Updated by Kyle Knoepfel almost 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Assigned to Resolved
  • Category set to Infrastructure
  • Occurs In 3.01.01 added

This bug has been resolved with commit canvas_root_io:f747a41. art 3.01.02 will be tagged shortly that incorporates the fix.

#5 Updated by Kyle Knoepfel almost 2 years ago

  • Scope deleted (Internal)
  • Status changed from Resolved to Closed
  • Category deleted (Infrastructure)
  • Project changed from art to canvas_root_io
  • Experiment deleted (-)
  • Occurs In deleted (3.01.01)

#6 Updated by Kyle Knoepfel almost 2 years ago

As a note, when creating a dictionary for std::bitset<n>, the only tag that should appear in the classes_def.xml file is:

<class name="std::bitset<n>"/>

No base classes of std::bitset<n> should be provided.

Also available in: Atom PDF