On the possibility of updating Minuit2 to be based on ROOT 6 sources

As part of working on packaging third-party libraries in conda, I’m looking at actually trying to build/package minuit2 from the ROOT source code. This would be added to conda-forge.

Minuit2 is now packaged in the ROOT source code with its own standalone CMakeLists.txt file, intended for standalone builds. The Goofit/Minuit2 repository effectively pulls this in occasionally. The iminuit project, a python interface over Minuit2, also copies from the upstream ROOT repository into the repo.

LSST would be moving from the ROOT 5.34 version to a ROOT 6.19.01 version.

I don’t think Minuit2 gets touched much, but this should also make it so that, when changes do happen to Minuit2, we get them faster, because CERN doesn’t appear to make standalone releases of Minuit2 anymore.

I’d like to know if anybody has any concerns with this.

I will work on getting a changelog of what has been changed between the versions.

Edit: Some clarification as to why I’m asking - This is one of the few third party libraries that has changed a major version, although it doesn’t appear the Minuit2 code itself has actually changed much between ROOT 5 and ROOT 6.

AFAIK, we use minuit2 only in afw and ip_diffim (this is from a hunch and some pretty cursory grepping, so it’s possible I’m wrong about this). In the former it’s only to create a thin wrapper class that (AFAIK) we then don’t use anywhere else. In the latter it’s used only for DipoleAlgorithm. I’m not sure if that’s regularly being run in image differencing (hopefully someone from UW can chime in), but it isn’t, perhaps we can just drop it and minuit2 with it, instead of putting any effort into updating to a new version (or repackaging it, for that matter).

I’d much prefer for new code to use scipy minimization algorithms, and if we really need nonlinear optimization in C++, there are other packages (nlopt, ceres, levmar) I’d consider to be better choices than minuit today.

1 Like

Also used in meas_algorithms (and meas_mosaic).

I’m not sure what version this uses, but I’d like to be able to use imuniut at some point in the future:


(apologies for not digging more but I’m about to go on vacation and am sorting out lots of stuff, but thought I shouldn’t wait till next week to mention that)

A new Minuit2 package was added to conda-forge:


… which can use the either minuit2_standalone (https://anaconda.org/conda-forge/minuit2_standalone) or ROOT (1) as build variants to supply the relevant minuit2 libraries.

iminuit (https://anaconda.org/conda-forge/iminuit) currently uses it’s own vendored version of Minuit2 that it builds which you cannot link to, so that was was not usable by us directly. It’s no problem to use iminuit. In an ideal world, iminuit would probably depend on the minuit2 package in conda and not build its own version of Minuit2.

(1) Nobody in DM will use ROOT, but if somebody does install ROOT in the conda environment they use for their stack, they shouldn’t see any issues with linking or anything like that.