TMinuit is missing from ROOT installation

Hello,

I am trying to use TGraph and TF1 to do some simple curve fitting.

TGraph* ENDF1 = new TGraph(6,x,y); TF1 *linfit = new TF1("linfit","[0]+[1]*x",-5,0); linfit->FixParameter(1,-0.5); ENDF1->Fit(linfit,"qr"); linfit->GetParameters(fitpar);

This works great on my old machine, no problem. However, I am transferring to a new machine, and I am getting a strange error that I have not seen before:

Warning in <ROOT::Math::FitConfig::CreateMinimizer>: Could not create the Minuit minimizer. Try using the minimizer Minuit2 Error in <ROOT::Math::FitConfig::CreateMinimizer>: Could not create the Minuit2 minimizer Error in <ROOT::Math::Fitter::FitFCN>: Minimizer cannot be created

What is wrong? Is this syntax or something missing from the ROOT compile?

Minuit2 is one of the optional parts of ROOT, so maybe your newer install disabled it?

IIRC, it’s enabled by default, but if you did --minimal or --gminimal, it’ll be disabled. You can explicitly select it with --enable-minuit2 or --disable-minuit2.

Jean-François

[quote=“jfcaron”]Minuit2 is one of the optional parts of ROOT, so maybe your newer install disabled it?

IIRC, it’s enabled by default, but if you did --minimal or --gminimal, it’ll be disabled. You can explicitly select it with --enable-minuit2 or --disable-minuit2.

Jean-François[/quote]

I have requested a rebuild with Minuit2.

However, they did not use a minimal install. In this case, shouldn’t Minuit1 still be available? What could cause Minuit1 to be missing?

Hello,

I have rebuilt with Minuit2.

I still get the same errors. The code cannot find either Minuit or Minuit2 for minimizations.

There is no --minimal flag in the configure script. What could be causing this?

Sorry that’s the only thing I could think of to check. I looked at my .rootrc file and the system.rootrc file, and there is room there to set a parameter for Root.Fitter that defaults to “Minuit”. It’s worth checking, but that’s probably not it.

You could try a few of the example scripts in tutorials/fit (in the share directory if you have a system-wide install) to see if it’s limited to certain fitting routines or to everything.

Eventually a real ROOT expert will need to answer. I’m just trying to help as a fellow user.

Jean-François

You are missing proper ROOT’s “etcdir”. Try to run “root-config --etcdir” and see if the returned subdirectory exists and if it contains your ROOT’s version specific files (it might be that this subdirectory exists but it contains files from some previous / outdated ROOT installation).
See the “Installing ROOT 5 from Source” web page.
Try to build your ROOT from scratch using something like:

unset ROOTSYS
./configure --prefix=/usr/local --etcdir=/usr/local/etc/root --enable-explicitlink --enable-soversion --all
make
sudo make install

BTW. Honestly speaking, sooner or later, you will learn by hard that the policy of using a “system-provided” ROOT version (e.g. in “/usr/local”) is a dead end. You will learn that you need something like three different versions of ROOT - just because something that works with a particular version is not working with another ones. The safest approach is to “completely remove” all “system-provided” ROOT related packages and install all needed versions of ROOT from scratch, each version in a different “version specific” ROOTSYS subdirectory (e.g. something like “/opt/ROOT/v5-32-04”, “/opt/ROOT/v5-34-18”, “/opt/ROOT/v5-34-00-patches” and so on) - see, for example, [url=https://root-forum.cern.ch/t/installing-root-from-source/13647/1 old post[/url].

[quote=“Wile E. Coyote”]You are missing proper ROOT’s “etcdir”. Try to run “root-config --etcdir” and see if the returned subdirectory exists and if it contains your ROOT’s version specific files (it might be that this subdirectory exists but it contains files from some previous / outdated ROOT installation).
See the “Installing ROOT from Source” web page.
Try to build your ROOT from scratch using something like:

unset ROOTSYS ./configure --prefix=/usr/local --etcdir=/usr/local/etc/root --enable-explicitlink --enable-soversion --all make sudo make install
BTW. Honestly speaking, sooner or later, you will learn by hard that the policy of using a “system-provided” ROOT version (e.g. in “/usr/local”) is a dead end. You will learn that you need something like three different versions of ROOT - just because something that works with a particular version is not working with another ones. The safest approach is to “completely remove” all “system-provided” ROOT related packages and install all needed versions of ROOT from scratch, each version in a different “version specific” ROOTSYS subdirectory (e.g. something like “/opt/ROOT/v5-32-04”, “/opt/ROOT/v5-34-18”, “/opt/ROOT/v5-34-00-patches” and so on) - see, for example, [url=https://root-forum.cern.ch/t/installing-root-from-source/13647/1 old post[/url].[/quote]

I’m using ROOT on a cluster, so I have to use their installation in order to have it available to all instances.

I read the source install instructions, and I will see if I can figure out how to make this etcdir work. I don’t see an etcdir in the install directory, but there is one on the system in a different place. I’ll try to correct this.

[quote=“Wile E. Coyote”]You are missing proper ROOT’s “etcdir”. Try to run “root-config --etcdir” and see if the returned subdirectory exists and if it contains your ROOT’s version specific files (it might be that this subdirectory exists but it contains files from some previous / outdated ROOT installation).
See the “Installing ROOT from Source” web page.
Try to build your ROOT from scratch using something like:

unset ROOTSYS ./configure --prefix=/usr/local --etcdir=/usr/local/etc/root --enable-explicitlink --enable-soversion --all make sudo make install
BTW. Honestly speaking, sooner or later, you will learn by hard that the policy of using a “system-provided” ROOT version (e.g. in “/usr/local”) is a dead end. You will learn that you need something like three different versions of ROOT - just because something that works with a particular version is not working with another ones. The safest approach is to “completely remove” all “system-provided” ROOT related packages and install all needed versions of ROOT from scratch, each version in a different “version specific” ROOTSYS subdirectory (e.g. something like “/opt/ROOT/v5-32-04”, “/opt/ROOT/v5-34-18”, “/opt/ROOT/v5-34-00-patches” and so on) - see, for example, [url=https://root-forum.cern.ch/t/installing-root-from-source/13647/1 old post[/url].[/quote]

Thank you, this fixed that problem. I thought setting the prefix would set the directory locations properly initially.

I also found it strange that the prefix during ./configure applies to everything except the etcdir. I wonder if there is a good reason for that.

Jean-François