# Minuit2 not found

**URL:** <https://root-forum.cern.ch/t/minuit2-not-found/19906>\
**Category:** ROOT\
**Created:** [September 27, 2015, 11:07pm UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906 "2015-09-27T23:07:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![acz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@acz](https://root-forum.cern.ch/u/acz)\
**Post date:** [September 27, 2015, 11:07pm UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/1 "2015-09-27T23:07:54Z")

</div>

Hello,

I have been using Minuit2 for parallel fitting in the past. However, when I try to run the program now, I get:

Error in TPluginHandler::SetupCallEnv: class ROOT::Minuit2::Minuit2Minimizer not found in plugin Minuit2  
Warning in ROOT::Math::FitConfig::CreateMinimizer: Could not create the Minuit2 minimizer. Try using the minimizer Minuit

I did compile ROOT with: -Dminuit2=ON

And I do see the following files:  
./etc/plugins/ROOT@@Math@@Minimize/P010\_Minuit2Minimizer.C  
./lib/libMinuit2.rootmap  
./lib/libMinuit2.so.5.34.32  
./lib/libMinuit2.so.5  
./lib/libMinuit2.so

Any suggestions?

Thanks,  
Andreas

---

<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:** [September 28, 2015, 2:05am UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/2 "2015-09-28T02:05:10Z")

</div>

When building your ROOT (5.34/32), [do you use the “prefix” (i.e. “fixed location”) based method or the “location independent” method](https://root-forum.cern.ch/t/missing-canvas/17664/17)?  
If it was the “prefix” (i.e. “fixed location”) based method … check the output of “root-config --etcdir” and see if it points to the “./etc/…” subdirectory which you mention in your post (e.g. it is possible that it points to “/etc/root”).

---

<div class="post-metadata">

**Author:** ![acz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@acz](https://root-forum.cern.ch/u/acz)\
**Post date:** [September 28, 2015, 3:57am UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/3 "2015-09-28T03:57:56Z")

</div>

I always use my own install path when cmake’ing ROOT.  
root-config --etcdir reports:  
/home/andreas/Home/Science/Software/External/root\_v5.34.32/etc

That is the correct directory.

My .rootrc has:  
Unix.\*.Root.PluginPath: :$(ROOTSYS)/etc/plugins:

ROOTSYS points to  
/home/andreas/Home/Science/Software/External/root\_v5.34.32

So everything looks correct. That’s why this is a mystery to me. I am using Ubuntu 14.04

---

<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:** [September 28, 2015, 5:43am UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/4 "2015-09-28T05:43:05Z")

</div>

Can you prepare a small “test” script which demonstrates this problem (I also use Ubuntu 14.04 and ROOT 5.34).  
BTW. Check what’s different between your “.rootrc” and the default “${ROOTSYS}/etc/system.rootrc”.

---

<div class="post-metadata">

**Author:** ![acz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@acz](https://root-forum.cern.ch/u/acz)\
**Post date:** [September 28, 2015, 7:11pm UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/5 "2015-09-28T19:11:57Z")

</div>

Hello,

I attached an example, MinuitError.  
MinuitError.C works, when launched in ROOT via  
.L MinuitError.C++  
MinuitError()

Compiling MinuitError.cxx gives me:  
Error in TPluginHandler::SetupCallEnv: class ROOT::Minuit2::Minuit2Minimizer not found in plugin Minuit2  
Warning in ROOT::Math::FitConfig::CreateMinimizer: Could not create the Minuit2 minimizer. Try using the minimizer Minuit

I compiled it via: g++ -O2 -m64 MinuitError.o -L/home/andreas/Home/Science/Software/External/root\_v5.34.32/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lMinuit2 -lThread -pthread -Wl,-rpath,/home/andreas/Home/Science/Software/External/root\_v5.34.32/lib -lm -ldl -rdynamic -o MinuitError

The .rootrc are identical, expect font sizes.

Thanks for any tips!  
[MinuitError.cxx](https://root-forum.cern.ch/uploads/default/original/2X/9/9e976c353f22d99e4a67b9d7f879a777ec801c2d.cxx) (5.14 KB)  
[MinuitError.C](https://root-forum.cern.ch/uploads/default/original/2X/6/64c4ff7aedc0769a2cb916c954a98702c4938873.C) (5.21 KB)

---

<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:** [September 28, 2015, 7:49pm UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/6 "2015-09-28T19:49:57Z")

</div>

Hi,

This is very strange. I could not reproduce your problem. Did you set the environment correctly before by sourcing the script bin/thisroot.sh ?  
Then, which architecture are you using it ?

Best Regards

Lorenzo

---

<div class="post-metadata">

**Author:** ![acz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@acz](https://root-forum.cern.ch/u/acz)\
**Post date:** [September 28, 2015, 8:43pm UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/7 "2015-09-28T20:43:38Z")

</div>

Hi Lorenzo,

OK. Figured it out! It was a completely different issue:  
Root cannot find Minuit2 if one sets up the HEAsoft environment (i.e. NASA’s fits tools) after setting up ROOT’s environment, but if one calls bin/thisroot.sh last, then everything works.

Thanks a lot for your help!

Cheers,  
Andreas

---

<div class="post-metadata">

**Author:** ![vinchon-thi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/5daacb/32.png) [@vinchon-thi](https://root-forum.cern.ch/u/vinchon-thi)\
**Post date:** [July 19, 2018, 4:41pm UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/8 "2018-07-19T16:41:04Z")

</div>

Hi  
See attached file  
as can be seen with root6, I have the same type of error message “Error in TPluginHandler::SetupCallEnv:”  
I have check the presence of file libminuit2.so and libminuit2.rootmap  
the root-config --etcdir” indicate the location etc under my Root 6 instalaltion directory  
but when I go below I find a P010 file but associated with minuit and not minuit2

 ![Pb%20plugin%20minuit2](https://root-forum.cern.ch/uploads/default/original/3X/3/b/3bb4ce8840a50d5882132c11e73e3d5db44b075d.jpg)  
Thanks in advance for your help

Regards  
Thibaut

---

<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:** [July 19, 2018, 4:52pm UTC](https://root-forum.cern.ch/t/minuit2-not-found/19906/9 "2018-07-19T16:52:18Z")

</div>

That’s o.k. -\> Minuit2 lives in “`plugins/ROOT@@Math@@Minimizer/`”.

Try to execute `root-config --features` and see if you have “minuit2” inside.
