Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LTO - SimCalorimetry/HGCalAssociatorProducers] Compiler warnings -Wodr in simulation category #38684

Closed
aandvalenzuela opened this issue Jul 11, 2022 · 7 comments · Fixed by #39118

Comments

@aandvalenzuela
Copy link
Contributor

Hello,

We have seen some compiler warnings of the type -Wodr in LTO_X IBs (CMSSW_12_5_LTO_X_2022-07-07-1100 and CMSSW_12_5_LTO_X_2022-07-06-1100, for example) in SimCalorimetry/HGCalAssociatorProducers. See sample stack trace:

>> Building edm plugin tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/libSimCalorimetryHGCalAssociatorProducersAuto.so
/data/cmsbld/jenkins/workspace/build-any-ib/w/el8_amd64_gcc10/external/gcc/10.3.0-84898dea653199466402e67d73657f10/bin/c++ -O2 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++1z -ftree-vectorize -Wstrict-overflow -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -msse3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-unused-parameter -Wunused -Wparentheses -Wno-deprecated -Werror=return-type -Werror=missing-braces -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Wno-error=unused-variable -DBOOST_DISABLE_ASSERTS -flto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -shared -Wl,-E -Wl,-z,defs tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToCPAssociatorByEnergyScoreImpl.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToCPAssociatorByEnergyScoreProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToCPAssociatorEDProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToSCAssociatorByEnergyScoreImpl.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToSCAssociatorByEnergyScoreProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToSCAssociatorEDProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToSimTSAssociatorByEnergyScoreImpl.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToSimTSAssociatorByEnergyScoreProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/LCToSimTSAssociatorEDProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/MCToCPAssociatorEDProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/MultiClusterAssociatorByEnergyScoreImpl.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/MultiClusterAssociatorByEnergyScoreProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/TSToSCAssociatorByEnergyScoreImpl.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/TSToSCAssociatorByEnergyScoreProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/TSToSCAssociatorEDProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/TSToSimTSAssociatorByEnergyScoreImpl.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/TSToSimTSAssociatorByEnergyScoreProducer.cc.o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/TSToSimTSAssociatorEDProducer.cc.o -o tmp/el8_amd64_gcc10/src/SimCalorimetry/HGCalAssociatorProducers/plugins/SimCalorimetryHGCalAssociatorProducersAuto/libSimCalorimetryHGCalAssociatorProducersAuto.so -Wl,-E -Wl,--hash-style=gnu -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/biglib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/lib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/external/el8_amd64_gcc10/lib -lRecoLocalCaloHGCalRecAlgos -lSimDataFormatsAssociations -lDataFormatsParticleFlowReco -lDataFormatsEgammaCandidates -lDataFormatsMuonReco -lGeometryHGCalGeometry -lDataFormatsRecoCandidate -lTrackingToolsGeomPropagators -lDataFormatsEgammaReco -lDataFormatsGsfTrackReco -lDataFormatsHGCalReco -lDataFormatsVertexReco -lSimDataFormatsTrackingAnalysis -lTrackingToolsTrajectoryState -lDataFormatsTrackReco -lDataFormatsGEMRecHit -lDataFormatsTrackCandidate -lDataFormatsTrackerRecHit2D -lDataFormatsCSCRecHit -lDataFormatsDTRecHit -lDataFormatsFTLRecHit -lDataFormatsTrajectorySeed -lGeometryHcalTowerAlgo -lDataFormatsTrackingRecHit -lGeometryCaloTopology -lDataFormatsL1TrackTrigger -lGeometryHcalCommonData -lDataFormatsTrackerCommon -lDetectorDescriptionRegressionTest -lGeometryCaloGeometry -lGeometryCommonTopologies -lSimDataFormatsCaloAnalysis -lCondFormatsAlignment -lDataFormatsBeamSpot -lDataFormatsCaloTowers -lDataFormatsEcalRecHit -lDataFormatsGeometryCommonDetAlgo -lDataFormatsHepMCCandidate -lDataFormatsSiStripCluster -lDetectorDescriptionParser -lGeometryHGCalCommonData -lGeometryRecords -lTrackingToolsAnalyticalJacobians -lCondFormatsAlignmentRecord -lDataFormatsCandidate -lDataFormatsDTDigi -lDataFormatsEcalDigi -lDataFormatsGeometrySurface -lDataFormatsHGCRecHit -lDataFormatsTrajectoryState -lDetectorDescriptionCore -lDetectorDescriptionDDCMS -lMagneticFieldEngine -lCondFormatsGeometryObjects -lDataFormatsCLHEP -lDataFormatsCaloRecHit -lDataFormatsEcalDetId -lDataFormatsForwardDetId -lDataFormatsGeometryVector -lDataFormatsHcalDetId -lDataFormatsL1GlobalTrigger -lDataFormatsMuonDetId -lDataFormatsPhase2TrackerCluster -lDataFormatsSiPixelDetId -lDataFormatsSiStripDetId -lFWCoreFramework -lSimDataFormatsCaloHit -lSimDataFormatsTrack -lSimDataFormatsVertex -lDataFormatsDetId -lDataFormatsFEDRawData -lDataFormatsL1GlobalMuonTrigger -lDataFormatsMath -lDataFormatsPhase2TrackerDigi -lDataFormatsScouting -lDataFormatsSiPixelCluster -lDataFormatsSiStripDigi -lFWCoreCommon -lFWCoreServiceRegistry -lSimDataFormatsGeneratorProducts -lDataFormatsCommon -lFWCoreParameterSet -lFWCoreMessageLogger -lDataFormatsProvenance -lFWCorePluginManager -lFWCoreReflection -lTrackingToolsTrajectoryParametrization -lCondFormatsSerialization -lFWCoreConcurrency -lFWCoreUtilities -lFWCoreVersion -lSimDataFormatsEncodedEventId -lUtilitiesXerces -lDDAlign -lDDCond -lDDCore -lDDParsers -lMinuit -lGpad -lGraf -lPhysics -lHist -lMatrix -lGenVector -lMathMore -lTree -lNet -lGeom -lThread -lMathCore -lRIO -lSmatrix -lboost_serialization -lCore -lboost_thread -lboost_date_time -lCLHEP -lHepMCfio -lHepMC -lpcre -lbz2 -lgsl -luuid -ltbb -lxerces-c -llzma -lz -lfmt -lHepMC3 -lHepMC3search -lcms-md5 -lopenblas -lcrypt -ldl -lrt -lstdc++fs -ltinyxml2
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/SimCalorimetry/HGCalAssociatorProducers/plugins/LCToCPAssociatorByEnergyScoreImpl.h:44:10: warning: type 'struct caloParticleOnLayer' violates the C++ One Definition Rule [-Wodr]
    44 |   struct caloParticleOnLayer {
      |          ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/SimCalorimetry/HGCalAssociatorProducers/plugins/MultiClusterAssociatorByEnergyScoreImpl.h:35:10: note: a different type is defined in another translation unit
   35 |   struct caloParticleOnLayer {
      |          ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/SimCalorimetry/HGCalAssociatorProducers/plugins/LCToCPAssociatorByEnergyScoreImpl.h:48:54: note: the first difference of corresponding definitions is field 'layerClusterIdToEnergyAndScore'
   48 |     std::unordered_map<int, std::pair<float, float>> layerClusterIdToEnergyAndScore;
      |                                                      ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/SimCalorimetry/HGCalAssociatorProducers/plugins/MultiClusterAssociatorByEnergyScoreImpl.h:39:54: note: a field with different name is defined in another translation unit
   39 |     std::unordered_map<int, std::pair<float, float>> multiClusterIdToEnergyAndScore;
      |                                                      ^
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/SimCalorimetry/HGCalAssociatorProducers/plugins/LCToSCAssociatorByEnergyScoreImpl.h:42:10: warning: type 'struct simClusterOnLayer' violates the C++ One Definition Rule [-Wodr]
    42 |   struct simClusterOnLayer {
      |          ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/SimCalorimetry/HGCalAssociatorProducers/plugins/TSToSCAssociatorByEnergyScoreImpl.h:28:10: note: a different type is defined in another translation unit
   28 |   struct simClusterOnLayer {
      |          ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/SimCalorimetry/HGCalAssociatorProducers/plugins/LCToSCAssociatorByEnergyScoreImpl.h:46:54: note: the first difference of corresponding definitions is field 'layerClusterIdToEnergyAndScore'
   46 |     std::unordered_map<int, std::pair<float, float>> layerClusterIdToEnergyAndScore;
      |                                                      ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/SimCalorimetry/HGCalAssociatorProducers/plugins/TSToSCAssociatorByEnergyScoreImpl.h:32:54: note: a field with different name is defined in another translation unit
   32 |     std::unordered_map<int, std::pair<float, float>> tracksterIdToEnergyAndScore;
      |                                                      ^
Leaving library rule at src/SimCalorimetry/HGCalAssociatorProducers/plugins

This warning is also shown in other packages, such as reported in #38650 and #38656. It seems there are some elements defined multiple times within the same namespace leading to violation of the C++ One Definition Rule. Could you please have a look at it?

Many thanks,
Andrea.

@aandvalenzuela
Copy link
Contributor Author

assign simulation

@cmsbuild
Copy link
Contributor

New categories assigned: simulation

@mdhildreth,@civanch you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

A new Issue was created by @aandvalenzuela Andrea Valenzuela.

@Dr15Jones, @perrotta, @dpiparo, @rappoccio, @makortel, @smuzaffar, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@aandvalenzuela aandvalenzuela changed the title [LTO - SimCalorimetry/HGCalAssociatorProducers] Solve -Wodr compiler warnings [LTO - SimCalorimetry/HGCalAssociatorProducers] Compiler warnings -Wodr in simulation category Jul 11, 2022
@civanch
Copy link
Contributor

civanch commented Jul 13, 2022

@rovere , @felicepantaleo , I do not know who is available just now. The fix seems to be simple and very technical

@civanch
Copy link
Contributor

civanch commented Jul 13, 2022

assign upgrade

@cmsbuild
Copy link
Contributor

New categories assigned: upgrade

@AdrianoDee,@srimanob you have been requested to review this Pull request/Issue and eventually sign? Thanks

@aandvalenzuela
Copy link
Contributor Author

Hello,
Are there any news on this fix? We would like to move LTO IBs forward, so we need to clean any errors/warnings.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants