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

DD4hep fails to build with latest Geant4 11 ( 10.7.ref9) #881

Closed
smuzaffar opened this issue Nov 9, 2021 · 15 comments
Closed

DD4hep fails to build with latest Geant4 11 ( 10.7.ref9) #881

smuzaffar opened this issue Nov 9, 2021 · 15 comments
Assignees
Labels
Fixed Problem is solved Testing

Comments

@smuzaffar
Copy link

We are trying to build/test new Geant4 11 ( 10.7.Ref9) version for CMS offline software ( cms-sw/cmsdist#7436 ) but looks like currently DD4Hep does not support/build with it. We are getting the compilation errors 9 see below).

  • OS version: SLC7
  • Compiler version: GCC 9.3.0
  • DD4hep version: v01-18
  • Reproduced by: The build failed with errors like
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-b0ba8d9db156bba37a2d9b5cfd320054/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp:151:10: error: 'kFASTCOMPONENT' was not declared in this scope; did you mean 'kWLSCOMPONENT'?
  151 |     case kFASTCOMPONENT:                  return make_pair(CLHEP::keV/units::keV, 1.0);
      |          ^~~~~~~~~~~~~~
      |          kWLSCOMPONENT
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-b0ba8d9db156bba37a2d9b5cfd320054/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp:152:10: error: 'kSLOWCOMPONENT' was not declared in this scope; did you mean 'kWLSCOMPONENT'?
  152 |     case kSLOWCOMPONENT:                  return make_pair(CLHEP::keV/units::keV, 1.0);
      |          ^~~~~~~~~~~~~~
      |          kWLSCOMPONENT

see the full buil log at https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b6c16f/20363/external/dd4hep/v01-18x-b0ba8d9db156bba37a2d9b5cfd320054/log or https://muzaffar.web.cern.ch/dd4hep-geant11.txt

  • Goal: We would like to test new Geant4 in CMS Offline software and for that we need to build DD4Hep too.
MarkusFrankATcernch added a commit to MarkusFrankATcernch/DD4hep that referenced this issue Nov 12, 2021
MarkusFrankATcernch added a commit to MarkusFrankATcernch/DD4hep that referenced this issue Nov 12, 2021
MarkusFrankATcernch added a commit to MarkusFrankATcernch/DD4hep that referenced this issue Nov 12, 2021
MarkusFrankATcernch added a commit to MarkusFrankATcernch/DD4hep that referenced this issue Nov 12, 2021
MarkusFrankATcernch added a commit to MarkusFrankATcernch/DD4hep that referenced this issue Nov 12, 2021
@MarkusFrankATcernch MarkusFrankATcernch self-assigned this Nov 12, 2021
@MarkusFrankATcernch
Copy link
Contributor

@smuzaffar #882

@MarkusFrankATcernch MarkusFrankATcernch added Fixed Problem is solved Testing labels Nov 12, 2021
@smuzaffar
Copy link
Author

thanks @MarkusFrankATcernch , I am testing the latest DD4hep now

@MarkusFrankATcernch
Copy link
Contributor

@smuzaffar Thanks. If this PR solves your problem, please close the issue so that we can forget about it. :-)

@smuzaffar
Copy link
Author

@MarkusFrankATcernch , we still have more build errors [a]. Can youplease also provide a fix for this

[a] https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b6c16f/20554/external/dd4hep/v01-18x-4597a04bcb6abfbf7ab76425c38d479d/log

