Cannot link to functions from MathMore

Hi,
I need to use some quantile functions from MathMore (in particular tdistribution_quantile_c) and so I have already installed last version of ROOT (5.26) also building MathMore.
But when I try to use the function tdistribution_quantile_c in my code, the compilation is ok but the procedure of linking fails:

undefined reference to `ROOT::Math::tdistribution_quantile_c(double, double)’

If this can help the libraries that I use for the linking are the usual ones (root-config --glibs). I have also tried adding (gsl-config --libs) but nothing changed.
What are the missing ingredient to use this kind of functions? Some particular header? Where can I find some documentation?

Thanks
Pierpaolo

Hi Pierpaolo,

root-config --glibs doesn’t include MathMore (just type “root-config --glibs” in the terminal to see the list), so you have to add “-lMathMore” to the list (root-config --glibs -lMathMore)

Cheers, Bertrand.

1 Like

Hi Bertrand and many thanks!
But after having added -lMathMore I get a different error mesage:

/usr/local/analyze/ROOT/lib/libMathMore.so: undefined reference to `gsl_multimin_fdfminimizer_vector_bfgs2’

the list I’m currently using for the linking is :
-g -O -o /usr/local/analyze/analysis/ab_test/ab_test /usr/local/analyze/analysis/ab_test/obj/ab_test.o /usr/local/analyze/analysis/storage/common/obj/User.o /usr/local/analyze/analysis/ab_test/obj/MyDict.o -L/usr/local/analyze/ROOT/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lGui -pthread -lm -ldl -rdynamic -lMathMore

did I forget something else?
cheers
Pierpaolo

Hi,
the are some inconsistencies in your build of MathMore. Apparently you are using headers from a new version of GSL, but linking with an older library.
I would suggest to re-configure ROOT with correct value of gsl-libdir and gsl-incdir and rebuild MathMore

Best Regards

Lorenzo

Hi, I followed your suggestion and I reconfigured with the following options:

configure --enable-roofit --enable-gsl-shared --enable-mathmore --with-gsl-incdir=/usr/local/include --with-gsl-libdir=/usr/local/lib

but again, when I try to build mi executable I get:

/usr/local/analyze/ROOT/lib/libMathMore.so: undefined reference to `gsl_multimin_fdfminimizer_vector_bfgs2’

May be due to the option --enable-gsl-shared? But I have also tried without this option enabled (but with --enable-mathmore) and in that case the libMathMore is not build at all!

So there is still something I’m missing…

cheers
Pierpaolo

Hi,

if you are using a shared GSL library, you should be then add th library location to your LD_LIBRARY_PATH. I guess you are loading an old gsl version from /usr/lib or similar.
Without enable-shared it should work, but you might need to have a build of GSL with -fPIC. To do that you need to re-configure and build GSL with --with-pic

Best Regards

Lorenzo

Thanks Lorenzo,
so that’s the reason! In fact GSL has NOT been build with -fPIC…

I’ll try it!

thanks
Pierpaolo

Dear All,
I get the same type of Pb as can be seen in the attached hardcopy
the file ROOTConfif-targets.cmake can be found under directory /usr/share/root/cmake and refers to MathMore
effectively No libmathmore.so is found under /user/lib64/root but its can be found in the directory where root6 was installed.
• So where is the lib path defined for cmake?
• Can it be redefined?

Thanks in advance for help
Thibaut