QualityControl does not build on Ubuntu 20.04

Hello,

QualityControl fails in compilation:

In file included from Framework/G__O2QualityControlTypes.cxx:32:
/home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TCollectionProxyInfo.h: In instantiation of 'static void* ROOT::Detail::TCollectionProxyInfo::Type<T>::construct(void*, std::size_t) [with T = std::vector<std::pair<o2::quality_control::FlagReason, std::__cxx11::basic_string<char> > >; std::size_t = long unsigned int]':
/home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TCollectionProxyInfo.h:569:17:   required from 'static ROOT::Detail::TCollectionProxyInfo* ROOT::Detail::TCollectionProxyInfo::Generate(const T&) [with T = ROOT::Detail::TCollectionProxyInfo::Pushback<std::vector<std::pair<o2::quality_control::FlagReason, std::__cxx11::basic_string<char> > > >]'
Framework/G__O2QualityControlTypes.cxx:503:161:   required from here
/home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TCollectionProxyInfo.h:335:13: error: no matching function for call to 'std::pair<o2::quality_control::FlagReason, std::__cxx11::basic_string<char> >::pair()'
  335 |             ::new(m) Value_t();
      |             ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/vector:60,
                 from /home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TGenericClassInfo.h:15,
                 from /home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/Rtypes.h:193,
                 from /home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TObject.h:17,
                 from /home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TNamed.h:25,
                 from /home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TDictionary.h:44,
                 from /home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TClass.h:23,
                 from Framework/G__O2QualityControlTypes.cxx:14:
/usr/include/c++/9/bits/stl_pair.h:436:9: note: candidate: 'template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>)'
  436 |         pair(tuple<_Args1...>&, tuple<_Args2...>&,
      |         ^~~~
/usr/include/c++/9/bits/stl_pair.h:436:9: note:   template argument deduction/substitution failed:
In file included from Framework/G__O2QualityControlTypes.cxx:32:
/home/zampolli/SOFT/alibuild/ali-o2/sw/ubuntu2004_x86-64/ROOT/v6-20-08-alice1-2/include/TCollectionProxyInfo.h:335:13: note:   candidate expects 4 arguments, 0 provided
  335 |             ::new(m) Value_t();
      |             ^~~~~~~~~~~~~~~~~~

Full log attached. AliDoctor is happy, it does not spot anything.

Thanks for any help!

Chiara

log.log (94.4 KB)

I guess the std::pair<o2::quality_control::FlagReason, std::string> is used to build the std::map and for that the key should be hashable.
Could you try to add in the end of the FlagReason.h (outside of the o2 namespace) the following (assuming that the getID uniquely defines the FlagReason)

namespace std
{
// defining std::hash for FlagReason 
template <>
struct hash<o2::quality_control::FlagReason> 
{
 public:
  size_t operator()(o2::quality_control::FlagReason& flag) const
  {
    return flag.getID();
  }
};
} // namespace std

Hi Ruben,

Thanks for the suggestion, but I get the same error as before.

Chiara

Hi,

Perhaps @hristov has an idea as this is on Ubuntu ?

I have not seen this error in any of our builds on CC7, C8 or Mac.
If I can spawn an Ubuntu machine I will give it a try.

Cheers,
Barth

Hello,

An update: only a completely fresh installation helped. I even removed the full sw directory but it did not help. I can leave this open more to see if there is any suggestion on what I could do more in the other installation, and close in a few days if there is no follow up.

BTW, I was wondering whether the fact that I had run aliBuild build qcg --defaults o2 first, that caused the issue (I had followed the instructions here: QualityControl/QuickStart.md at master · AliceO2Group/QualityControl · GitHub). I don’t think so, but…

Or that I was compiling in DEBUG mode, but no, this was not the problem.

Chiara

It’s extremely strange that removing the sw folder did not help. One possibility is that somehow the QC cmakelists.txt uses a path out of the alibuild folder (e.g. the QC / O2 sources when you use a developer package) to cache the generated files. If that is the case, it’s something which should definitely be fixed.

I finally have understood the issue: my O2 branch was not in perfect sync with dev, and this was creating the issues in the compilation of QC.

Even if I understood from Giulio that this is not straightforward, I think that a check on the compatibility O2 <----> would be beneficial, or other people could occur in this problem.
@bvonhall : maybe I overlooked but I think that the instructions do not mention explicitly that one needs O2 dev for QC master. Maybe it is sort of common sense, but 1 day of development in QC could make the difference already. If someone works on both O2 and QC, they should know that they should keep them up to date constantly. What do you think?

Chiara

@zampolli I agree that the doc could state explicitely this point.

From my experience it is not so often that O2 and QC are not in sync. When it happens we notice it in the PRs as we have to synchronise them between the two repos. This happens very rarely.

I will also add something to the troubleshooting section.

Yes, I was very unlucky, my dev was apparently at 15th April, Piotr’s changes some time around 19 or so… :frowning:

Thanks!!

Chiara