cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.08k stars 4.32k forks source link

Compilation errors when activating EDM_ML_DEBUG #29250

Closed fabiocos closed 4 years ago

fabiocos commented 4 years ago

Trying to use some LogDebug statements I have realized that we have code associated to them, apparently not tested in the regular integration procedure because the needed flag is not active, that looks broken.

Ad far as I can see in cms-bot, EDM_ML_DEBUG seems to be used only in the static analyzer test (@smuzaffar do you confirm ?).

For future reference I have compiled the whole CMSSW as of CMSSW_11_1_X_2020-03-19-1100 with USER_CXXFLAGS="-g -D=EDM_ML_DEBUG" scram b -k and see the following list of errors to be inspected:

10:17 cmsdev25 623> grep "\*\*\*" LOGDEBUG | grep tmp
gmake: *** [tmp/slc7_amd64_gcc820/src/Geometry/TrackerCommonData/plugins/DD4hep_TrackerGeometryPlugins/dd4hep/DDTrackerRingAlgo.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/CondFormats/SiPixelTransient/src/CondFormatsSiPixelTransient/SiPixelUtils.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimG4Core/Geometry/src/SimG4CoreGeometry/DDG4ProductionCuts.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimG4Core/Geometry/src/SimG4CoreGeometry/bigobj/DDG4ProductionCuts.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimG4Core/Geometry/src/SimG4CoreGeometry/bigobj/SimG4CoreGeometry.obj] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/Geometry/HcalTowerAlgo/src/GeometryHcalTowerAlgo/HcalDDDGeometryLoader.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimFastTiming/FastTimingCommon/src/SimFastTimingFastTimingCommon/ETLElectronicsSim.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimFastTiming/FastTimingCommon/src/SimFastTimingFastTimingCommon/BTLElectronicsSim.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQM/SiStripMonitorClient/src/DQMSiStripMonitorClient/SiStripTrackerMapCreator.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/Calibration/IsolatedParticles/src/CalibrationIsolatedParticles/MatchingSimTrack.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/RecoMTD/MeasurementDet/src/RecoMTDMeasurementDet/MTDDetLayerMeasurements.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimG4CMS/HGCalTestBeam/plugins/SimG4CMSTestBeamPlugins/HGCPassive.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/RecoTracker/SiTrackerMRHTools/src/RecoTrackerSiTrackerMRHTools/SimpleDAFHitCollector.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimG4CMS/HGCalTestBeam/plugins/SimG4CMSTestBeamPlugins/bigobj/HGCPassive.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/CondFormats/SiPixelTransient/src/CondFormatsSiPixelTransient/libCondFormatsSiPixelTransient.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimG4CMS/HGCalTestBeam/plugins/SimG4CMSTestBeamPlugins/bigobj/SimG4CMSTestBeamPlugins.obj] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimTransport/PPSProtonTransport/src/SimTransportPPSProtonTransport/libSimTransportPPSProtonTransport.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimPPS/PPSSimTrackProducer/plugins/SimPPSPPSSimTrackProducerAuto/libSimPPSPPSSimTrackProducerAuto.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimG4Core/Geometry/src/SimG4CoreGeometry/libSimG4CoreGeometry.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/Geometry/TrackerCommonData/plugins/DD4hep_TrackerGeometryPlugins/libDD4hep_TrackerGeometryPlugins.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQMOffline/Trigger/src/DQMOfflineTrigger/HLTTauDQMPath.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQMOffline/Muon/src/DQMOfflineMuon/TriggerMatchMonitor.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQMOffline/Trigger/plugins/DQMOfflineTriggerPlugins/HLTTauDQMOfflineSource.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/Calibration/TkAlCaRecoProducers/plugins/CalibrationTrackSelectorFromDetIdList/CalibrationTrackSelectorFromDetIdList.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQM/MuonMonitor/plugins/DQMMuonMonitorPlugins/CosmicMuonRecoAnalyzer.cc.o] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/Geometry/HcalTowerAlgo/src/GeometryHcalTowerAlgo/libGeometryHcalTowerAlgo.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimCalorimetry/EcalSimAlgos/src/SimCalorimetryEcalSimAlgos/libSimCalorimetryEcalSimAlgos.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimFastTiming/FastTimingCommon/src/SimFastTimingFastTimingCommon/libSimFastTimingFastTimingCommon.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQM/SiStripMonitorClient/src/DQMSiStripMonitorClient/libDQMSiStripMonitorClient.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/RecoMTD/MeasurementDet/src/RecoMTDMeasurementDet/libRecoMTDMeasurementDet.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/SimG4CMS/HGCalTestBeam/plugins/SimG4CMSTestBeamPlugins/libSimG4CMSTestBeamPlugins.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/Calibration/IsolatedParticles/src/CalibrationIsolatedParticles/libCalibrationIsolatedParticles.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/RecoTracker/SiTrackerMRHTools/src/RecoTrackerSiTrackerMRHTools/libRecoTrackerSiTrackerMRHTools.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/BigProducts/Simulation/pluginSimulation.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQMOffline/Trigger/src/DQMOfflineTrigger/libDQMOfflineTrigger.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQMOffline/Muon/src/DQMOfflineMuon/libDQMOfflineMuon.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQMOffline/Trigger/plugins/DQMOfflineTriggerPlugins/libDQMOfflineTriggerPlugins.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/DQM/MuonMonitor/plugins/DQMMuonMonitorPlugins/libDQMMuonMonitorPlugins.so] Error 1
gmake: *** [tmp/slc7_amd64_gcc820/src/Calibration/TkAlCaRecoProducers/plugins/CalibrationTrackSelectorFromDetIdList/libCalibrationTrackSelectorFromDetIdList.so] Error 1
cmsbuild commented 4 years ago