/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-4597a04bcb6abfbf7ab76425c38d479d/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp:387:62: error: no matching function for call to 'G4MaterialPropertiesTable::GetPropertyIndex(const char*, bool)'
  387 |       int idx = tab->GetPropertyIndex(named->GetName(), false);
      |                                                              ^
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4Material.hh:104,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4StepPoint.hh:48,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4Step.hh:53,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4VSensitiveDetector.hh:33,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-4597a04bcb6abfbf7ab76425c38d479d/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp:51:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4MaterialPropertiesTable.hh:138:9: note: candidate: 'G4int G4MaterialPropertiesTable::GetPropertyIndex(const G4String&) const'
  138 |   G4int GetPropertyIndex(const G4String& key) const;
      |         ^~~~~~~~~~~~~~~~
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4MaterialPropertiesTable.hh:138:9: note:   candidate expects 1 argument, 2 provided
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-4597a04bcb6abfbf7ab76425c38d479d/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp:422:67: error: no matching function for call to 'G4MaterialPropertiesTable::GetConstPropertyIndex(const char*, bool)'
  422 |       int idx = tab->GetConstPropertyIndex(named->GetName(), false);
      |                                                                   ^
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4Material.hh:104,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4StepPoint.hh:48,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4Step.hh:53,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4VSensitiveDetector.hh:33,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-4597a04bcb6abfbf7ab76425c38d479d/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp:51:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4MaterialPropertiesTable.hh:133:9: note: candidate: 'G4int G4MaterialPropertiesTable::GetConstPropertyIndex(const G4String&) const'
  133 |   G4int GetConstPropertyIndex(const G4String& key) const;
      |         ^~~~~~~~~~~~~~~~~~~~~
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4MaterialPropertiesTable.hh:133:9: note:   candidate expects 1 argument, 2 provided
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-4597a04bcb6abfbf7ab76425c38d479d/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp: In member function 'void* dd4hep::sim::Geant4Converter::handleOpticalSurface(TObject*) const':
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-4597a04bcb6abfbf7ab76425c38d479d/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp:1173:62: error: no matching function for call to 'G4MaterialPropertiesTable::GetPropertyIndex(const char*, bool)'
 1173 |       int idx = tab->GetPropertyIndex(named->GetName(), false);
      |                                                              ^
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4Material.hh:104,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4StepPoint.hh:48,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4Step.hh:53,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4VSensitiveDetector.hh:33,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/BUILD/slc7_amd64_gcc900/external/dd4hep/v01-18x-4597a04bcb6abfbf7ab76425c38d479d/dd4hep-v01-18x/DDG4/src/Geant4Converter.cpp:51:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/testBuildDir/slc7_amd64_gcc900/external/geant4/10.7ref09-d8b4ec65cd6f348dfcf9b68e480ebed7/include/Geant4/G4MaterialPropertiesTable.hh:138:9: note: candidate: 'G4int G4MaterialPropertiesTable::GetPropertyIndex(const G4String&) const'
  138 |   G4int GetPropertyIndex(const G4String& key) const;
      |         ^~~~~~~~~~~~~~~~

@MarkusFrankATcernch
Copy link
Contributor

@smuzaffar These fixes are a bit difficult, because I cannot really compile this myself.
When using G4 11.0 beta these do not appear....Can you not live with G4 11.0 beta ?

@smuzaffar
Copy link
Author

We are using gent4 11 beta ( https://github.com/cms-externals/geant4/blob/cms/v10.7ref09/CMakeLists.txt#L31 ) . 10.7.ref09 is internal cms name to not confuse the branch with official geant4 11 future release.

@MarkusFrankATcernch
Copy link
Contributor

@smuzaffar This is bizarre....
I downloaded G4 11 beta from the G4 website last week when building the fix and I have as well:

  G4int GetConstPropertyIndex(const G4String& key,
                              G4bool warning = false) const;
  // Get the constant property index from the key-name

  G4int GetPropertyIndex(const G4String& key, G4bool warning = false) const;
  // Get the property index by the key-name.

Something looks inconsistent between the G4 website and you snapshot.

@smuzaffar
Copy link
Author

@civanch has provided us the snapshot. It could be that this has been fixed in upstream geant4. @civanch , can you please check and may be provide a new snapshot?

@civanch
Copy link

civanch commented Nov 18, 2021

@smuzaffar , @MarkusFrankATcernch , candidate version for 11.0 is available in ~vnivanch/public/geant4.11.0/

Difficulty of migration 10.7 -> 11.0 is in general clean-up of Geant4 interfaces for the next major release.

@smuzaffar
Copy link
Author

smuzaffar commented Nov 18, 2021

thanks @civanch , I have pushed the new ~vnivanch/public/geant4.11.0/ here https://github.com/cms-externals/geant4/tree/cms/v10.7ref09 but I see that https://github.com/cms-externals/geant4/blob/cms/v10.7ref09/source/materials/include/G4MaterialPropertiesTable.hh#L138 still has

G4int GetPropertyIndex(const G4String& key) const;

so I think we will still get the error I mentioned #881 (comment)

@civanch
Copy link

civanch commented Nov 19, 2021

In the History of Geant4 modifications the author mention that second bool parameter of this method is removed because user should not ask for non-existing property. Instead there is a new method allowing to check if the property exist.

Candidate version of Geant4, which I provide above includes all interface modifications, which will be in the new Geant4 11.0. So, can be used to prepare DD4hep code to be compliant with the new Geant4.

@smuzaffar
Copy link
Author

@MarkusFrankATcernch , I see that in DD4hep code GetConstPropertyIndex is called with default value false. So an easy fix would be to just remve the 2nd default parameter from the 3 calls ( mentioned #881 (comment))

@MarkusFrankATcernch
Copy link
Contributor

@smuzaffar I will implement something along your suggestion.
However, I have to trap the exceptions in this case, because there are people with material properties not understood by Geant4.....give me a few days. Should be ready early next week.

@MarkusFrankATcernch
Copy link
Contributor

MarkusFrankATcernch commented Nov 23, 2021

@smuzaffar I provided a fix to your problem. Please see #884 .
Still: neither on the github nor on the gitlab repository your snapshot of Geant4 is visible...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Problem is solved Testing
Projects
None yet
Development

No branches or pull requests

3 participants