I am trying to call GSL expint functions. The compiler finds Bessel functions in TMath:: but it appears the “expint” functions are not all available – although I do see expint(double x) and expint_n(int n, double x) in SpecFuncMathMore.cxx. I am simply not sure how to access those directly from my code…
Any suggestions??? Thanks!!!
double ROOT::Math::expint(double x)
Thank you!!! It compiles… CP
It compiles. But I am obviously missing a library – using CMAKE
[ 72%] Linking CXX shared library libHadronResonanceGas.dylib
Undefined symbols for architecture x86_64:
** “ROOT::Math::expint_n(int, double)”**, referenced from:
ParticleType::calculateParticleTypeYield(double, double, double) in ParticleType.cpp.o
“Table2D::Table2D(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >)”, referenced from:
ChemicalPotential::readChemicalPotentialTableFromFile(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in ChemicalPotential.cpp.o
ld: symbol(s) not found for architecture x86_64
You need to add “
-lMathMore” to the linker command line (or “
ROOT::MathMore” in your cmake file) after “
Hello again Wile. Thanks for your help so far. Making progress… The code compiles when and links when adding the reference of MathMore in the CMAKE file used to generate the code. However, I have verified that the call ROOT::Math::expint_n(2*k-2, arg) is consistently returning 0, i.e., zero. Note: I have the same code running outside of the root environment and I can verify the call should yield non vanishing values.
Turns out that TMath::BesselK(…) and TMath::BesselK1(…) are also consistently returning zero…
So it seems the link is not actually resolved …
Are you sure you are calling the functions with the right parameters ?
If it is the case, can you please post your code using Math::Bessel or ROOT::Math::expect that returns a result that is zero?