A new Issue was created by @fabiocos Fabio Cossutti.

@Dr15Jones, @smuzaffar, @silviodonato, @makortel, @davidlange6, @fabiocos can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

makortel commented 4 years ago

assign core

cmsbuild commented 4 years ago

New categories assigned: core

@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks

makortel commented 4 years ago

So should we consider building occasionally (e.g. once a week?) with EDM_ML_DEBUG?

fabiocos commented 4 years ago

@makortel I think it might help. This issue is not breaking any production workflow, but shows that we integrate dysfunctional (although mostly unused) code

smuzaffar commented 4 years ago

@fabiocos , @silviodonato , as discussed, we will add an extra test for IBs (production arch only) to compile with this flag. We will also update the PR testsing job to parse the static analyzer scram log (where we enable this flag) and report any build errors

fabiocos commented 4 years ago

@casarsa there are two errors in MTD digitization:

#ifdef EDM_ML_DEBUG
  for (int it = 0; it < (int)(chargeColl.size()); it++)
    debug |= (chargeColl[it] > adcThreshold_fC_);
#endif

but adcThreshold_fC_ is no more there. Can we just replace it with 0? Or what is your suggestion?

casarsa commented 4 years ago

@casarsa there are two errors in MTD digitization:

#ifdef EDM_ML_DEBUG
  for (int it = 0; it < (int)(chargeColl.size()); it++)
    debug |= (chargeColl[it] > adcThreshold_fC_);
#endif

but adcThreshold_fC_ is no more there. Can we just replace it with 0? Or what is your suggestion?

@fabiocos 0 is fine

fabiocos commented 4 years ago

@casarsa wait, you have now adcThreshold_MIP_, should we just use that? It looks to me that this is the case...

casarsa commented 4 years ago

@fabiocos you are right adcThresholdMIP is used to set a bit in the BTL and ETL samples. For consistency, it's better to use this constant.

fabiocos commented 4 years ago

according to my test on CMSSW_11_1_X_2020-03-31-1100 the PR #29283 has fixed all the know problems. @smuzaffar @silviodonato I would say that if a warning may be implemented, now it could be done on top of a clean situation.

silviodonato commented 4 years ago

Thank you @fabiocos!

smuzaffar commented 4 years ago

@fabiocos , @silviodonato I have opened https://github.com/cms-sw/cms-bot/pull/1289 which will look for build errors in the static analyzer build log. It will create a new link on the PR summary page ( https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b8b54e/5623/summary.html ) . Currently bot will not reject PR in case of static analyzer build error though. If no objections then I will merge cms-sw/cms-bot#1289 it.

By the way, I noticed that we do not run static analyzer for Fireworks packages and test subdirectory

SCRAM_IGNORE_PACKAGES="Fireworks/% Utilities/StaticAnalyzers" 
SCRAM_IGNORE_SUBDIRS=test

So we are not checking full cmssw for EDM_ML_DEBUG

silviodonato commented 4 years ago

thanks @smuzaffar

fabiocos commented 4 years ago

@smuzaffar thanks, this is indeed the kind of check that can be useful. The fact that Fireworks is left out implies that this is a partial test, but as far as I can see Fireworks is not using this flag, and it is already having a kind of special treatment in PR checks.