Re-execution of previously compiled scripts

Hi,

in the olden days of ROOT5 I developed a way of using scripts that combines the advantages of scripts with compiled stuff. Basically, I have a driver script which is interpreted, and loads all the necessary stuff, and it then compiles and executes the script proper. A typical driver script looks like this:

[code]void
phasespace()
{
Int_t error;
gROOT->ProcessLine(".x compasspub.C");
gROOT->ProcessLine(".L labelPlot.C+");
gROOT->ProcessLine(".L …/…/work/results/PAWstring.C+", &error);
if (error != TInterpreter::kNoError)
{
cerr << “couldn’t load PAW string library” << endl;
return;
}
gROOT->ProcessLine(".L …/…/work/results/WaveExplorer.C+", &error);
if (error != TInterpreter::kNoError)
{
cerr << “couldn’t load WaveExplorer library, error: " << error << endl;
return;
}
gROOT->ProcessLine(”.L mainPS.C+", &error);
if (error != TInterpreter::kNoError)
{
cerr << “couldn’t load main library” << endl;
return;
}

mainPS("…/…/res_pi03pi_dima/hfit_Dima_int_widen_2.root",
"…/…/res_pi03pi_dima/sfit.dat",
"…/…/res_eta3pi_widen_int/hfit_spin56_0++.root",
"…/…/res_eta3pi_widen_int/sfit_spin56_0++.dat",
"_noshift");
}
[/code]You see that it compiles and loads a number of utility libraries and then executes a function from one of them.

With ROOT6 this works the first time I run the script (I always start a new root instance from the command line, i.e., I run ‘root phasespace.C’ from my shell), but at the second invocation I get an error:

[code]Processing phasespace.C…
Using COMPASS style from compasspub.C

couldn’t load WaveExplorer library, error: 1[/code]
Deleting …/…/work/results/WaveExplorer.so allows me to run again. The bug only seems to affect WaveExplorer.C (which uses some ROOT GUI libraries, and which compiles without errors or warnings), but the only information I can give you is the return code printed above. If there’s any way I could give you more useful information for debugging, please let me know.

I looked a bit further into this, the issue appears to be that the meaning of error changed (or maybe it is not correctly set in gROOT->ProcessLine?) – the script is actually loaded FAICT. If I remove the error check, it executes fine.

Edit: ok, there is a kRecoverable status nowadays. Consider this solved. :smiley: Some human-interpretable information on the recoverable error, would be nice though.

Hi,

I don’t think this was an intentional change of behavior. See sft.its.cern.ch/jira/browse/ROOT-6127

Cheers, Axel.

Thanks! It certainly was a surprise, I changed my code to check for “err > TInterpreter::kRecoverable”. I actually remember having to search for the meaning of these return values in the ROOT source code proper when I originally wrote this code.