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

ROOT TGeoMatrix interface change #426

Closed
iarspider opened this issue Aug 1, 2018 · 6 comments · Fixed by #428
Closed

ROOT TGeoMatrix interface change #426

iarspider opened this issue Aug 1, 2018 · 6 comments · Fixed by #428

Comments

@iarspider
Copy link

Dear DD4Hep developers,

dd4hep version 01-05 (and, I think, master as well, since the code in question is unchanged) fails to build with gcc 6.2 (or newer) and HEAD version of ROOT. The error message is "invalid initialization of non-const reference of type ‘TGeoMatrix&’ from an rvalue of type ‘TGeoMatrix’".

Thanks,
Ivan for the GENSER team

  • OS version: SLC6 (not tested, but will likely fail with Centos 7)
  • Compiler version: GCC 6.2, 7.3.0, 8.1.0
  • DD4hep version: tag v01-05
  • Reproduced by: building against ROOT-head.
  • Build log: https://cernbox.cern.ch/index.php/s/TxSdekx7XSLl9bA
    Important part:
[ 44%] Building CXX object UtilityApps/CMakeFiles/geoConverter.dir/src/converter.cpp.o
/mnt/build/jenkins/workspace/lcg_personal_experimental/BUILDTYPE/Release/COMPILER/gcc62binutils/LABEL/slc6/build/projects/DD4hep-01-05/src/DD4hep/01-05/DDCore/src/plugins/LCDDConverter.cpp: In member function ‘virtual xml_h dd4hep::detail::LCDDConverter::handleSolid(const string&, const TGeoShape*) const’:
/mnt/build/jenkins/workspace/lcg_personal_experimental/BUILDTYPE/Release/COMPILER/gcc62binutils/LABEL/slc6/build/projects/DD4hep-01-05/src/DD4hep/01-05/DDCore/src/plugins/LCDDConverter.cpp:552:39: error: invalid initialization of non-const reference of type ‘TGeoMatrix&’ from an rvalue of type ‘TGeoMatrix’
         TGeoMatrix& linv = lm->Inverse()
                            ~~~~~~~~~~~^~
/mnt/build/jenkins/workspace/lcg_personal_experimental/BUILDTYPE/Release/COMPILER/gcc62binutils/LABEL/slc6/build/projects/DD4hep-01-05/src/DD4hep/01-05/DDCore/src/plugins/LCDDConverter.cpp:571:39: error: invalid initialization of non-const reference of type ‘TGeoMatrix&’ from an rvalue of type ‘TGeoMatrix’
         TGeoMatrix& rinv = rm->Inverse()
                            ~~~~~~~~~~~^~
[ 44%] Building CXX object DDG4/CMakeFiles/DDG4.dir/src/Geant4Exec.cpp.o
[ 44%] Building CXX object DDG4/CMakeFiles/DDG4.dir/src/Geant4Field.cpp.o
[ 44%] Building CXX object DDCond/CMakeFiles/DDCond.dir/src/ConditionsOperators.cpp.o
[ 44%] Building CXX object DDEve/CMakeFiles/DDEve.dir/src/DDEvePlugins.cpp.o
make[6]: *** [DDCore/CMakeFiles/DDCorePlugins.dir/src/plugins/LCDDConverter.cpp.o] Error 1
@ianna
Copy link
Contributor

ianna commented Aug 2, 2018

@mrodozov - FYI. We need this fixed as well. That's why our IBs are failing.

@andresailer
Copy link
Member

Can one of you try with TGeoMatrix const& linv and TGeoMatrix const& rinv , respectively?

Thanks

@iarspider
Copy link
Author

The patch works with gcc6 and gcc7, but for gcc8 I now get a different error - will open a separate issue for that.

@mrodozov
Copy link
Contributor

mrodozov commented Aug 3, 2018

When I build with gcc7 still has this

/build/mrodozov/builds/build/update_root/build_dd4hep_with_latest_root614/BUILD/slc6_amd64_gcc700/external/dd4hep/v01-08x-cms/dd4hep-v01-08x/DDCore/src/plugins/Compact2Objects.cpp:1118:101: error: taking ad\
dress of temporary [-fpermissive]
   Transform3D  tr_volume(detail::matrix::_transform(&anchor.nominal().worldTransformation().Inverse()));

@andresailer
Copy link
Member

So we have to add an implementation of _transform that takes a TGeoMatrix const&

Transform3D dd4hep::detail::matrix::_transform(const TGeoMatrix* matrix) {
const Double_t* t = matrix->GetTranslation();
if ( matrix->IsRotation() ) {
const Double_t* r = matrix->GetRotationMatrix();
return Transform3D(r[0],r[1],r[2],t[0]*MM_2_CM,
r[3],r[4],r[5],t[1]*MM_2_CM,
r[6],r[7],r[8],t[2]*MM_2_CM);
}
return Transform3D(0e0,0e0,0e0,t[0]*MM_2_CM,
0e0,0e0,0e0,t[1]*MM_2_CM,
0e0,0e0,0e0,t[2]*MM_2_CM);
}

and drop the & from the problematic line?

mrodozov added a commit to cms-externals/DD4hep that referenced this issue Aug 3, 2018
@mrodozov
Copy link
Contributor

mrodozov commented Aug 3, 2018

I confirm with gcc7 builds with this changes:
master...cms-externals:cms/master/dfd9760-with-fix
(the changes on DDCore/CMakeLists.txt are not related to this)
Cheers,
M.

mrodozov added a commit to cms-sw/cmsdist that referenced this issue Aug 4, 2018
Need for update described here:
AIDASoft/DD4hep#426
Until dd4hep is updated accordingly
andresailer pushed a commit to andresailer/DD4hep that referenced this issue Aug 6, 2018
@petricm petricm changed the title Build fails with ROOT-HEAD ROOT TGeoMatrix interface change Aug 6, 2018
petricm pushed a commit that referenced this issue Aug 7, 2018
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.

5 participants