Could not create the Minuit2 minimizer


Hello,

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

I have checked that the relevant files exist:

/usr/local/lib/root/libMinuit.rootmap      /usr/local/lib/root/libMinuit.so.6.36.04*  /usr/local/lib/root/libMinuit2.so.6.36@    /usr/local/lib/root/libMinuit_rdict.pcm
/usr/local/lib/root/libMinuit.so@          /usr/local/lib/root/libMinuit2.rootmap     /usr/local/lib/root/libMinuit2.so.6.36.04*
/usr/local/lib/root/libMinuit.so.6.36@     /usr/local/lib/root/libMinuit2.so@         /usr/local/lib/root/libMinuit2_rdict.pcm

I have sourced thisroot.sh and checked LD_LIBRARY_PATH:

/usr/local/lib/root::/home/rmason/.local/lib

root-config –etcdir:

/usr/local/etc/root

That directory is populated:

HistFactorySchema.dtd      class.rules                gitinfo.txt                notebook/                  proof/                     system.rootauthrc          valgrind-root.supp
Makefile.arch              cling/                     helgrind-root.supp         pdg_table.txt              root.desktop               system.rootdaemonrc
RadioNuclides.txt          dictpch/                   html/                      pdg_table_update.py*       root.mimes                 system.rootrc
allDict.cxx.pch            gdb-backtrace.sh*          lsan-root.supp             plugins/                   runfirefox.sh*             valgrind-root-python.supp

I think this is a configuration issue, but I don’t know what to try next. I appreciate any help offered.

Thank you.

sprock

ROOT Version: root-6.36.04
Platform: FreeBSD-RELEASE-13.5
Compiler: Not Provided


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

Thank you for your response.

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 again.

sprock

Oh, yes, sorry I overlooked at your original post. Then this looks weird. Maybe @moneta has an idea about what could be the issue

The checks you did are already very helpful, thanks! But there is one thing that could still go wrong that you didn’t check.

Does ROOT find the right etcdir at runtime? What is the output when you run gROOT->GetEtcDir() in the ROOT interpreter?

Hello,

Jonas Rembser via ROOT Forum root.discourse@cern.ch writes:

  • jonas
    November 17

The checks you did are already very helpful, thanks! But there is one thing that could still go wrong that you didn’t check.

Does ROOT find the right etcdir at runtime? What is the output when you run gROOT->GetEtcDir() in the ROOT interpreter?


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

gROOT->GetEtcDir()
(const TString &) “/usr/local/etc/root”[19]

Thank you for your help.

sprock

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.

void debug_macro() {

    gDebug = 3;
    auto h = gROOT->GetPluginManager()->FindHandler("ROOT::Math::Minimizer", "Minuit2");
    h->LoadPlugin();
    auto * min = (ROOT::Math::Minimizer *)( h->ExecPlugin(1,"migrad" ) );
    std::cout << min << std::endl;
}

Hi Jonas,

Jonas Rembser via ROOT Forum root.discourse@cern.ch writes:

  • jonas
    November 18

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();

Thanks again,
sprock

I still have the same problem. I now have root-6.38.00 installed.

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 ...

Thanks for the advice.

I have done as you suggest, but to no avail, unfortunately.

Try:

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.

ROOTSYS is
root-config --bindir: /usr/local/bin
which -a root: /usr/local/bin/root
ldd $(root-config --bindir)/root
/usr/local/bin/root:
libutil.so.9 => /lib/libutil.so.9 (0x34c9bbe4c000)
libprocstat.so.1 => /usr/lib/libprocstat.so.1 (0x34c9bc6fc000)
libc++.so.1 => /usr/lib/libc++.so.1 (0x34c9bd79d000)
libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x34c9bd3c9000)
libm.so.5 => /lib/libm.so.5 (0x34c9bef9b000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x34c9be14d000)
libthr.so.3 => /lib/libthr.so.3 (0x34c9bfc1b000)
libc.so.7 => /lib/libc.so.7 (0x34c9c0bf6000)
libelf.so.2 => /lib/libelf.so.2 (0x34c9c1278000)
libkvm.so.7 => /lib/libkvm.so.7 (0x34c9c139e000)
[vdso] (0x7ffffffff000)

root-config --etcdir: /usr/local/etc/root
root-config --libdir: /usr/local/lib/root

