# GSL expint not found

**URL:** <https://root-forum.cern.ch/t/gsl-expint-not-found/43336>\
**Category:** General Chat\
**Created:** [January 31, 2021, 9:03pm UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336 "2021-01-31T21:03:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpruneau](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@cpruneau](https://root-forum.cern.ch/u/cpruneau)\
**Post date:** [January 31, 2021, 9:03pm UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336/1 "2021-01-31T21:03:52Z")

</div>

Hi–  
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!!!  
Claude

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 31, 2021, 9:57pm UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336/2 "2021-01-31T21:57:27Z")

</div>

`#include "Math/SpecFunc.h"`

`double ROOT::Math::expint(double x)`

---

<div class="post-metadata">

**Author:** ![cpruneau](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@cpruneau](https://root-forum.cern.ch/u/cpruneau)\
**Post date:** [January 31, 2021, 10:15pm UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336/3 "2021-01-31T22:15:14Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> #include “Math/SpecFunc.h”

Thank you!!! It compiles… CP

---

<div class="post-metadata">

**Author:** ![cpruneau](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@cpruneau](https://root-forum.cern.ch/u/cpruneau)\
**Post date:** [January 31, 2021, 10:49pm UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336/4 "2021-01-31T22:49:49Z")

</div>

Hi Wile  
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

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 31, 2021, 11:07pm UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336/5 "2021-01-31T23:07:42Z")

</div>

You need to add “`-lMathMore`” to the linker command line (or “`ROOT::MathMore`” in your cmake file) after “`${ROOT_LIBRARIES}`”.

---

<div class="post-metadata">

**Author:** ![cpruneau](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@cpruneau](https://root-forum.cern.ch/u/cpruneau)\
**Post date:** [February 1, 2021, 6:38pm UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336/6 "2021-02-01T18:38:19Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> ROOT::MathMore

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.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![cpruneau](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@cpruneau](https://root-forum.cern.ch/u/cpruneau)\
**Post date:** [February 1, 2021, 6:47pm UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336/7 "2021-02-01T18:47:48Z")

</div>

Turns out that TMath::BesselK(…) and TMath::BesselK1(…) are also consistently returning zero…  
So it seems the link is not actually resolved …  
CP

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [February 2, 2021, 8:13am UTC](https://root-forum.cern.ch/t/gsl-expint-not-found/43336/8 "2021-02-02T08:13:53Z")

</div>

Hi,  
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?

Cheers

Lorenzo
