From c2460c4850ad3f4ab6199a7e9431c6b4845090a9 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 7 Apr 2026 20:46:23 +0200 Subject: [PATCH 01/18] [math][genvector] remove leftover Makefile --- math/genvector/test/Makefile | 207 ----------------------------------- 1 file changed, 207 deletions(-) delete mode 100644 math/genvector/test/Makefile diff --git a/math/genvector/test/Makefile b/math/genvector/test/Makefile deleted file mode 100644 index 89f2dfabfa6ad..0000000000000 --- a/math/genvector/test/Makefile +++ /dev/null @@ -1,207 +0,0 @@ -# Makefile for the ROOT test programs. -# This Makefile shows nicely how to compile and link applications -# using the ROOT libraries on all supported platforms. -# -# Copyright (c) 2000 Rene Brun and Fons Rademakers -# -# Author: Fons Rademakers, 29/2/2000 - -ROOTSYS = ../../.. -include $(ROOTSYS)/etc/Makefile.arch - -#------------------------------------------------------------------------------ - -ifeq ($(PLATFORM),win32) -EXTRALIBS = -include:_G__cpp_setupG__GenVector -include:_G__cpp_setupG__GenVector32 "$(ROOTSYS)/lib/libGenVector.lib" -else -EXTRALIBS = -lGenVector -CXXFLAGS += -g -endif - -ifeq ($(DIM),2) -CXXFLAGS += -DDIM_2 -endif -ifeq ($(DIM),3) -CXXFLAGS += -DDIM_3 -endif -ifneq ($(USE_CLHEP),) -CXXFLAGS += -DUSE_CLHEP -endif -ifneq ($(USE_ROOT),) -CXXFLAGS += -DUSE_ROOT -endif - - -# use reflex -#useReflex=yes -ifneq ($(USE_REFLEX),) -GCCXML=yes -CXXFLAGS += -DUSE_REFLEX -endif - - -# if have clhep -ifneq ($(CLHEPBASE),) -CXXFLAGS+= -I$(CLHEPBASE)/include -DHAVE_CLHEP -ifeq ($(PLATFORM),win32) -EXTRALIBS += "$(CLHEPBASE)/lib/CLHEP.lib" -else -#EXTRALIBS+= $(CLHEPBASE)/lib/libCLHEP.a -EXTRALIBS+= -L$(CLHEPBASE)/lib -lCLHEP -endif -endif - - -COORDINATES3DOBJ = coordinates3D.$(ObjSuf) -COORDINATES3DSRC = coordinates3D.$(SrcSuf) -COORDINATES3D = coordinates3D$(ExeSuf) - -COORDINATES4DOBJ = coordinates4D.$(ObjSuf) -COORDINATES4DSRC = coordinates4D.$(SrcSuf) -COORDINATES4D = coordinates4D$(ExeSuf) - -ROTATIONOBJ = rotationApplication.$(ObjSuf) -ROTATIONSRC = rotationApplication.$(SrcSuf) -ROTATION = rotationApplication$(ExeSuf) - -BOOSTOBJ = testBoost.$(ObjSuf) -BOOSTSRC = testBoost.$(SrcSuf) -BOOST = testBoost$(ExeSuf) - -ITERATOROBJ = testIterator.$(ObjSuf) -ITERATORSRC = testIterator.$(SrcSuf) -ITERATOR = testIterator$(ExeSuf) - -GENVECTOROBJ = testGenVector.$(ObjSuf) -GENVECTORSRC = testGenVector.$(SrcSuf) -GENVECTOR = testGenVector$(ExeSuf) - -VECTORIOOBJ = testVectorIO.$(ObjSuf) -VECTORIOSRC = testVectorIO.$(SrcSuf) -VECTORIO = testVectorIO$(ExeSuf) - -STRESS3DOBJ = stress3D.$(ObjSuf) -STRESS3DSRC = stress3D.$(SrcSuf) -STRESS3D = stress3D$(ExeSuf) - -STRESS2DOBJ = stress2D.$(ObjSuf) -STRESS2DSRC = stress2D.$(SrcSuf) -STRESS2D = stress2D$(ExeSuf) - -VECTOROPOBJ = vectorOperation.$(ObjSuf) -VECTOROPSRC = vectorOperation.$(SrcSuf) -VECTOROP = vectorOperation$(ExeSuf) - -#VECTORSCALEOBJ = testVectorScale.$(ObjSuf) -#VECTORSCALESRC = testVectorScale.$(SrcSuf) -#VECTORSCALE = testVectorScale$(ExeSuf) - - -OBJS = $(COORDINATES3DOBJ) $(COORDINATES4DOBJ) $(ROTATIONOBJ) $(BOOSTOBJ) $(GENVECTOROBJ) $(VECTORIOOBJ) $(STRESS3DOBJ) $(STRESS2DOBJ) $(ITERATOROBJ) $(VECTOROPOBJ) - - -PROGRAMS = $(COORDINATES3D) $(COORDINATES4D) $(ROTATION) $(BOOST) $(GENVECTOR) $(VECTORIO) $(STRESS3D) $(STRESS2D) $(ITERATOR) $(VECTOROP) - - - -.SUFFIXES: .$(SrcSuf) .$(ObjSuf) $(ExeSuf) - - -all: $(PROGRAMS) libTrackDict.$(DllSuf) - - -$(COORDINATES3D): $(COORDINATES3DOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(COORDINATES4D): $(COORDINATES4DOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(ROTATION): $(ROTATIONOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(BOOST): $(BOOSTOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(GENVECTOR): $(GENVECTOROBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(VECTORIO): $(VECTORIOOBJ) libTrackDict.$(DllSuf) - $(LD) $(LDFLAGS) $(VECTORIOOBJ) $(LIBS) $(EXTRALIBS) $(EXTRAIOLIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(STRESS3D): $(STRESS3DOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(STRESS2D): $(STRESS2DOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(ITERATOR): $(ITERATOROBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - - -$(VECTOROP): $(VECTOROPOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(EXTRAIOLIBS) $(OutPutOpt)$@ - @echo "$@ done" - -# $(VECTORSCALE): $(VECTORSCALEOBJ) -# $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(EXTRAIOLIBS) $(OutPutOpt)$@ -# @echo "$@ done" - - -ifneq ($(USE_REFLEX),) -TrackDict.$(SrcSuf): Track.h TrackDict.xml - @echo "Generating dictionary $@ using gccxml ..." - genreflex Track.h --selection_file=TrackDict.xml -o TrackDict.cxx -I$(ROOTSYS)/include -else -TrackDict.$(SrcSuf): Track.h TrackLinkDef.h - @echo "Generating dictionary $@ using rootcling ..." - $(ROOTCLING) -f $@ -c $^ -endif - - -libTrackDict.$(DllSuf): TrackDict.$(ObjSuf) -ifeq ($(ARCH),aix) - /usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(GLIBS) -p 0 $^ -else -ifeq ($(ARCH),aix5) - /usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(GLIBS) -p 0 $^ -else -ifeq ($(PLATFORM),macosx) - $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ -else -ifeq ($(PLATFORM),win32) - bindexplib libTrackDict $^ > libTrackDict.def - lib -nologo -MACHINE:IX86 $^ -def:$*.def \ - $(OutPutOpt)libTrackDict.lib - $(LD) $(SOFLAGS) $(LDFLAGS) $^ libTrackDict.exp $(LIBS) \ - $(OutPutOpt)$@ -else - $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt)$@ -endif -endif -endif -endif - - - - -clean: - @rm -f $(OBJS) core TrackDict.$(SrcSuf) TrackDict.h - -distclean: clean - @rm -f $(PROGRAMS) libTrackDict.* - - -.SUFFIXES: .$(SrcSuf) - - -.$(SrcSuf).$(ObjSuf): - $(CXX) $(CXXFLAGS) -c $< From 2644907596198e2a728fc85a92ccb3bf12579a52 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 7 Apr 2026 20:50:11 +0200 Subject: [PATCH 02/18] [mathcore] remove leftover Makefile --- math/mathcore/test/fit/Makefile | 114 -------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 math/mathcore/test/fit/Makefile diff --git a/math/mathcore/test/fit/Makefile b/math/mathcore/test/fit/Makefile deleted file mode 100644 index cd78e419fba6b..0000000000000 --- a/math/mathcore/test/fit/Makefile +++ /dev/null @@ -1,114 +0,0 @@ -# Makefile for the ROOT test programs. -# This Makefile shows nicely how to compile and link applications -# using the ROOT libraries on all supported platforms. -# -# Copyright (c) 2000 Rene Brun and Fons Rademakers -# -# Author: Fons Rademakers, 29/2/2000 - - -# RC := root-config -# ifeq ($(shell which $(RC) 2>&1 | sed -ne "s@.*/$(RC)@$(RC)@p"),$(RC)) -# MKARCH := $(wildcard $(shell $(RC) --etcdir)/Makefile.arch) -# RCONFIG := $(wildcard $(shell $(RC) --incdir)/RConfigure.h) -# endif -# ifneq ($(MKARCH),) -# include $(MKARCH) -# else -# ifeq ($(ROOTSYS),) -# ROOTSYS = .. -# endif -# include $(ROOTSYS)/etc/Makefile.arch -# endif - -ifeq ($(ROOTSYS),) -ROOTSYS = ../../../.. -endif -include $(ROOTSYS)/config/Makefile.config -include $(ROOTSYS)/etc/Makefile.arch - -#------------------------------------------------------------------------------ - - - -ifeq ($(PLATFORM),win32) -EXTRALIBS= "$(ROOTSYS)/lib/libMathMore.lib" -ROOFITLIBS= "$(ROOTSYS)/lib/libMinuit.lib" "$(ROOTSYS)/lib/libThread.lib" "$(ROOTSYS)/lib/libHtml.lib" -else -EXTRALIBS= -ROOFITLIBS= -lMathMore -lMinuit -lThread -lHtml -lFoam -CXXFLAGS += -g -endif - -SPARSEDATACOMPAREROBJ = SparseDataComparer.$(ObjSuf) -SPARSEDATACOMPARERSRC = SparseDataComparer.$(SrcSuf) -SPARSEDATACOMPARER = SparseDataComparer$(ExeSuf) - -SPARSEFIT3OBJ = SparseFit3.$(ObjSuf) -SPARSEFIT3SRC = SparseFit3.$(SrcSuf) -SPARSEFIT3 = SparseFit3$(ExeSuf) - -SPARSEFIT4OBJ = SparseFit4.$(ObjSuf) -SPARSEFIT4SRC = SparseFit4.$(SrcSuf) -SPARSEFIT4 = SparseFit4$(ExeSuf) - -TESTFITOBJ = testFit.$(ObjSuf) -TESTFITSRC = testFit.$(SrcSuf) -TESTFIT = testFit$(ExeSuf) - - -TESTMINIMOBJ = testMinim.$(ObjSuf) -TESTMINIMSRC = testMinim.$(SrcSuf) -TESTMINIM = testMinim$(ExeSuf) - -GRAPHFITOBJ = testGraphFit.$(ObjSuf) -GRAPHFITSRC = testGraphFit.$(SrcSuf) -GRAPHFIT = testGraphFit$(ExeSuf) - - -OBJS = $(SPARSEFIT4OBJ) $(SPARSEFIT3OBJ) $(SPARSEDATACOMPAREROBJ) $(TESTFITOBJ) $(TESTMINIMOBJ) $(GRAPHFITOBJ) - - -PROGRAMS = $(SPARSEFIT4) $(SPARSEFIT3) $(SPARSEDATACOMPARER) $(TESTFIT) $(TESTMINIM) $(GRAPHFIT) - - -.SUFFIXES: .$(SrcSuf) .$(ObjSuf) $(ExeSuf) - -all: $(PROGRAMS) - -$(SPARSEFIT4): $(SPARSEFIT4OBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(SPARSEFIT3): $(SPARSEFIT3OBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(SPARSEDATACOMPARER): $(SPARSEDATACOMPAREROBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTFIT): $(TESTFITOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(GRAPHFIT): $(GRAPHFITOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTMINIM): $(TESTMINIMOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -clean: - @rm -f $(OBJS) core - -distclean: clean - @rm -f $(PROGRAMS) - - -.SUFFIXES: .$(SrcSuf) - - -.$(SrcSuf).$(ObjSuf): - $(CXX) $(CXXFLAGS) -c $< From 984910ceaa12174be22f50eba6ed83a93972df2c Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 7 Apr 2026 21:12:31 +0200 Subject: [PATCH 03/18] [math] rescue smatrix test by migrating to CMake --- math/smatrix/CMakeLists.txt | 2 + math/smatrix/test/CMakeLists.txt | 51 ++++++++++ math/smatrix/test/Makefile | 168 ------------------------------- 3 files changed, 53 insertions(+), 168 deletions(-) create mode 100644 math/smatrix/test/CMakeLists.txt delete mode 100644 math/smatrix/test/Makefile diff --git a/math/smatrix/CMakeLists.txt b/math/smatrix/CMakeLists.txt index a1c06b84984e5..e7fe665e34819 100644 --- a/math/smatrix/CMakeLists.txt +++ b/math/smatrix/CMakeLists.txt @@ -57,3 +57,5 @@ ROOT_GENERATE_DICTIONARY(G__Smatrix32 Core MathCore ) + +ROOT_ADD_TEST_SUBDIRECTORY(test) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt new file mode 100644 index 0000000000000..a5fc646a354c0 --- /dev/null +++ b/math/smatrix/test/CMakeLists.txt @@ -0,0 +1,51 @@ +# Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. +# All rights reserved. +# +# For the licensing terms see $ROOTSYS/LICENSE. +# For the list of contributors see $ROOTSYS/README/CREDITS. + +# @author Danilo Piparo CERN + +project(smatrix-tests) + +set(Libraries Core RIO Tree Rint Matrix MathCore Hist) + +set(TestSource + testSMatrix.cxx + testOperations.cxx + testKalman.cxx + testIO.cxx + testInversion.cxx + stressOperations.cxx + stressKalman.cxx) + +if (USE_REFLEX) + REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) +else() + ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +endif() + +#---Build and add all the defined test in the list--------------- +foreach(file ${TestSource}) + get_filename_component(testname ${file} NAME_WE) + if (testname STREQUAL "testIO") + ROOT_EXECUTABLE(${testname} ${file} TrackDict.cxx LIBRARIES ${Libraries}) + else() + ROOT_EXECUTABLE(${testname} ${file} LIBRARIES ${Libraries}) + endif() + target_include_directories(${testname} PRIVATE ./) + if (CLHEPBASE) + target_include_directories(${testname} PRIVATE ${CLHEPBASE}) + target_compile_definitions(${testname} PRIVATE HAVE_CLHEP) + if (WIN32) + target_link_libraries(${testname} PRIVATE "${CLHEPBASE}/lib/CLHEP.lib") + else() + target_link_libraries(${testname} PRIVATE "CLHEP" "m") + target_link_directories(${testname} PRIVATE "${CLHEPBASE}/lib") + endif() + endif() + if (USE_REFLEX) + target_compile_definitions(${testname} PRIVATE USE_REFLEX) + endif() + ROOT_ADD_TEST(smatrix-${testname} COMMAND ${testname} LABELS ${${testname}_LABELS}) +endforeach() diff --git a/math/smatrix/test/Makefile b/math/smatrix/test/Makefile deleted file mode 100644 index 1c3b803b542a3..0000000000000 --- a/math/smatrix/test/Makefile +++ /dev/null @@ -1,168 +0,0 @@ -# Makefile for the ROOT test programs. -# This Makefile shows nicely how to compile and link applications -# using the ROOT libraries on all supported platforms. -# -# Copyright (c) 2000 Rene Brun and Fons Rademakers -# -# Author: Fons Rademakers, 29/2/2000 - -ifeq ($(ROOTSYS),) -ROOTSYS = ../../.. -endif -include $(ROOTSYS)/etc/Makefile.arch -include $(ROOTSYS)/config/Makefile.config - -#------------------------------------------------------------------------------ - -# ifeq ($(PLATFORM),macosx) -# #unroll loop better on gcc > 4 -# CXXFLAGS+= -O3 -g -funroll-loops -# endif - - - -# if have clhep -#CLHEPBASE=/Users/moneta/mathlibs/CLHEP-1.9.2.2 -ifneq ($(CLHEPBASE),) -CXXFLAGS+= -I$(CLHEPBASE)/include -DHAVE_CLHEP -ifeq ($(PLATFORM),win32) -EXTRALIBS += "$(CLHEPBASE)/lib/CLHEP.lib" -else -#EXTRALIBS+= $(CLHEPBASE)/lib/libCLHEP.a -EXTRALIBS+= -L$(CLHEPBASE)/lib -lCLHEP -endif -endif - -ifneq ($(PLATFORM),win32) -LIBM = -lm -endif - -ifneq ($(USE_REFLEX),) -GCCXML=yes -CXXFLAGS+=-DUSE_REFLEX -endif - - - -TESTSMATRIXOBJ = testSMatrix.$(ObjSuf) -TESTSMATRIXSRC = testSMatrix.$(SrcSuf) -TESTSMATRIX = testSMatrix$(ExeSuf) - -TESTOPERATIONSOBJ = testOperations.$(ObjSuf) -TESTOPERATIONSSRC = testOperations.$(SrcSuf) -TESTOPERATIONS = testOperations$(ExeSuf) - -TESTKALMANOBJ = testKalman.$(ObjSuf) -TESTKALMANSRC = testKalman.$(SrcSuf) -TESTKALMAN = testKalman$(ExeSuf) - -TESTIOOBJ = testIO.$(ObjSuf) -TESTIOSRC = testIO.$(SrcSuf) -TESTIO = testIO$(ExeSuf) - -TESTINVERSIONOBJ = testInversion.$(ObjSuf) -TESTINVERSIONSRC = testInversion.$(SrcSuf) -TESTINVERSION = testInversion$(ExeSuf) - - -STRESSOPERATIONSOBJ = stressOperations.$(ObjSuf) -STRESSOPERATIONSSRC = stressOperations.$(SrcSuf) -STRESSOPERATIONS = stressOperations$(ExeSuf) - - -STRESSKALMANOBJ = stressKalman.$(ObjSuf) -STRESSKALMANSRC = stressKalman.$(SrcSuf) -STRESSKALMAN = stressKalman$(ExeSuf) - - -OBJS = $(TESTSMATRIXOBJ) $(TESTOPERATIONSOBJ) $(TESTKALMANOBJ) $(TESTINVERSIONOBJ) $(TESTIOOBJ) $(STRESSOPERATIONSOBJ) $(STRESSKALMANOBJ) - - -PROGRAMS = $(TESTSMATRIX) $(TESTOPERATIONS) $(TESTKALMAN) $(TESTINVERSION) $(TESTIO) $(STRESSOPERATIONS) $(STRESSKALMAN) - - -.SUFFIXES: .$(SrcSuf) .$(ObjSuf) $(ExeSuf) - - -all: $(PROGRAMS) libTrackDict.$(DllSuf) - -testOperations.$(ObjSuf): matrix_op.h matrix_util.h TestTimer.h - -testKalman.$(ObjSuf): matrix_util.h TestTimer.h - -stressOperations.$(ObjSuf): $(TESTOPERATIONSOBJ) - - -$(TESTSMATRIX): $(TESTSMATRIXOBJ) - $(LD) $(LDFLAGS) $^ $(LIBM) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTOPERATIONS): $(TESTOPERATIONSOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTKALMAN): $(TESTKALMANOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTINVERSION): $(TESTINVERSIONOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTIO): $(TESTIOOBJ) libTrackDict.$(DllSuf) - $(LD) $(LDFLAGS) $(TESTIOOBJ) $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -ifneq ($(USE_REFLEX),) -TrackDict.$(SrcSuf): Track.h TrackDict.xml - @echo "Generating dictionary $@ using gccxml ..." - genreflex Track.h --selection_file=TrackDict.xml -o TrackDict.cxx -I$(ROOTSYS)/include -else -TrackDict.$(SrcSuf): Track.h TrackLinkDef.h - @echo "Generating dictionary $@ using rootcling ..." - $(ROOTCLING) -f $@ -c $^ -endif - - -libTrackDict.$(DllSuf): TrackDict.$(ObjSuf) -ifeq ($(ARCH),aix) - /usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^ -else -ifeq ($(ARCH),aix5) - /usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^ -else -ifeq ($(PLATFORM),macosx) - $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ -else - $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@ - $(MT_DLL) -endif -endif -endif - - -$(STRESSKALMAN): $(STRESSKALMANOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(STRESSOPERATIONS): $(STRESSOPERATIONSOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -check: all - for prog in $(PROGRAMS); do \ - ./$$prog > $$prog.out; \ - done; - -clean: - @rm -f $(OBJS) $(PROGRAMS) libTrackDict.* TrackDict.$(ObjSuf) TrackDict.$(SrcSuf) TrackDict.h core - -distclean: clean - @rm -f $(PROGRAMS) kalman.root stressOperations.root - - -.SUFFIXES: .$(SrcSuf) - - -.$(SrcSuf).$(ObjSuf): - $(CXX) $(CXXFLAGS) -c $< From ed0a9f4ec9ba002b226b566cc894b04cf1483787 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 8 Apr 2026 10:11:44 +0200 Subject: [PATCH 04/18] [tests] fix warnings --- math/smatrix/test/stressKalman.cxx | 12 ++++++------ math/smatrix/test/testIO.cxx | 4 ++-- math/smatrix/test/testInversion.cxx | 4 ++-- math/smatrix/test/testKalman.cxx | 12 ++++++------ math/smatrix/test/testSMatrix.cxx | 1 + 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/math/smatrix/test/stressKalman.cxx b/math/smatrix/test/stressKalman.cxx index 6dbe7b53fe20f..ae41260939473 100644 --- a/math/smatrix/test/stressKalman.cxx +++ b/math/smatrix/test/stressKalman.cxx @@ -380,8 +380,8 @@ int TestRunner::test_smatrix_kalman() { // need to write explicitly the dimensions - typedef ROOT::Math::SMatrix MnMatrixNN; - typedef ROOT::Math::SMatrix MnMatrixMM; + // typedef ROOT::Math::SMatrix MnMatrixNN; + // typedef ROOT::Math::SMatrix MnMatrixMM; typedef ROOT::Math::SMatrix MnMatrixNM; typedef ROOT::Math::SMatrix MnMatrixMN; typedef ROOT::Math::SMatrix MnSymMatrixNN; @@ -525,16 +525,16 @@ int TestRunner::test_smatrix_sym_kalman() { // need to write explicitly the dimensions - typedef ROOT::Math::SMatrix MnMatrixNN; - typedef ROOT::Math::SMatrix MnMatrixMM; + // typedef ROOT::Math::SMatrix MnMatrixNN; + // typedef ROOT::Math::SMatrix MnMatrixMM; typedef ROOT::Math::SMatrix MnMatrixNM; typedef ROOT::Math::SMatrix MnMatrixMN; typedef ROOT::Math::SMatrix > MnSymMatrixNN; typedef ROOT::Math::SMatrix > MnSymMatrixMM; typedef ROOT::Math::SVector MnVectorN; typedef ROOT::Math::SVector MnVectorM; - typedef ROOT::Math::SVector MnVectorN2; - typedef ROOT::Math::SVector MnVectorM2; + // typedef ROOT::Math::SVector MnVectorN2; + // typedef ROOT::Math::SVector MnVectorM2; diff --git a/math/smatrix/test/testIO.cxx b/math/smatrix/test/testIO.cxx index d44d4090417c2..a6b27d2e8224e 100644 --- a/math/smatrix/test/testIO.cxx +++ b/math/smatrix/test/testIO.cxx @@ -470,7 +470,7 @@ double readSMatrix(const std::string & file) { TFile f1(file.c_str()); if (f1.IsZombie() ) { - std::cerr << "Error opening the ROOT file" << file << std::endl; + std::cerr << "Error opening the ROOT file " << file << std::endl; return -1; } @@ -516,7 +516,7 @@ double readSMatrixSym(const std::string & file) { TFile f1(file.c_str()); if (f1.IsZombie() ) { - std::cerr << "Error opening the ROOT file" << file << std::endl; + std::cerr << "Error opening the ROOT file " << file << std::endl; return -1; } diff --git a/math/smatrix/test/testInversion.cxx b/math/smatrix/test/testInversion.cxx index 550d153ac9a17..65b2e9e457920 100644 --- a/math/smatrix/test/testInversion.cxx +++ b/math/smatrix/test/testInversion.cxx @@ -101,11 +101,11 @@ template void genMatrix(M & m ) { TRandom & r = *gRandom; // generate first diagonal elements - for (int i = 0; i < N; ++i) { + for (int i = 0; i < static_cast(N); ++i) { double maxVal = i*10000/(N-1) + 1; // max condition is 10^4 m(i,i) = r.Uniform(0, maxVal); } - for (int i = 0; i < N; ++i) { + for (int i = 0; i < static_cast(N); ++i) { for (int j = 0; j < i; ++j) { double v = 0.3*std::sqrt( m(i,i) * m(j,j) ); // this makes the matrix pos defined m(i,j) = r.Uniform(0, v); diff --git a/math/smatrix/test/testKalman.cxx b/math/smatrix/test/testKalman.cxx index 1e164eab0097b..65e607243748d 100644 --- a/math/smatrix/test/testKalman.cxx +++ b/math/smatrix/test/testKalman.cxx @@ -46,8 +46,8 @@ int test_smatrix_kalman() { // need to write explicitly the dimensions - typedef SMatrix MnMatrixNN; - typedef SMatrix MnMatrixMM; + // typedef SMatrix MnMatrixNN; + // typedef SMatrix MnMatrixMM; typedef SMatrix MnMatrixNM; typedef SMatrix MnMatrixMN; typedef SMatrix MnSymMatrixNN; @@ -170,16 +170,16 @@ int test_smatrix_sym_kalman() { // need to write explicitly the dimensions - typedef SMatrix MnMatrixNN; - typedef SMatrix MnMatrixMM; + // typedef SMatrix MnMatrixNN; + // typedef SMatrix MnMatrixMM; typedef SMatrix MnMatrixNM; typedef SMatrix MnMatrixMN; typedef SMatrix > MnSymMatrixNN; typedef SMatrix > MnSymMatrixMM; typedef SVector MnVectorN; typedef SVector MnVectorM; - typedef SVector MnVectorN2; - typedef SVector MnVectorM2; + // typedef SVector MnVectorN2; + // typedef SVector MnVectorM2; diff --git a/math/smatrix/test/testSMatrix.cxx b/math/smatrix/test/testSMatrix.cxx index ba1a0d6e108c5..5603fa029624c 100644 --- a/math/smatrix/test/testSMatrix.cxx +++ b/math/smatrix/test/testSMatrix.cxx @@ -33,6 +33,7 @@ template typename std::enable_if::value, int>::type compare(T a, T b, const std::string &s = "", int ulps = 10) { + (void)ulps; // silence unused variable warning if (a != b) compare_fail(a, b, T(0), T(0), s); return a == b ? 0 : 1; } From 4229684f0c73690438bac616faa8b6b4d04c99c9 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 8 Apr 2026 10:14:26 +0200 Subject: [PATCH 05/18] [test] fix compilation error due to max template depth reached --- math/smatrix/test/testOperations.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/math/smatrix/test/testOperations.cxx b/math/smatrix/test/testOperations.cxx index 2974c13ca0832..13ae78c716230 100644 --- a/math/smatrix/test/testOperations.cxx +++ b/math/smatrix/test/testOperations.cxx @@ -828,7 +828,8 @@ int main(int argc , char *argv[] ) { TEST(15); TEST(20); NLOOP = 50*NLOOP_MIN; - TEST(30); + TEST(29); + // TEST(30); // NLOOP = NLOOP_MIN; // TEST(50); // TEST(75); From 19a816c963ad1b165a7b178d997b43daf10f942d Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 8 Apr 2026 13:28:30 +0200 Subject: [PATCH 06/18] [test] disable smatrix reflex test follow-up of https://github.com/root-project/root/commit/faadea7f8730fea105a3e0ec625dc715b35b8438#diff-94b4efe857e73addae83acfbcc7f26682960180a8c75e3a6aa13903b76500d88 --- math/smatrix/test/CMakeLists.txt | 10 ++----- math/smatrix/test/testIO.cxx | 48 +++++++------------------------- 2 files changed, 12 insertions(+), 46 deletions(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index a5fc646a354c0..ee6831d98162b 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -19,11 +19,8 @@ set(TestSource stressOperations.cxx stressKalman.cxx) -if (USE_REFLEX) - REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) -else() - ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) -endif() + +ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) #---Build and add all the defined test in the list--------------- foreach(file ${TestSource}) @@ -44,8 +41,5 @@ foreach(file ${TestSource}) target_link_directories(${testname} PRIVATE "${CLHEPBASE}/lib") endif() endif() - if (USE_REFLEX) - target_compile_definitions(${testname} PRIVATE USE_REFLEX) - endif() ROOT_ADD_TEST(smatrix-${testname} COMMAND ${testname} LABELS ${${testname}_LABELS}) endforeach() diff --git a/math/smatrix/test/testIO.cxx b/math/smatrix/test/testIO.cxx index a6b27d2e8224e..66546491d4c31 100644 --- a/math/smatrix/test/testIO.cxx +++ b/math/smatrix/test/testIO.cxx @@ -1,11 +1,11 @@ // // Cling macro to test I/O of SMatrix classes and compare with a TMatrix -// A ROOT tree is written and read in both using either a SMatrix or +// A ROOT tree is written and read in both using either a SMatrix or // a TMatrixD. // // To execute the macro type in: // -// root[0]: .x smatrixIO.C +// root[0]: .x testIO.cxx #include "Math/SMatrix.h" #include "TMatrixD.h" @@ -44,10 +44,7 @@ double tol = 1.E-16; double tol32 = 1.E-6; std::string sfile1 = "smatrix.root"; -std::string sfile2 = "smatrix_rflx.root"; - std::string symfile1 = "smatrixsym.root"; -std::string symfile2 = "smatrixsym_rflx.root"; @@ -748,7 +745,7 @@ int testWrite(int nEvents, double & w1, double & w2) { return iret; } -int testRead(double & r1, double & r2, double & r3) { +int testRead(double & r1, double & r2) { int iret = 0; @@ -762,16 +759,6 @@ int testRead(double & r1, double & r2, double & r3) { iret = 2; } - std::cout << "try to read file written with Reflex using Cling Dictionaries " << std::endl; - - r3 = readSMatrix(sfile2); - if ( r3 != -1. && fabs(r2-r3) > tol) { - std::cout << "\nERROR: Differeces Reflex-Cling found when reading SMatrices" << std::endl; - int pr = std::cout.precision(18); std::cout << r2 << " != " << r3 << std::endl; std::cout.precision(pr); - iret = 3; - } - - return iret; } @@ -801,7 +788,7 @@ int testWriteSym(int nEvents, double & w1, double & w2) { return iret; } -int testReadSym(double & r1, double & r2, double & r3) { +int testReadSym(double & r1, double & r2) { int iret = 0; @@ -814,19 +801,9 @@ int testReadSym(double & r1, double & r2, double & r3) { iret = 12; } - std::cout << "try to read file written with Reflex using Cling Dictionaries " << std::endl; - - r3 = readSMatrixSym(symfile2); - if ( r3 != -1. && fabs(r2-r3) > tol) { - std::cout << "\nERROR: Differeces Reflex-Cling found when reading SMatricesSym" << std::endl; - int pr = std::cout.precision(18); std::cout << r2 << " != " << r3 << std::endl; std::cout.precision(pr); - iret = 13; - } - - return iret; } -int testResult(double w1, double r1, double w2, double r2, double r3) { +int testResult(double w1, double r1, double w2, double r2) { int iret = 0; @@ -840,11 +817,6 @@ int testResult(double w1, double r1, double w2, double r2, double r3) { int pr = std::cout.precision(18); std::cout << w2 << " != " << r2 << std::endl; std::cout.precision(pr); iret = -2; } - if ( r3 != -1. && fabs(w2-r3) > tol) { - std::cout << "\nERROR: Differeces found when reading SMatrices with different Dictionary" << std::endl; - int pr = std::cout.precision(18); std::cout << w2 << " != " << r2 << std::endl; std::cout.precision(pr); - iret = -3; - } return iret; } @@ -896,10 +868,10 @@ int testIO() { - double r1, r2, r3 = 0; + double r1, r2 = 0; int iret2 = 0; - iret2 |= testRead(r1,r2,r3); - iret2 |= testResult(w1,r1,w2,r2,r3); + iret2 |= testRead(r1,r2); + iret2 |= testResult(w1,r1,w2,r2); std::cout << "\n\n*************************************************************\n"; if (iret2 == 0 ) std::cout << " Reading Test:\t" << "OK"; @@ -916,8 +888,8 @@ int testIO() { std::cout << "\n*****************************************************\n\n"; iret = testWriteSym(nEvents,w1,w2); - iret2 = testReadSym(r1,r2,r3); - iret2 = testResult(w1,r1,w2,r2,r3); + iret2 = testReadSym(r1,r2); + iret2 = testResult(w1,r1,w2,r2); std::cout << "\n\n*************************************************************\n"; if (iret2 == 0 ) From fe7101cda74fddeb3fa9afd77fbb2af93a2ab8cf Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 8 Apr 2026 14:16:47 +0200 Subject: [PATCH 07/18] [test] no runtime loading of track lib dictionary --- math/smatrix/test/testIO.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math/smatrix/test/testIO.cxx b/math/smatrix/test/testIO.cxx index 66546491d4c31..faccb91b022ae 100644 --- a/math/smatrix/test/testIO.cxx +++ b/math/smatrix/test/testIO.cxx @@ -907,7 +907,7 @@ int testIO() { std::cout << "\n*****************************************************\n\n"; // load track dictionary - iret |= gSystem->Load("libTrackDict"); + // iret |= gSystem->Load("libTrackDict"); if (iret != 0 ) return iret; iret |= testTrack(nEvents); From 4823286ece113c67311b08d9a5128f85f4207aa0 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sun, 12 Apr 2026 12:44:18 +0200 Subject: [PATCH 08/18] [test] fix uninitialized warning --- math/smatrix/test/testOperations.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math/smatrix/test/testOperations.cxx b/math/smatrix/test/testOperations.cxx index 13ae78c716230..31ee8d5c7903e 100644 --- a/math/smatrix/test/testOperations.cxx +++ b/math/smatrix/test/testOperations.cxx @@ -87,7 +87,7 @@ int test_smatrix_op() { double r1,r2; - int npass = NITER; + int npass = std::max(NITER, 1); TRandom3 r(111); for (int k = 0; k < npass; k++) { From 5ce524b96321eb747d38c3c7358980ee2ef0976d Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 13 Apr 2026 01:21:22 +0200 Subject: [PATCH 09/18] Apply suggestions from code review Co-authored-by: ferdymercury --- math/smatrix/test/testOperations.cxx | 6 +++--- math/smatrix/test/testSMatrix.cxx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/math/smatrix/test/testOperations.cxx b/math/smatrix/test/testOperations.cxx index 31ee8d5c7903e..2706b16391bb7 100644 --- a/math/smatrix/test/testOperations.cxx +++ b/math/smatrix/test/testOperations.cxx @@ -87,7 +87,7 @@ int test_smatrix_op() { double r1,r2; - int npass = std::max(NITER, 1); + int npass = std::max(int(NITER), int(1)); TRandom3 r(111); for (int k = 0; k < npass; k++) { @@ -194,7 +194,7 @@ int test_smatrix_sym_op() { - int first = NDIM1; //Can change the size of the matrices + int first = std::max(int(NDIM1), int(1)); //Can change the size of the matrices std::cout << "************************************************\n"; @@ -311,7 +311,7 @@ int test_tmatrix_op() { double totTime1, totTime2; double r1,r2; - int npass = NITER; + int npass = std::max(int(1), int(NITER)); TRandom3 r(111); gMatrixCheck = 0; diff --git a/math/smatrix/test/testSMatrix.cxx b/math/smatrix/test/testSMatrix.cxx index 5603fa029624c..70b9f5008f4ad 100644 --- a/math/smatrix/test/testSMatrix.cxx +++ b/math/smatrix/test/testSMatrix.cxx @@ -1073,9 +1073,9 @@ int test19() for (int i = 0; i < 7; ++i) { for (int j = 0; j <= i; ++j) { if (i == j) - S(i, j) = 10 * float(std::rand()) / (RAND_MAX); // generate between 0,10 + S(i, j) = 10.f * float(std::rand()) / float(RAND_MAX); // generate between 0,10 else - S(i, j) = 2 * float(std::rand()) / (RAND_MAX)-1; // generate between -1,1 + S(i, j) = 2.f * float(std::rand()) / float(RAND_MAX)-1.f; // generate between -1,1 } } int ifail = 0; @@ -1096,9 +1096,9 @@ int test19() for (int i = 0; i < 7; ++i) { for (int j = 0; j < 7; ++j) { if (i == j) - M(i, j) = 10 * float(std::rand()) / (RAND_MAX); // generate between 0,10 + M(i, j) = 10.f * float(std::rand()) / float(RAND_MAX); // generate between 0,10 else - M(i, j) = 2 * float(std::rand()) / (RAND_MAX)-1; // generate between -1,1 + M(i, j) = 2.f * float(std::rand()) / float(RAND_MAX)-1.f; // generate between -1,1 } } ifail = 0; From 08946a8d580bbfe02d12f8d105172d990c5cd8df Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Tue, 14 Apr 2026 10:28:09 +0200 Subject: [PATCH 10/18] Correctly link CLHEP library when CLHEPBASE shell variable exists Co-authored-by: ferdymercury --- math/smatrix/test/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index ee6831d98162b..2c348eb995921 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -31,14 +31,14 @@ foreach(file ${TestSource}) ROOT_EXECUTABLE(${testname} ${file} LIBRARIES ${Libraries}) endif() target_include_directories(${testname} PRIVATE ./) - if (CLHEPBASE) - target_include_directories(${testname} PRIVATE ${CLHEPBASE}) + if (DEFINED ENV{CLHEPBASE}) + target_include_directories(${testname} PRIVATE $ENV{CLHEPBASE}) target_compile_definitions(${testname} PRIVATE HAVE_CLHEP) if (WIN32) - target_link_libraries(${testname} PRIVATE "${CLHEPBASE}/lib/CLHEP.lib") + target_link_libraries(${testname} PRIVATE "$ENV{CLHEPBASE}/lib/CLHEP.lib") else() target_link_libraries(${testname} PRIVATE "CLHEP" "m") - target_link_directories(${testname} PRIVATE "${CLHEPBASE}/lib") + target_link_directories(${testname} PRIVATE "$ENV{CLHEPBASE}/lib") endif() endif() ROOT_ADD_TEST(smatrix-${testname} COMMAND ${testname} LABELS ${${testname}_LABELS}) From 06a8aea6694767d23772764d8296878e58d866fc Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 14 Apr 2026 13:14:02 +0200 Subject: [PATCH 11/18] [math] rescue reflex use as suggested by linev Co-authored-by: ferdymercury --- math/smatrix/test/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index 2c348eb995921..3f80e46d2064b 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -20,7 +20,11 @@ set(TestSource stressKalman.cxx) -ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +if (DEFINED ENV{USE_REFLEX}) + REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) +else() + ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +endif() #---Build and add all the defined test in the list--------------- foreach(file ${TestSource}) @@ -31,6 +35,9 @@ foreach(file ${TestSource}) ROOT_EXECUTABLE(${testname} ${file} LIBRARIES ${Libraries}) endif() target_include_directories(${testname} PRIVATE ./) + if (DEFINED ENV{USE_REFLEX}) + target_compile_definitions(${testname} PRIVATE USE_REFLEX) + endif() if (DEFINED ENV{CLHEPBASE}) target_include_directories(${testname} PRIVATE $ENV{CLHEPBASE}) target_compile_definitions(${testname} PRIVATE HAVE_CLHEP) From ac1f8eebb06670bc30779d56f8acad88b1e27afa Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 14 Apr 2026 13:18:40 +0200 Subject: [PATCH 12/18] [test] rescue reflex_use --- math/smatrix/test/testIO.cxx | 43 +++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/math/smatrix/test/testIO.cxx b/math/smatrix/test/testIO.cxx index faccb91b022ae..0227275c9fc93 100644 --- a/math/smatrix/test/testIO.cxx +++ b/math/smatrix/test/testIO.cxx @@ -44,7 +44,10 @@ double tol = 1.E-16; double tol32 = 1.E-6; std::string sfile1 = "smatrix.root"; +std::string sfile2 = "smatrix_rflx.root"; + std::string symfile1 = "smatrixsym.root"; +std::string symfile2 = "smatrixsym_rflx.root"; @@ -745,7 +748,7 @@ int testWrite(int nEvents, double & w1, double & w2) { return iret; } -int testRead(double & r1, double & r2) { +int testRead(double & r1, double & r2, double & r3) { int iret = 0; @@ -759,6 +762,15 @@ int testRead(double & r1, double & r2) { iret = 2; } + std::cout << "try to read file written with Reflex using Cling Dictionaries " << std::endl; + + r3 = readSMatrix(sfile2); + if ( r3 != -1. && fabs(r2-r3) > tol) { + std::cout << "\nERROR: Differeces Reflex-Cling found when reading SMatrices" << std::endl; + int pr = std::cout.precision(18); std::cout << r2 << " != " << r3 << std::endl; std::cout.precision(pr); + iret = 3; + } + return iret; } @@ -788,7 +800,7 @@ int testWriteSym(int nEvents, double & w1, double & w2) { return iret; } -int testReadSym(double & r1, double & r2) { +int testReadSym(double & r1, double & r2, double & r3) { int iret = 0; @@ -801,9 +813,19 @@ int testReadSym(double & r1, double & r2) { iret = 12; } + std::cout << "try to read file written with Reflex using Cling Dictionaries " << std::endl; + + r3 = readSMatrixSym(symfile2); + if ( r3 != -1. && fabs(r2-r3) > tol) { + std::cout << "\nERROR: Differeces Reflex-Cling found when reading SMatricesSym" << std::endl; + int pr = std::cout.precision(18); std::cout << r2 << " != " << r3 << std::endl; std::cout.precision(pr); + iret = 13; + } + return iret; } -int testResult(double w1, double r1, double w2, double r2) { + +int testResult(double w1, double r1, double w2, double r2, double r3) { int iret = 0; @@ -817,6 +839,11 @@ int testResult(double w1, double r1, double w2, double r2) { int pr = std::cout.precision(18); std::cout << w2 << " != " << r2 << std::endl; std::cout.precision(pr); iret = -2; } + if ( r3 != -1. && fabs(w2-r3) > tol) { + std::cout << "\nERROR: Differeces found when reading SMatrices with different Dictionary" << std::endl; + int pr = std::cout.precision(18); std::cout << w2 << " != " << r2 << std::endl; std::cout.precision(pr); + iret = -3; + } return iret; } @@ -868,10 +895,10 @@ int testIO() { - double r1, r2 = 0; + double r1, r2, r3 = 0; int iret2 = 0; - iret2 |= testRead(r1,r2); - iret2 |= testResult(w1,r1,w2,r2); + iret2 |= testRead(r1,r2,r3); + iret2 |= testResult(w1,r1,w2,r2,r3); std::cout << "\n\n*************************************************************\n"; if (iret2 == 0 ) std::cout << " Reading Test:\t" << "OK"; @@ -888,8 +915,8 @@ int testIO() { std::cout << "\n*****************************************************\n\n"; iret = testWriteSym(nEvents,w1,w2); - iret2 = testReadSym(r1,r2); - iret2 = testResult(w1,r1,w2,r2); + iret2 = testReadSym(r1,r2,r3); + iret2 = testResult(w1,r1,w2,r2,r3); std::cout << "\n\n*************************************************************\n"; if (iret2 == 0 ) From 77b3f6cba08ce963272fa6fc85adf09d9c547899 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 14 Apr 2026 13:40:21 +0200 Subject: [PATCH 13/18] [genvector] rescue test with dict from Makefile --- math/genvector/test/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index b8fe57321604f..83ebfefd1bae6 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -19,6 +19,18 @@ ROOT_EXECUTABLE(testVectorIO testVectorIO.cxx LIBRARIES GenVector Tree Hist Gpad ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) +if (DEFINED ENV{USE_REFLEX}) + REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) +else() + ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +endif() +ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx TrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +if (DEFINED ENV{USE_REFLEX}) + target_compile_definitions(testVectorIOdict PRIVATE USE_REFLEX) +endif() +ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict + COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) + ROOT_EXECUTABLE(coordinates3D coordinates3D.cxx LIBRARIES GenVector) ROOT_ADD_TEST(test-genvector-coordinates3D COMMAND coordinates3D) From 47fa95c34251d223ad5cc87944ead9b386c83106 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 14 Apr 2026 15:10:43 +0200 Subject: [PATCH 14/18] [cmake] disambiguate --- math/genvector/test/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 83ebfefd1bae6..40e9992e3086c 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -20,11 +20,11 @@ ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) if (DEFINED ENV{USE_REFLEX}) - REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) + REFLEX_GENERATE_DICTIONARY(GVTrackDict Track.h SELECTION TrackDict.xml) else() - ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) + ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) endif() -ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx TrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) if (DEFINED ENV{USE_REFLEX}) target_compile_definitions(testVectorIOdict PRIVATE USE_REFLEX) endif() From 5fd8c3586fe669b09dd94b6b2930d81567cc7fbb Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 14 Apr 2026 15:29:19 +0200 Subject: [PATCH 15/18] Apply suggestion from @ferdymercury --- math/genvector/test/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 40e9992e3086c..9b77f9b917190 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -25,6 +25,7 @@ else() ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) endif() ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +target_include_directories(testVectorIOdict PRIVATE ./) if (DEFINED ENV{USE_REFLEX}) target_compile_definitions(testVectorIOdict PRIVATE USE_REFLEX) endif() From 8507223f4a9e06ee70c402797d7118b292c59a6b Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 15 Apr 2026 08:01:13 +0200 Subject: [PATCH 16/18] Update math/genvector/test/CMakeLists.txt Co-authored-by: Philippe Canal --- math/genvector/test/CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 9b77f9b917190..10aec866220ac 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -19,11 +19,8 @@ ROOT_EXECUTABLE(testVectorIO testVectorIO.cxx LIBRARIES GenVector Tree Hist Gpad ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) -if (DEFINED ENV{USE_REFLEX}) - REFLEX_GENERATE_DICTIONARY(GVTrackDict Track.h SELECTION TrackDict.xml) -else() - ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) -endif() +REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) +ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) target_include_directories(testVectorIOdict PRIVATE ./) if (DEFINED ENV{USE_REFLEX}) From aab8283aecf617f82a79362b03cd72faf04d76d0 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 15 Apr 2026 08:05:24 +0200 Subject: [PATCH 17/18] Apply suggestions from code review Co-authored-by: ferdymercury --- math/genvector/test/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 10aec866220ac..cbdacce69b0bf 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -22,12 +22,17 @@ ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +ROOT_EXECUTABLE(testVectorIOdictxml testVectorIO.cxx GVTrackDictXml.cxx LIBRARIES GenVector Tree Hist Gpad Physics) target_include_directories(testVectorIOdict PRIVATE ./) if (DEFINED ENV{USE_REFLEX}) target_compile_definitions(testVectorIOdict PRIVATE USE_REFLEX) endif() +target_include_directories(testVectorIOdict PRIVATE ./) +target_include_directories(testVectorIOdictXml PRIVATE ./) +target_compile_definitions(testVectorIOdictXml PRIVATE USE_REFLEX) ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) +ROOT_ADD_TEST(test-genvector-vectoriodictxml COMMAND testVectorIOdictXml) ROOT_EXECUTABLE(coordinates3D coordinates3D.cxx LIBRARIES GenVector) ROOT_ADD_TEST(test-genvector-coordinates3D COMMAND coordinates3D) From 6db032a3128bf704f30b125f5079dee144c6bfc9 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 15 Apr 2026 08:12:18 +0200 Subject: [PATCH 18/18] test variants --- math/smatrix/test/CMakeLists.txt | 47 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index 3f80e46d2064b..d035fc1ac0e1e 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -20,33 +20,38 @@ set(TestSource stressKalman.cxx) -if (DEFINED ENV{USE_REFLEX}) - REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) -else() - ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) -endif() +ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +REFLEX_GENERATE_DICTIONARY(TrackDictXml Track.h SELECTION TrackDict.xml) #---Build and add all the defined test in the list--------------- foreach(file ${TestSource}) + get_filename_component(testname ${file} NAME_WE) if (testname STREQUAL "testIO") - ROOT_EXECUTABLE(${testname} ${file} TrackDict.cxx LIBRARIES ${Libraries}) + set(variants "" "Xml") else() - ROOT_EXECUTABLE(${testname} ${file} LIBRARIES ${Libraries}) - endif() - target_include_directories(${testname} PRIVATE ./) - if (DEFINED ENV{USE_REFLEX}) - target_compile_definitions(${testname} PRIVATE USE_REFLEX) + set(variants "") endif() - if (DEFINED ENV{CLHEPBASE}) - target_include_directories(${testname} PRIVATE $ENV{CLHEPBASE}) - target_compile_definitions(${testname} PRIVATE HAVE_CLHEP) - if (WIN32) - target_link_libraries(${testname} PRIVATE "$ENV{CLHEPBASE}/lib/CLHEP.lib") - else() - target_link_libraries(${testname} PRIVATE "CLHEP" "m") - target_link_directories(${testname} PRIVATE "$ENV{CLHEPBASE}/lib") - endif() + foreach(variant ${variants}) + if (testname STREQUAL "testIO") + ROOT_EXECUTABLE(${testname}${variant} ${file} TrackDict${variant}.cxx LIBRARIES ${Libraries}) + if (variant STREQUAL "Xml") + target_compile_definitions(${testname}${variant} PRIVATE USE_REFLEX) + endif() + else() + ROOT_EXECUTABLE(${testname}${variant} ${file} LIBRARIES ${Libraries}) + endif() + target_include_directories(${testname}${variant} PRIVATE ./) + if (DEFINED ENV{CLHEPBASE}) + target_include_directories(${testname}${variant} PRIVATE $ENV{CLHEPBASE}) + target_compile_definitions(${testname}${variant} PRIVATE HAVE_CLHEP) + if (WIN32) + target_link_libraries(${testname}${variant} PRIVATE "$ENV{CLHEPBASE}/lib/CLHEP.lib") + else() + target_link_libraries(${testname}${variant} PRIVATE "CLHEP" "m") + target_link_directories(${testname}${variant} PRIVATE "$ENV{CLHEPBASE}/lib") + endif() + endif() + ROOT_ADD_TEST(smatrix-${testname}${variant} COMMAND ${testname}${variant} LABELS ${${testname}${variant}_LABELS}) endif() - ROOT_ADD_TEST(smatrix-${testname} COMMAND ${testname} LABELS ${${testname}_LABELS}) endforeach()