Skip to content

Commit 6ff6266

Browse files
committed
[CMake] Always build Minuit2
In the discussion thread to JIRA ticket ROOT-10864, Axel suggested the removal of the option to disable minuit2 as a possible solution. I think this is a very good idea good idea, because: * Minuit2 only depends on `Hist` and `MathCore` anyway. * Now that Minuit2 is the default for *all* minimization in ROOT, building ROOT without Minuit2 changes the behavior of ROOT way too much, in a ways that people that set `minuit2=OFF` probably are not intending or aware of. This closes the following JIRA ticket: https://sft.its.cern.ch/jira/browse/ROOT-10864
1 parent 46642ca commit 6ff6266

File tree

8 files changed

+10
-44
lines changed

8 files changed

+10
-44
lines changed

cmake/modules/RootBuildOptions.cmake

+2-9
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ ROOT_BUILD_OPTION(libcxx OFF "Build using libc++")
141141
ROOT_BUILD_OPTION(macos_native OFF "Disable looking for libraries, includes and binaries in locations other than a native installation (MacOS only)")
142142
ROOT_BUILD_OPTION(mathmore OFF "Build libMathMore extended math library (requires GSL) [GPL]")
143143
ROOT_BUILD_OPTION(memory_termination OFF "Free internal ROOT memory before process termination (experimental, used for leak checking)")
144-
ROOT_BUILD_OPTION(minuit2 ON "Build Minuit2 minimization library")
144+
ROOT_BUILD_OPTION(minuit2 IGNORE "Build Minuit2 minimization library (deprecated, Minuit2 is always built)")
145145
ROOT_BUILD_OPTION(minuit2_mpi OFF "Enable support for MPI in Minuit2")
146146
ROOT_BUILD_OPTION(minuit2_omp OFF "Enable support for OpenMP in Minuit2")
147147
ROOT_BUILD_OPTION(mpi OFF "Enable support for Message Passing Interface (MPI)")
@@ -239,7 +239,6 @@ if(all)
239239
set(fcgi_defvalue ON)
240240
set(imt_defvalue ON)
241241
set(mathmore_defvalue ON)
242-
set(minuit2_defvalue ON)
243242
set(monalisa_defvalue ON)
244243
set(mysql_defvalue ON)
245244
set(odbc_defvalue ON)
@@ -372,12 +371,6 @@ endif()
372371
#---Define at moment the options with the selected default values------------------------------
373372
ROOT_APPLY_OPTIONS()
374373

