GSL error with elliptic integrals

Hi, I would like to use the elliptic integrals of the first and second kind in my calculations (namely TMath::comp_ellint_1(x) and TMath::comp_ellint_2(x)).

In order to do this, I add this line to the beginning of my code:

#include "gsl/gsl_sf_ellint.h"

, but it results in the following error:

Error: Missing one of ' \/' expected at or after line 29. Error: Unexpected end of file (G__fgetstream():2) /usr/include/gsl/gsl_mode.h:89: *** Interpreter error recovered ***

I’m also attaching the code written by me.

Do you know what could be done about this?

Thank you in advance!
Code.C (533 Bytes)

[code]#include “TSystem.h”
#include “TF1.h”
#include “Math/SpecFunc.h”
#include “Math/WrappedTF1.h”
#include “Math/GaussIntegrator.h”


void Code()
gSystem->Load(“libMathMore”); // needed in ROOT 6 (why?) but not in ROOT 5
float V;
TF1 f(“f”, “TMath::Exp(-1/x)(1/x^2)(ROOT::Math::comp_ellint_1(x)-ROOT::Math::comp_ellint_2(x)/(1-x^2))”, 0, 0.99);
ROOT::Math::WrappedTF1 wf(f);
ROOT::Math::GaussIntegrator ig;
V = ig.Integral(0, 0.99);
std::cout << "V = " << V << std::endl;

Thank you, but it didn’t help; your code gives exactly the same error.

Just for reference: I’m using Root 5.34 (i. e. the older version), and I built it with the following settings:

I run the modified macro with ROOT 5.34/36 and 6.08/00 and in both cases I get “V = -0.620356” (not sure if it is correct or not).

Try to execute (see if you get “yes” or “no”):
root-config --has-mathmore

I already did that, and got “yes”; in fact, I have no problem using other Mathmore functions, like GaussIntegrator.

Oh, it just worked. Thank you very much! :smiley: