Masking of GSL errors in IPython-PyROOT-ROOT


The attached python script is a simplified test case which raises a GSL error.
On one computer, this results in gsl: /tmp/root_build/GSL-prefix/src/GSL/integration/qags.c:563: ERROR: integral is divergent, or slowly convergent Default GSL error handler invoked.
On another computer I use, the script finished successfully, presumably because ROOT catches the error, as Math/GSLError.h is supposed to. The output is:Error in <GSLError>: Error 22 in qags.c at 563 : integral is divergent, or slowly convergent Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1 FCN=3475.68 FROM MIGRAD STATUS=CONVERGED 216 CALLS 217 TOTAL EDM=1.00395e-08 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 Constant 8.90292e+02 1.00000e+00 2.87907e-02 1.38973e-04 2 Mean 4.02413e+00 3.35890e+00 2.77267e-03 -5.84287e-06 3 Sigma 3.34794e-03 1.00437e+01 2.41128e-03 -8.22496e-06

Both are Linux machines with ROOT 5.34 installed (5.34.32 in the 2nd computer, 5.34.34 in the 1st computer).

Any ideas on:

  1. what configuration differences can be relevant?
  2. how do I mask the GSL errors myself, from the iPython–PyROOT interface? I don’t see how to access an existing GSLError object (there is none visible in the ROOT.TMath namespace), and GSLError.h isn’t even in root installation’s include/Math directory.

Amnon (460 Bytes)

BTW: the solution of Error handling for the integrator function in Mathmore no longer works. Linking fails with

... test2_c_ACLiC_dict.o: In function `_GLOBAL__sub_I_test2_c_ACLiC_dict.cxx':
test2_c_ACLiC_dict.cxx:(.text.startup+0x43): undefined reference to `gsl_set_error_handler'
collect2: error: ld returned 1 exit status


if you explicitly load gsl or touch any classes that bring it in implicitly, then that linker error will go away. Otherwise, this is not a python-related question and you’re probably better off re-asking the question on the general forum.