sherpa is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/sherpa does not appear to be a Subversion repository.). Look in the Trac log for more information.
Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#259 closed defect (fixed)

Some METOOLS files not following C++ template standards

Reported by: Generic User (don't modify these fields) Owned by: support@sherpa-mc.de
Priority: major Milestone: rel-2.0.0
Component: Unknown Version: 2.0.beta2
Keywords: c++ standards Cc: David.Hall@physics.ox.ac.uk

Description

Hello, I recently tried to compile Sherpa using clang. It gave a couple of errors relating to template use. I believe that the current Sherpa code is not quite following the C++ standards that clang is quite fussy about.

The first point is the error: use 'template' keyword to treat 'Get' as a dependent template name. The error is explained here (http://stackoverflow.com/questions/3786360/confusing-template-error). This appears for several places in the code, so I provide a list at the end of the message for your convenience.

The second error is more complicated and is explained here (http://clang.llvm.org/compatibility.html#dep_lookup). In file included from Phase_Space_Handler.C:16: ../../ATOOLS/Phys/Blob.H:219:6: error: call to function 'operator<<' that is neither visible in the template

definition nor found by argument-dependent lookup

s<<m_data;

Phase_Space_Handler.C:870:16: note: in instantiation of member function

'ATOOLS::Blob_Data<PHASIC::Weight_Info>::operator>>' requested here

template class Blob_Data<Weight_Info>; Phase_Space_Handler.C:860:18: note: 'operator<<' should be declared prior to the call site or in namespace 'PHASIC'

std::ostream & operator<<(std::ostream & s, const PHASIC::Weight_Info & wi)

However, I struggle to know how to solve this without a deeper knowledge of your code.

Cheers, David

inreplace 'METOOLS/Currents/S_C.C', 'CScalarType_Vector *j(m_j[i].Get<CScalarType>());', 'CScalarType_Vector *j(m_j[i].template Get<CScalarType>());'

inreplace 'METOOLS/Currents/F_C.C', 'CSpinorType_Vector *j(m_j[i].Get<CSpinorType>());', 'CSpinorType_Vector *j(m_j[i].template Get<CSpinorType>());' inreplace 'METOOLS/Currents/V_C.C', 'CVec4Type_Vector *j(m_j[i].Get<CVec4Type>());', 'CVec4Type_Vector *j(m_j[i].template Get<CVec4Type>());' inreplace 'METOOLS/Currents/T_C.C', 'CAsT4Type_Vector *j(m_j[i].Get<CAsT4Type>());', 'CAsT4Type_Vector *j(m_j[i].template Get<CAsT4Type>());' inreplace 'METOOLS/Vertices/SSVV_LC.C', 'CVec4Type_Vector *ca(jit[m_n[1]]->Get<CVec4Type>());', 'CVec4Type_Vector *ca(jit[m_n[1]]->template Get<CVec4Type>());' inreplace 'METOOLS/Vertices/SSVV_LC.C', 'CVec4Type_Vector *cb(jit[m_n[2]]->Get<CVec4Type>());', 'CVec4Type_Vector *cb(jit[m_n[2]]->template Get<CVec4Type>());' inreplace 'METOOLS/Vertices/SSVV_LC.C', 'CScalarType_Vector *ce(jit[m_n[0]]->Get<CScalarType>());', 'CScalarType_Vector *ce(jit[m_n[0]]->template Get<CScalarType>());' inreplace 'METOOLS/Vertices/SSVV_LC.C', 'CScalarType_Vector *ca(jit[m_n[0]]->Get<CScalarType>());', 'CScalarType_Vector *ca(jit[m_n[0]]->template Get<CScalarType>());' inreplace 'METOOLS/Vertices/SSVV_LC.C', 'CScalarType_Vector *cb(jit[m_n[1]]->Get<CScalarType>());', 'CScalarType_Vector *cb(jit[m_n[1]]->template Get<CScalarType>());' inreplace 'METOOLS/Vertices/SSVV_LC.C', 'CVec4Type_Vector *ce(jit[m_n[2]]->Get<CVec4Type>());', 'CVec4Type_Vector *ce(jit[m_n[2]]->template Get<CVec4Type>());' inreplace 'METOOLS/Vertices/VVVV_LC.C', 'CVec4Type_Vector *ca(jit[m_n[0]]->Get<CVec4Type>());', 'CVec4Type_Vector *ca(jit[m_n[0]]->template Get<CVec4Type>());' inreplace 'METOOLS/Vertices/VVVV_LC.C', 'CVec4Type_Vector *cb(jit[m_n[1]]->Get<CVec4Type>());', 'CVec4Type_Vector *cb(jit[m_n[1]]->template Get<CVec4Type>());' inreplace 'METOOLS/Vertices/VVVV_LC.C', 'CVec4Type_Vector *ce(jit[m_n[2]]->Get<CVec4Type>());', 'CVec4Type_Vector *ce(jit[m_n[2]]->template Get<CVec4Type>());'

Attachments (2)

clang.patch (9.6 KB) - added by hoeth 11 years ago.
fixing clang errors/warnings
143_clang.patch (6.2 KB) - added by David Hall <David.Hall@physics.ox.ac.uk> 11 years ago.
Patch for Sherpa-1.4.3 to compile under clang

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by hoeth

Attachment: clang.patch added

fixing clang errors/warnings

comment:1 in reply to:  description Changed 11 years ago by hoeth

Resolution: fixed
Status: newclosed

I've already fixed thos issues last week -- see the attached patch. Please re-open this ticket if you still have problems.

comment:2 Changed 11 years ago by Generic User (don't modify these fields)

Hi Hendrik,

Thank you for the patch! Is there also a version for the stable release 1.4.3? (This patch fails for that version)

Cheers, David

comment:3 Changed 11 years ago by hoeth

I'll have a look, but it will take until next week, since I'm actually at a meeting in London at the moment. You should be able to have a look at the patch and identify the one bit that's needed for you. It's moving the operator definition from Phase_Space_Handler.C to its header file and inlining it.

Changed 11 years ago by David Hall <David.Hall@physics.ox.ac.uk>

Attachment: 143_clang.patch added

Patch for Sherpa-1.4.3 to compile under clang

comment:4 Changed 11 years ago by David Hall <David.Hall@physics.ox.ac.uk>

Hi Hendrik, I have attached a patch for 1.4.3 to this ticket now. Cheers, David

comment:5 in reply to:  4 Changed 11 years ago by hoeth

Thanks, I'm applying it to the repository now.

Modify Ticket

Change Properties
Action
as closed The owner will remain support@sherpa-mc.de.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.