ls -al $(root-config --libdir)/Minuit
-rw-r–r-- 1 root wheel 283 Mar 26 17:41 /usr/local/lib/root/libMinuit.rootmap
lrwxr-xr-x 1 root wheel 17 Mar 26 17:44 /usr/local/lib/root/libMinuit.so@ → libMinuit.so.6.38
lrwxr-xr-x 1 root wheel 20 Mar 26 17:44 /usr/local/lib/root/libMinuit.so.6.38@ → libMinuit.so.6.38.00
-rwxr-xr-x 1 root wheel 415960 Mar 26 17:44 /usr/local/lib/root/libMinuit.so.6.38.00*
-rw-r–r-- 1 root wheel 2098 Mar 26 17:41 /usr/local/lib/root/libMinuit2.rootmap
lrwxr-xr-x 1 root wheel 18 Mar 26 17:44 /usr/local/lib/root/libMinuit2.so@ → libMinuit2.so.6.38
lrwxr-xr-x 1 root wheel 21 Mar 26 17:44 /usr/local/lib/root/libMinuit2.so.6.38@ → libMinuit2.so.6.38.00
-rwxr-xr-x 1 root wheel 941976 Mar 26 17:44 /usr/local/lib/root/libMinuit2.so.6.38.00*
-rw-r–r-- 1 root wheel 668 Mar 26 17:41 /usr/local/lib/root/libMinuit2_rdict.pcm
-rw-r–r-- 1 root wheel 664 Mar 26 17:41 /usr/local/lib/root/libMinuit_rdict.pcm

ldd $(root-config --libdir)/libMinuit2.so
/usr/local/lib/root/libMinuit2.so:
libHist.so.6.38 => /usr/local/lib/root/./libHist.so.6.38 (0x1292bd1f4000)
libMatrix.so.6.38 => /usr/local/lib/root/./libMatrix.so.6.38 (0x1292bdc56000)
libMathCore.so.6.38 => /usr/local/lib/root/./libMathCore.so.6.38 (0x1292bf2fe000)
libImt.so.6.38 => /usr/local/lib/root/./libImt.so.6.38 (0x1292be7b4000)
libMultiProc.so.6.38 => /usr/local/lib/root/./libMultiProc.so.6.38 (0x1292c0b1b000)
libNet.so.6.38 => /usr/local/lib/root/./libNet.so.6.38 (0x1292bf52c000)
libRIO.so.6.38 => /usr/local/lib/root/./libRIO.so.6.38 (0x1292bf9c6000)
libThread.so.6.38 => /usr/local/lib/root/./libThread.so.6.38 (0x1292c23e8000)
libCore.so.6.38 => /usr/local/lib/root/./libCore.so.6.38 (0x1292c4800000)
libutil.so.9 => /lib/libutil.so.9 (0x1292c17bd000)
libprocstat.so.1 => /usr/lib/libprocstat.so.1 (0x1292c2abc000)
libthr.so.3 => /lib/libthr.so.3 (0x1292c3900000)
libc++.so.1 => /usr/lib/libc++.so.1 (0x1292c60e3000)
libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x1292c4d93000)
libm.so.5 => /lib/libm.so.5 (0x1292c557d000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x1292c7207000)
libc.so.7 => /lib/libc.so.7 (0x1292b98ba000)
libtbb.so.12 => /usr/local/lib/libtbb.so.12 (0x1292c761e000)
libssl.so.111 => /usr/lib/libssl.so.111 (0x1292c8078000)
libcrypto.so.111 => /lib/libcrypto.so.111 (0x1292c97d8000)
libpcre2-8.so.0 => /usr/local/lib/libpcre2-8.so.0 (0x1292c8fb1000)
libz.so.6 => /lib/libz.so.6 (0x1292c6d67000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x1292caf2b000)
libxxhash.so.0 => /usr/local/lib/libxxhash.so.0 (0x1292ca243000)
liblz4.so.1 => /usr/local/lib/liblz4.so.1 (0x1292cb14c000)
libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0x1292cb954000)
libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x1292cc617000)
libelf.so.2 => /lib/libelf.so.2 (0x1292b8996000)
libkvm.so.7 => /lib/libkvm.so.7 (0x1292cc6fb000)
libmd.so.6 => /lib/libmd.so.6 (0x1292cc806000)

Try to use a “curated”/“minimal”:
LD_LIBRARY_PATH=/usr/local/lib/root

