I installed root-6.36.04 on FreeBSD-RELEASE-13.5 as a package, i.e. I did not compile it myself from source. On invoking one of the fitting tutorial scripts like this:
root [0] .x hist032_TRatioPlot_fit_lines.C
I receive the error in the topic title, the full error being:
Warning in <ROOT::Math::FitConfig::CreateMinimizer>: Could not create the Minuit2 minimizer. Try using the minimizer Minuit Error in <ROOT::Math::FitConfig::CreateMinimizer>: Could not create the Minuit2 minimizer Error in <ROOT::Math::Fitter::DoInitMinimizer>: Minimizer cannot be created Warning in <Fit>: Abnormal termination of minimization. <Empty FitResult> Error in <TBackCompFitter::GetConfidenceIntervals>: Cannot compute confidence intervals with an invalide fit result Error in <TBackCompFitter::GetConfidenceIntervals>: Cannot compute confidence intervals with an invalide fit result
Welcome to the ROOT Forum!
As the warning is telling, it doesn’t find the Minuit2 minimizer. So you should look for /usr/local/lib/root/libMinuit2.*. if it’s not here, then it might be an issue with the package manager.
One possible solution could be to change the minimizer in a custom ${HOME}/.rootrc, as:
# Default Fitter (current choices are Minuit, Minuit2, and Fumili).
Root.Fitter: Minuit
Unfortunately, selecting minuit in ~/.rootrc does not work: root can’t find that library either and suggests trying minuit2.
As shown in my original post, the shared libraries for minuit and minuit2 are present in the location placed on LD_LIBRARY_PATH when thisroot.sh is sourced.
Thanks. That looks also correct, so we have to dig deeper.
Can you run this debug macro with root -b -q debug_macro.C and paste the output here? Something seems to be going wrong with
the ROOT plugin system.
Processing debug_macro.C…
Info in TPluginManager::FindHandler: did not find plugin for class ROOT::Math::Minimizer and uri Minuit2
Error in : Trying to dereference null pointer or trying to call routine taking non-null arguments
Execution of your code was aborted.
In file included from input_line_8:1:
/usr/home/rmason/Help/FreeBSD/debug_macro.C:5:5: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
h->LoadPlugin();
In your original post, I can see the files “/usr/local/lib/root/libMinuit*.rootmap” and “/usr/local/lib/root/libMinuit*_rdict.pcm”. It seems to me that these files were present in ROOT 6.18 and earlier. In newer versions, you should only have the “Minuit.pcm” and “Minuit2.pcm” files. So, you may have “mixed” ROOT distributions. Try to uninstall all currently installed ROOT versions, completely remove (at least) the directories “/usr/local/lib/root” and “/usr/local/etc/root”, and then reinstall your new ROOT version.
Update: I can “reproduce” the set of files that you have with: cmake -Dgnuinstall=ON -Druntime_cxxmodules=OFF -Dsoversion=ON ...
cd
echo ROOTSYS is ${ROOTSYS:-EMPTY}
root-config --bindir
which -a root
ldd $(root-config --bindir)/root
which -a root.exe
ldd $(root-config --bindir)/root.exe
root-config --etcdir
root-config --libdir
ls -al $(root-config --libdir)/*Minuit*
ldd $(root-config --libdir)/libMinuit2.so
BTW. Make sure you do not have any “${HOME}/.rootrc”, “${HOME}/rootlogon.C”, “${HOME}/.rootlogon.C” files.
So, it seems some “plugins” directories are missing (e.g., I also have “ROOT@@Internal@@RRawFile”, “ROOT@@Math@@DistSampler”, “ROOT@@Math@@IRootFinderMethod”, “ROOT@@Math@@Minimizer”, “ROOT@@Math@@VirtualIntegrator”).
I am not familiar with your operating system, but … can it be that your ROOT binary distribution is “split” into separate packages? By default, it simply installs a “minimal” ROOT setup, and you may need to install additional packages with additional ROOT features/plugins manually.
On the other hand … you already have the “libMinuit*” files installed, so I don’t understand why the corresponding “plugins/ROOT@@Math@@Minimizer” directory is missing. Try to “find” it: