| Summary: | GEANT4 does not compile with gcc 3.4.1 | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | oberlack |
| Component: | global/management | Assignee: | Gabriele Cosmo <Gabriele.Cosmo> |
| Status: | RESOLVED INVALID | ||
| Severity: | critical | CC: | oberlack, rickard |
| Priority: | P2 | ||
| Version: | 6.2 | ||
| Hardware: | Other | ||
| OS: | Linux | ||
|
Description
oberlack
2004-08-13 13:36:05 CEST
I changed G4Allocator.hh to work for me, by replacing the following lines:
// The gcc-3.1 compiler will complain and not correctly handle offsets
// computed from non-POD types. Pointers to member data should be used
// instead. This C++ feature seems not to work on earlier versions of
// the same compiler.
//
#if (__GNUC__==3) && (__GNUC_MINOR__>0)
Type G4AllocatorUnit<Type>::*pOffset = &G4AllocatorUnit<Type>::fElement;
fUnit = (G4AllocatorUnit<Type> *) ((char *)anElement - size_t(pOffset));
#else
fUnit = (G4AllocatorUnit<Type> *)
((char *) anElement - offsetof(G4AllocatorUnit<Type>, fElement));
#endif
with the following:
fUnit = (G4AllocatorUnit<Type> *)
((char *) anElement + ((char *) fUnit - (char*) &(fUnit->fElement)));
I put a patchfile at http://rickard.holmberg.homeip.net/G4Allocator.patch
Geant4 6.2 is NOT ported on gcc-3.4.X. See the release notes for the list of compilers supported. Porting on the new gcc compiler will be implemented for future releases, where a new implementation of G4Allocator will be provided. *** Bug 678 has been marked as a duplicate of this bug. *** *** 'Gabriele.Cosmo@cern.ch' will be responsible for bug 678. *** |