375-
# RooFit multiprocess only works with Minuit2. In fact, it depends on it at build time.
376-
if(roofit_multiprocess AND NOT minuit2)
377-
message(WARNING "Option 'roofit_multiprocess' requires option `minuit2`. We're setting `minuit2=ON` for you. Consider setting `minuit2=ON` yourself to silence this warning.")
378-
set(minuit2 ON CACHE BOOL "" FORCE)
379-
endif()
380-
381374
#---roottest option implies testing
382375
if(roottest OR rootbench)
383376
set(testing ON CACHE BOOL "" FORCE)
@@ -419,7 +412,7 @@ foreach(opt afdsmgrd afs alien bonjour castor chirp cxx11 cxx14 cxx17 geocad gfa
419412
endforeach()
420413

421414
#---Deprecated options------------------------------------------------------------------------
422-
foreach(opt cxxmodules exceptions oracle pythia6 pythia6_nolink pyroot-python2)
415+
foreach(opt cxxmodules exceptions oracle pythia6 pythia6_nolink pyroot-python2 minuit2)
423416
if(${opt})
424417
message(DEPRECATION ">>> Option '${opt}' is deprecated and will be removed in the next release of ROOT. Please contact [email protected] should you still need it.")
425418
endif()

cmake/modules/RootConfiguration.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ set(gslflags)
301301
set(shadowpw ${value${shadowpw}})
302302
set(buildmathmore ${value${mathmore}})
303303
set(buildroofit ${value${roofit}})
304-
set(buildminuit2 ${value${minuit2}})
305304
set(buildunuran ${value${unuran}})
306305
set(buildgdml ${value${gdml}})
307306
set(buildhttp ${value${http}})

math/CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ if(mathmore)
1010
endif()
1111
add_subdirectory(matrix)
1212
add_subdirectory(minuit)
13-
if(minuit2)
14-
add_subdirectory(minuit2)
15-
endif()
13+
add_subdirectory(minuit2)
1614
add_subdirectory(fumili)
1715
add_subdirectory(physics)
1816
add_subdirectory(mlp)

math/mathcore/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,6 @@ foreach(incl ${math_incl})
212212
target_include_directories(MathCore PUBLIC $<BUILD_INTERFACE:${incl}>)
213213
endforeach()
214214

215-
if(NOT minuit2)
216-
target_compile_definitions(MathCore PRIVATE MATH_USE_LEGACY_MINUIT_AS_DEFAULT)
217-
endif()
218-
219215
target_compile_definitions(MathCore INTERFACE ${VecCore_DEFINITIONS})
220216
target_link_libraries(MathCore PRIVATE ${CMAKE_THREAD_LIBS_INIT})
221217

math/mathcore/src/MinimizerOptions.cxx

-5
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,7 @@ const std::string & MinimizerOptions::DefaultMinimizerType()
104104

105105

106106
// The "default default" minimizer in case there is nothing set in .rootrc
107-
#ifndef MATH_USE_LEGACY_MINUIT_AS_DEFAULT
108107
static constexpr auto defaultDefaultMinimizer = "Minuit2";
109-
#else
110-
static constexpr auto defaultDefaultMinimizer = "Minuit";
111-
#endif // MATH_USE_LEGACY_MINUIT_AS_DEFAULT
112-
113108

114109
#ifdef MATH_NO_PLUGIN_MANAGER
115110
if (Minim::gDefaultMinimizer.size() != 0)

math/mathcore/test/CMakeLists.txt

+6-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
project(mathcore-tests)
88

9-
set(Libraries Core RIO Net Hist Graf Graf3d Gpad Tree
9+
set(Libraries Core RIO Net Hist Graf Graf3d Gpad Tree Minuit2
1010
Rint Postscript Matrix Physics MathCore Thread)
1111

1212
set(TestSource
@@ -32,23 +32,19 @@ set(TestSource
3232
testIntegrationMultiDim.cxx
3333
testAnalyticalIntegrals.cxx
3434
testTStatistic.cxx
35-
fit/testFit.cxx
36-
fit/testGraphFit.cxx
3735
fit/SparseDataComparer.cxx
38-
fit/SparseFit4.cxx
3936
fit/SparseFit3.cxx
37+
fit/SparseFit4.cxx
4038
fit/testBinnedFitExecPolicy.cxx
41-
fit/testLogLExecPolicy.cxx )
39+
fit/testFit.cxx
40+
fit/testGraphFit.cxx
41+
fit/testLogLExecPolicy.cxx
42+
fit/testMinim.cxx)
4243

4344
if(mathmore)
4445
list(APPEND Libraries MathMore)
4546
endif()
4647

47-
if(minuit2)
48-
list(APPEND TestSource fit/testMinim.cxx)
49-
list(APPEND Libraries Minuit2)
50-
endif()
51-
5248
if(r)
5349
add_definitions(-DROOT_HAS_R)
5450
list(APPEND Libraries RInterface)

roofit/roostats/test/CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,4 @@ endif()
2020
if(roofit_legacy_eval_backend AND minuit2)
2121
ROOT_ADD_TEST(test-stressroostats-legacy-minuit2 COMMAND stressRooStats -minim Minuit2 -b legacy FAILREGEX "FAILED|Error in" LABELS longtest)
2222
endif()
23-
if(minuit2)
24-
ROOT_ADD_TEST(test-stressroostats-cpu-minuit2 COMMAND stressRooStats -minim Minuit2 -b cpu FAILREGEX "FAILED|Error in" LABELS longtest)
25-
endif()
23+
ROOT_ADD_TEST(test-stressroostats-cpu-minuit2 COMMAND stressRooStats -minim Minuit2 -b cpu FAILREGEX "FAILED|Error in" LABELS longtest)

tutorials/CMakeLists.txt

-9
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ function(ROOT_ADD_TUTORIAL macrofile rc)
6464
endfunction()
6565

6666
#---Tutorials disabled depending on the build components-------------
67-
if(NOT ROOT_minuit2_FOUND)
68-
set(minuit2_veto fit/fit2dHist.C fit/fitCircle.C
69-
fit/minuit2FitBench2D.C fit/minuit2FitBench.C
70-
fit/minuit2GausFit.C fit/NumericalMinimization.C
71-
fit/combinedFit.C fit/TestBinomial.C
72-
fit/fitNormSum.C fit/vectorizedFit.C
73-
tutorials/roostats/rs_bernsteinCorrection.C)
74-
endif()
7567

7668
if(NOT clad)
7769
set(clad_veto fit/minuit2GausFit.C)
@@ -442,7 +434,6 @@ set(all_veto hsimple.C
442434
${extra_veto}
443435
${gdml_veto}
444436
${gui_veto}
445-
${minuit2_veto}
446437
${roofit_veto}
447438
${unuran_veto}
448439
${xml_veto}

0 commit comments

Comments
 (0)