Cannot find -nameOfLibrary

ROOT Version: 6.22.08
Platform: Ubuntu 20.04 under WSL2
Compiler: gcc 9.3.0

Hi there. I am pretty sure that I’m not the first one to mention this error occur, but I’d like to know how to deal with it in details (what I couldn’t find on internet so far). When I tried to compile a .cxx with -lMathMore flag, it immediately said

/usr/bin/ld: cannot find -lMathMore

I found on the web that I should compile that library first, but my understanding at what am I supposed to do in this case is weak. Could you please provide step-by-step solution for this (bet it would be useful for other people wondering as well)? Also, could you please tell whether it is possible to create custom set of libraries I’d like to use (e.g. unite --glibs and -lMathMore in one flag)? And the last one, how in general do I know which flag contains which library? I mean, when I looked into ROOT: Special functions , I couldn’t tell without additional googling that I am supposed to flag lMathMore.

Please consider me as a person without experience in related topics. Thanks for any help.

$(root-config --glibs) -lMathMore

$(root-config --glibs) returns empty. I tried to use

`root-config --glibs` -lMathMore

That is also fine.

Check: root-config --has-mathmore

It says no

So, you need to (re)build your ROOT from source or just take a pre-compiled binary distribution provided by the ROOT Team.

Could you please tell more about both these options? How exactly do I rebuild ROOT? Is this pre-compiled binary distribution will wipe an issue for any possible library?

Do you actually need MathMore? What happens if you remove -lMathMore from the invocation?

What do you mean “to remove -lMathMore from the invocation”?
I kinda needed some stuff from SpecFunc, but, for a moment, I was able to resolve my needs without it (e.g. used TMath::BesselI0). When I tried to call something from ROOT::Math, my luck ran out. So I’d like to be sure that I know how to actually access stuff from SpecFunc.

OK then let’s go back to what Wile_E proposed. You can download the binary builds we offer for instance for Ubuntu 20.04. You can untar this into a new directory; it will not affect other ROOT installations on your disk.

Thanks for suggestion but could you please explain what do I do exactly? From instruction on Installing ROOT - ROOT I can’t figure how do I get MathMore by downloading this distribution? Am I supposed to install it like usual and use it instead of a previous one? Or am I supposed to import something from here somehow?

You currently have ROOT somewhere. Stop using that and instead rebuild your software with the ROOT version you downloaded and unpacked, possibly providing ROOT’s new location to the configuration of the software, or editing the Makefile, or simply calling source wherever-you-unpacked-ROOT/bin/ and then rebuilding your software - it depends on how its build system finds ROOT. That should be all.

Yes, this precompiled distribution contained all I needed, thanks a lot.

If, by chance, you have a little of time free of urgent matters, I would ask you to answer my other questions that I asked during our discussion; quoted:

echo "$(root-config --noauxlibs --glibs) -lMathMore $(root-config --auxlibs)"
echo "`root-config --noauxlibs --glibs` -lMathMore `root-config --auxlibs`"

I’m specifically asking about following

Hi @Silence2107 - indeed, that’s a problem. We have solved this for classes, see e.g. the graph at bottom of ROOT: TEveCaloViz Class Reference which shows the library to link and its dependencies.

For these functions you can only “guess” because they are within the sections “Special Functions from MathMore”. I don’t know how to improve this with Doxygen.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.