Also, check other variables:
export | grep -i "root"

export | grep -i “root”
DYLD_LIBRARY_PATH=/usr/local/lib/root
GEM_ROOT=/usr/home/rmason/.rubies/ruby-3.2.8/lib/ruby/gems/3.2.0
LD_LIBRARY_PATH=/usr/local/lib/root:/usr/local/lib/root
LIBPATH=/usr/local/lib/root
OLDPWD=/home/rmason/Software/Test/Root/Fitting
PERL_LOCAL_LIB_ROOT=/home/rmason/perl5:/home/rmason/perl5
PWD=/home/rmason/Software/Test/Root/Fitting/FittingDemo
PYTHONPATH=/usr/local/lib/root:/home/rmason/.local/cctools/lib/python3.9/site-packages
ROOTSYS=/usr/local
ROOT_INCLUDE_PATH=‘’
RUBY_ROOT=/home/rmason/.rubies/ruby-3.2.8
SHLIB_PATH=/usr/local/lib/root

Thank you for your help.

Well, these variables seem fine, so I don’t know why the debug_macro.C misbehaves.

Check if there are files in:
ls -al /usr/local/etc/root/plugins/ROOT@@Math@@Minimizer/

ls: /usr/local/etc/root/plugins/ROOT@@Math@@Minimizer/: No such file or directory

That’s the “problem” then …

Try:

echo etcdir is $(root-config --etcdir)
ls -al $(root-config --etcdir)/plugins/ROOT@@Math@@Minimizer/
ls -al $(root-config --etcdir)/plugins/

echo etcdir is $(root-config --etcdir): etcdir is /usr/local/etc/root

ls -al $(root-config --etcdir)/plugins/ROOT@@Math@@Minimizer/
ls: /usr/local/etc/root/plugins/ROOT@@Math@@Minimizer/: No such file or directory

ls -al $(root-config --etcdir)/plugins/
total 79
drwxr-xr-x 45 root wheel 45 Apr 28 12:25 ./
drwxr-xr-x 7 root wheel 26 Apr 28 12:25 ../
drwxr-xr-x 2 root wheel 4 Apr 28 12:25 TApplication/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TArchiveFile/
drwxr-xr-x 2 root wheel 5 Apr 28 12:25 TBrowserImp/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TCanvasImp/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TControlBarImp/
drwxr-xr-x 2 root wheel 9 Apr 28 12:25 TFile/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TFileDrawMap/
drwxr-xr-x 2 root wheel 4 Apr 28 12:25 TFileStager/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TFitEditor/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TGLHistPainter/
drwxr-xr-x 2 root wheel 5 Apr 28 12:25 TGLManager/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TGPasswdDialog/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TGeoManagerEditor/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TGuiBuilder/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TGuiFactory/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TImage/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TImagePlugin/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TMinuitGraph/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TPaletteEditor/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TSQLServer/
drwxr-xr-x 2 root wheel 7 Apr 28 12:25 TSystem/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TView/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TViewerX3D/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualAuth/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualDragManager/
drwxr-xr-x 2 root wheel 6 Apr 28 12:25 TVirtualFFT/
drwxr-xr-x 2 root wheel 4 Apr 28 12:25 TVirtualFitter/
drwxr-xr-x 2 root wheel 4 Apr 28 12:25 TVirtualGLImp/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualGeoChecker/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualGeoConverter/
drwxr-xr-x 2 root wheel 4 Apr 28 12:25 TVirtualGeoPainter/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualGraphPainter/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualHistPainter/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualMonitoringWriter/
drwxr-xr-x 2 root wheel 7 Apr 28 12:25 TVirtualPS/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualPad/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualPadEditor/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualPadPainter/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualStreamerInfo/
drwxr-xr-x 2 root wheel 3 Apr 28 12:25 TVirtualTreePlayer/
drwxr-xr-x 2 root wheel 4 Apr 28 12:25 TVirtualTreeViewer/
drwxr-xr-x 2 root wheel 5 Apr 28 12:25 TVirtualViewer3D/
drwxr-xr-x 2 root wheel 6 Apr 28 12:25 TVirtualX/

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:

find $(root-config --etcdir) -name "*@@*"
grep -r Minuit2Minimizer $(root-config --etcdir)
find $(root-config --libdir) -name "*@@*"
grep -r Minuit2Minimizer $(root-config --libdir)