AIDASoft / DD4hep

Detector Description Toolkit for High Energy Physics
http://dd4hep.cern.ch
GNU Lesser General Public License v3.0
50 stars 99 forks source link

ROOT TGeoMatrix interface change #426

Closed iarspider closed 6 years ago

iarspider commented 6 years ago

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

ianna commented 6 years ago

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

andresailer commented 6 years ago

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

Thanks

iarspider commented 6 years ago

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

mrodozov commented 6 years ago

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 commented 6 years ago

So we have to add an implementation of _transform that takes a TGeoMatrix const& https://github.com/AIDASoft/DD4hep/blob/dff301818cfa026b953917bccf4d91361bd8a1e3/DDCore/src/MatrixHelpers.cpp#L103-L114

and drop the & from the problematic line?

mrodozov commented 6 years ago

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