RDataFrame feature request: better diagnostics for interpreted types

run.log.txt (47.6 KB)

_ROOT Version:6.18.04_1 homebrew
_Platform:mac OS X catalina

In file included from /private/tmp/root-20191109-56249-1xyy8k0/root-6.18.04/builddir/input_line_12:21:
In file included from /private/tmp/root-20191109-56249-1xyy8k0/root-6.18.04/builddir/etc/dictpch/allHeaders.h:304:
In file included from /private/tmp/root-20191109-56249-1xyy8k0/root-6.18.04/builddir/include/ROOT/RCsvDS.hxx:14:
In file included from /private/tmp/root-20191109-56249-1xyy8k0/root-6.18.04/builddir/include/ROOT/RDataFrame.hxx:20:
In file included from /private/tmp/root-20191109-56249-1xyy8k0/root-6.18.04/builddir/include/ROOT/RDF/RInterface.hxx:15:
/private/tmp/root-20191109-56249-1xyy8k0/root-6.18.04/builddir/include/ROOT/RDF/ActionHelpers.hxx:1170:51: error: cannot form a reference to 'void'
   void Exec(unsigned int /* slot */, BranchTypes &... values)
/private/tmp/root-20191109-56249-1xyy8k0/root-6.18.04/builddir/include/ROOT/RDF/RAction.hxx:214:86: note: in instantiation of template class
      'ROOT::Internal::RDF::SnapshotHelper<double, double, double, int,
      int, void, int, int, int, double, int, int, int, double, double,
      double, double, double, double, double, double, double, double,
      double, double, double, int, int, double, double, int, double,
      ROOT::VecOps::RVec<double>, ROOT::VecOps::RVec<double>,
      ROOT::VecOps::RVec<double>, ROOT::VecOps::RVec<double>, int, double,
      double, double, double, double, double, double>' requested here
  ...typename PrevDataFrame, typename ColumnTypes_t = typename Helper::...

please see the attachment

Which commands did you use to configure the compilation (cmake options)?

can you provide a small snippet of code that produces this compilation error?

It looks like the 6th branch that you are trying to Snapshot is of type void. I’m not quite sure how that can happen.


root install with home-brew, the build option should be got from.

the I build my code with

g++ `root-config -libs --cflags`

the same as

-L/usr/local/Cellar/root/6.18.04_1/lib/root -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -lpthread -stdlib=libc++ -lm -ldl -pthread -stdlib=libc++ -std=c++1z -m64 -I/usr/local/Cellar/root/6.18.04_1/include/root

not so clear what made that happen.

thanks, this should be the problem.
the 6th branch is an struct{double , double}, that cause the problem

Hi cxwx,
a simple struct should not be a problem for Snapshot. Does the interpreter “know” about that type?

In order to help further we would need a small reproducer that we can run.


I wrote an example for this bug

     #include <ROOT/RDataFrame.hxx>

     using namespace ROOT;

     struct re{
         double a;
         double b;
   re j2000(double k)
       res c;
       c.a = 0;
       c.b = 0;
       return c;

     void p4_radec()
         RDataFrame aDataIn("result", "data/*.root");
             .Define("res", j2000, {"x"})
             .Snapshot("result", "RESULT2.root");

     int main()

whatever data cause this problem.

root -l p5_test.cpp

there is no bug.
but if I compile with g++ on Mac OS X catalina with home-brew root
cause the problem

we should definitely have a better diagnostic – in fact I’m surprised we do not, feel free to open a jira ticket here for the lack of intelligible diagnostic.

I think the underlying problem is that the ROOT interpreter (which is used for the I/O of user-defined classes) does not know about the type re.

Does adding

gInterpreter->Declare("struct re{ double a; double };");

to main help?


It helps, thanks!:grinning:

1 Like

Good! As a help to future users, maybe you could change the title of the thread to reflect the actual issue?

In any case, happy things are ok now, marking as solved!


I have created https://sft.its.cern.ch/jira/browse/ROOT-10458 to capture this.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.