Message: Geant4 on Sparc and i386 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Geant4 on Sparc and i386 

Forum: Installation and Configuration
Date: 27 Aug, 2010
From: David Clark <David Clark>

Hi all,

I hoping someone here can help me. I am currently trying to build and run G4 on
two Solaris computers. I have seen that Solaris has been dropped from the list
of tested systems, unfortunately they are the only computers I currently have
available to me. I have previously built G4 dozens of times since v4.6 on many
flavours of GNU/Linux, OSX, Windows and have never had this much trouble.

I have made the changes detailed below and the software now performs perfectly
on the SPARC machine. However, I also have to build it on an i386 machine.
Using the same changes to the code I can compile the source and examples without
any errors. ExampleN01 runs fine, but ExampleN02 produces a segmentation fault
as soon as photons are fired. Both systems are patched to the same levels and
using exactly the same settings.

I have tried removing compiler optimisations which didn't change anything. I
have also tried to trace the Seg Fault using the debugging information and
obtained .....

Program received signal SIGSEGV, Segmentation fault.
0xfa6e6148 in __1cDstdGvector4Cbn0AJallocator4Cb___Jpush_back6Mrkb_v_@plt ()
   from /users-data/clark/Geant_x86_bak/geant4.9.3.p01/lib/SUN-CC/libG4processes.so
(gdb) backtrace
#0 0xfa6e6148 in __1cDstdGvector4Cbn0AJallocator4Cb___Jpush_back6Mrkb_v_@plt ()
   from /users-data/clark/Geant_x86_bak/geant4.9.3.p01/lib/SUN-CC/libG4processes.so
Die: DW_TAG_<unknown> (abbrev = 34, offset = 56131755)
        has children: TRUE
        attributes:
                DW_AT_name (DW_FORM_string) string: "reverse_iterator"
                DW_AT_<unknown> (DW_FORM_string) string: "nQreverse_iterator3CTACTBCTCCTDCTECTF_"
                DW_AT_decl_file (DW_FORM_data1) constant: 16
                DW_AT_decl_line (DW_FORM_data2) constant: 407
Dwarf Error: Cannot find type of die [in module /users-data/clark/Geant_x86_bak/geant4.9.3.p01/lib/SUN-CC/libG4processes.so]
(gdb) x 0xfa6e6148
0xfa6e6148 <__1cDstdGvector4Cbn0AJallocator4Cb___Jpush_back6Mrkb_v_@plt>: 0x6f94a3ff
(gdb) x 0x6f94a3ff
0x6f94a3ff: Cannot access memory at address 0x6f94a3ff

Unfortunately, I am not great at using gdb and so am a bit stuck.

I have taken the code and built it on a RHEL5 machine and aside from needing to change
 G4int n = 0; std::count(evapType.begin(),evapType.end(),type,n);
back to
G4int n = std::count(evapType.begin(),evapType.end(),type);
due to the difference in the count function, the code compiles and runs perfectly.

The only think i have yet to try is using the newer version of Sun Studio, but I am currently downloading it.

If anyone has any ideas I would love to hear them.

Thanks in advance for any help.

Dave



####################### System and Code Changes #############################


**************** Sparc *********************************

Kernel version: SunOS 5.10 Generic_142900-13
Machine hardware: sun4u
OS version: 5.10
Processor type: sparc
Hardware: SUNW,SPARC-Enterprise

The following components are installed on your system:

Sun Studio 12
        Sun Studio 12 C Compiler
        Sun Studio 12 C++ Compiler
        Sun Studio 12 Tools.h++ 7.1
        Sun Studio 12 C++ Standard 64-bit Class Library
        Sun Studio 12 Garbage Collector
        Sun Studio 12 Fortran 95
        Sun Studio 12 Debugging Tools (including dbx)
        Sun Studio 12 IDE
        Sun Studio 12 Debugger GUI
        Sun Studio 12 Performance Analyzer (including collect, ...)
        Sun Studio 12 X-Designer
        Sun Studio 12 VIM editor
        Sun Studio 12 XEmacs editor
        Sun Studio 12 Performance Library
        Sun Studio 12 LockLint
        Sun Studio 12 Building Software (including dmake)
        Sun Studio 12 Documentation Set
        Sun Studio 12 /usr symbolic links and GNOME menu item

version of "/opt/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.9 SunOS_sparc Patch 124867-01 2007/07/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/f90": Sun Fortran 95 8.3 SunOS_sparc Patch 127000-01 2007/07/18
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.6 SunOS_sparc Patch 124872-01 2007/07/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun Analyzer 7.6 SunOS_sparc Patch 126995-01 2007/07/17
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.8 SunOS_sparc Patch 126503-01 2007/07/19

**************** i386 *********************************

Kernel version: SunOS 5.10 Generic_142901-02
Machine hardware: i86pc
OS version: 5.10
Processor type: i386
Hardware: i86pc

The following components are installed on your system:


Sun Studio 12
        Sun Studio 12 C Compiler
        Sun Studio 12 C++ Compiler
        Sun Studio 12 Tools.h++ 7.1
        Sun Studio 12 C++ Standard 64-bit Class Library
        Sun Studio 12 Garbage Collector
        Sun Studio 12 Fortran 95
        Sun Studio 12 Debugging Tools (including dbx)
        Sun Studio 12 IDE
        Sun Studio 12 Debugger GUI
        Sun Studio 12 Performance Analyzer (including collect, ...)
        Sun Studio 12 X-Designer
        Sun Studio 12 VIM editor
        Sun Studio 12 XEmacs editor
        Sun Studio 12 Performance Library
        Sun Studio 12 LockLint
        Sun Studio 12 Building Software (including dmake)
        Sun Studio 12 Documentation Set
        Sun Studio 12 /usr symbolic links and GNOME menu item

version of "/opt/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.9 SunOS_i386 Patch 124868-01 2007/07/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.9 SunOS_i386 Patch 124864-01 2007/07/25
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/f90": Sun Fortran 95 8.3 SunOS_i386 Patch 127002-01 2007/07/18
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.6 SunOS_i386 Patch 124873-01 2007/07/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun Analyzer 7.6 SunOS_i386 Patch 126996-01 2007/07/17
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.8 SunOS_i386 Patch 126504-01 2007/07/19


************** Changes made to G4 that allows it to run on Sparc *************************

Configure change /bin/sh to /bin/bash


"src/G4IonTable.cc", line 720: Error: Could not find a match for std::multimap<int, G4ParticleDefinition*, std::less<int>, std::allocator<std::pair<const int, G4ParticleDefinition*>>>::insert(std::pair<int, G4ParticleDefinition*>) needed in G4IonTable::Insert(G4ParticleDefinition*).
-- Changed insert(std::pair<G4int, G4ParticleDefinition*>) to insert(std::pair<const G4int, G4ParticleDefinition*>)


"src/G4AdjointAlongStepWeightCorrection.cc", line 95: Error: isnan is not a member of std.
-- Remove std:: from isnan

"src/G4QInelastic.cc", line 1971: Error: The function "for_each" must have a prototype.
-- change for_each to std::for_each

"src/G4WilsonAblationModel.cc", line 348: Error: Could not find a match for std::count<std::InputIterator, std::T, std::Size>(G4ParticleDefinition**, G4ParticleDefinition**, G4ParticleDefinition*) needed in G4WilsonAblationModel::BreakItUp(const G4Fragment&).
-- Changed G4int n = std::count(evapType.begin(),evapType.end(),type); to G4int n = 0; std::count(evapType.begin(),evapType.end(),type,n);

"src/G4Fancy3DNucleus.cc", line 146: Error: The function "sort" must have a prototype.
"src/G4Fancy3DNucleus.cc", line 171: Error: The function "sort" must have a prototype.
-- Changed sort to std::sort

"src/G4QNeutronCaptureRatio.cc", line 243: Error: Cannot use std::pair<int, double[5]> to initialize const std::pair<int, double*>
"src/G4QNeutronNuclearCrossSection.cc", line 350: Error: Cannot use std::pair<int, double[4]> to initialize const std::pair<int, const double*>.
-- Lots of these errors. Tried changing std::pair<G4int, const G4double*> to std::pair<G4int, G4double[5]>, std::pair<G4int, const G4double[5]> and std::pair<G4int, G4double*> but didnt work. Changing static const std::pair<G4int, const G4double*> Z0N1=std::make_pair(1,pZ0N1); to static const std::pair<G4int, const G4double*> Z0N1(1, pZ0N1); works and produces no compiler errors

"src/G4AdjointSimMessenger.cc", line 170: Error: In this declaration "is" is of an incomplete type "std::istringstream ".
-- add #include <sstream>


"/opt/SUNWspro/prod/include/CC/Cstd/./map", line 251: Error: Multiple declaration for std::map<const G4String, const G4tgrSolid*, std::less<const G4String>, std::allocator<std::pair<const G4String, const G4tgrSolid*>>>::insert(const std::pair<const G4String, const G4tgrSolid*>&).
"include/G4tgrVolumeMgr.hh", line 132: Where: While specializing "std::map<const G4String, const G4tgrSolid*, std::less<const G4String>, std::allocator<std::pair<const G4String, const G4tgrSolid*>>>".
"include/G4tgrVolumeMgr.hh", line 132: Where: Specialized in non-template code.
"/opt/SUNWspro/prod/include/CC/Cstd/./map", line 251: Error: Multiple declaration for std::map<const G4String, const G4tgrVolume*, std::less<const G4String>, std::allocator<std::pair<const G4String, const G4tgrVolume*>>>::insert(const std::pair<const G4String, const G4tgrVolume*>&).
"include/G4tgrVolumeMgr.hh", line 136: Where: While specializing "std::map<const G4String, const G4tgrVolume*, std::less<const G4String>, std::allocator<std::pair<const G4String, const G4tgrVolume*>>>".
"include/G4tgrVolumeMgr.hh", line 136: Where: Specialized in non-template code.
2
-- Replaced
typedef std::map< const G4String, const G4tgrSolid* > G4mapssol;
typedef std::map< const G4String, const G4tgrVolume* > G4mapsvol;
with
typedef std::map< G4String, G4tgrSolid* > G4mapssol;
typedef std::map< G4String, G4tgrVolume* > G4mapsvol;


"src/G4ViewParameters.cc", line 544: Error: In this declaration "iss" is of an incomplete type "std::istringstream ".
-- Added #include <sstream>

"src/G4tgrFileIn.cc", line 182: Error: In this declaration "istr_line" is of an incomplete type "std::istringstream ".
-- Added #include <sstream>

"src/G4GMocrenFileSceneHandler.cc", line 1519: Error: In this declaration "sval" is of an incomplete type "std::istringstream ".
-- Added #include <sstream>


"src/G4tgrVolumeMgr.cc", line 376: Error: Cannot use std::pair<__rwstd::__rb_tree<const G4String, std::pair<const G4String, const G4tgrPlace*>, __rwstd::__select1st<std::pair<const G4String, const G4tgrPlace*>, const G4String>, std::less<const G4String>, std::allocator<std::pair<const G4String, const G4tgrPlace*>>>::iterator, __rwstd::__rb_tree<const G4String, std::pair<const G4String, const G4tgrPlace*>, __rwstd::__select1st<std::pair<const G4String, const G4tgrPlace*>, const G4String>, std::less<const G4String>, std::allocator<std::pair<const G4String, const G4tgrPlace*>>>::iterator> to initialize std::pair<__rwstd::__rb_tree<const G4String, std::pair<const G4String, const G4tgrPlace*>, __rwstd::__select1st<std::pair<const G4String, const G4tgrPlace*>, const G4String>, std::less<const G4String>, std::allocator<std::pair<const G4String, const G4tgrPlace*>>>::const_iterator, __rwstd::__rb_tree<const G4String, std::pair<const G4String, const G4tgrPlace*>, __rwstd::__select1st<std::pair<const G4String, const G4tgrPlace*>, const G4String>, std::less<const G4String>, std::allocator<std::pair<const G4String, const G4tgrPlace*>>>::const_iterator>.
-- Changed
  std::pair<G4mmapspl::const_iterator, G4mmapspl::const_iterator> children
    = GetChildren( vol->GetName() );
  G4mmapspl::const_iterator cite;
to
std::pair<G4mmapspl::iterator, G4mmapspl::iterator> children = GetChildren( vol->GetName() );
  G4mmapspl::const_iterator cite;

Get the error compiling example N01

Linking exampleN01
Undefined first referenced
 symbol in file
double G4RegularNavigation::ComputeStepSkippingEqualMaterials(const CLHEP::Hep3Vector,const CLHEP::Hep3Vector&,const double,double&,G4NavigationHistory&,bool&,CLHEP::Hep3Vector&,bool&,bool&,G4VPhysicalVolume**,int&,G4VPhysicalVolume*) /users-data/Geant_x86/geant4.9.3.p01/lib/SUN-CC/libG4geometry.so
double G4VPolarizedCrossSection::TotalXSection(double,double,double,const G4StokesVector&,const G4StokesVector&) /users-data/Geant_x86/geant4.9.3.p01/lib/SUN-CC/libG4processes.so
ld: fatal: Symbol referencing errors. No output written to ./bin/SUN-CC/exampleN01

In ./source/geometry/navigation/include/G4RegularNavigation.hh change

 G4double ComputeStepSkippingEqualMaterials(
     const G4ThreeVector localPoint,
                          const G4ThreeVector& globalDirection,
                          const G4double currentProposedStepLength,
                                G4double& newSafety,
                                G4NavigationHistory& history,
                                G4bool& validExitNormal,
                                G4ThreeVector& exitNormal,
                                G4bool& exiting,
                                G4bool& entering,
                                G4VPhysicalVolume *(*pBlockedPhysical),
                                G4int& blockedReplicaNo,
                                G4VPhysicalVolume* pCurrentPhysical);

to

 G4double ComputeStepSkippingEqualMaterials(
                          G4ThreeVector localPoint,
                          const G4ThreeVector& globalDirection,
                          const G4double currentProposedStepLength,
                                G4double& newSafety,
                                G4NavigationHistory& history,
                                G4bool& validExitNormal,
                                G4ThreeVector& exitNormal,
                                G4bool& exiting,
                                G4bool& entering,
                                G4VPhysicalVolume *(*pBlockedPhysical),
                                G4int& blockedReplicaNo,
                                G4VPhysicalVolume* pCurrentPhysical);

In ./source/processes/electromagnetic/polarisation/src/G4VPolarizedCrossSection.cc Change
G4double G4VPolarizedCrossSection::TotalXSection(const G4double, const G4double, const G4double, const G4StokesVector &,const G4StokesVector &)

to

G4double G4VPolarizedCrossSection::TotalXSection( G4double, G4double, G4double, const G4StokesVector &,const G4StokesVector &)


                --- Geant4 Toolkit Build ---

Would you like to see the instructions? [n]

Definition of G4SYSTEM variable is SUN-CC.
That stands for:

1) OS : SUN

2) Compiler : CC

To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings]

There exists a config.sh file. Shall I use it to set the defaults? [y]
Fetching default answers from your old config.sh file...

I can set things up so that your shell scripts and binaries are more portable,
at what may be a noticable cost in performance. In particular, if you
ask to be portable, the following happens:

     1) Shell scripts will rely on the PATH variable rather than using
        the paths derived above.
     2) ~username interpretations will be done at run time rather than
        by Configure.

Do you expect to run these scripts and binaries on multiple machines? [n]

*OPTIONS FOR GEANT4 INSTALLATION PATHS*
What is the path to the Geant4 source tree?
[/users-data/Geant_x86/geant4.9.3.p01]

Where should Geant4 be installed?
[/users-data/Geant_x86/geant4.9.3.p01]

Do you want to install all Geant4 headers in one directory? [n]

*GEANT4 LIBRARY BUILD OPTIONS*
Do you want to build shared libraries? [y]
Do you want to build static libraries too? [n]
Do you want to build global libraries? [y]
Do you want to build granular libraries as well? [n]
Do you want to build libraries with debugging information? [y]

*CHECKS AND OPTIONS FOR GEANT4 PHYSICS DATA FILES*
Specify the path where the Geant4 data libraries are installed:
[/users-data/Geant_x86/geant4.9.3.p01/data]
checking for PhotonEvaporation2.0... yes
checking for RadioactiveDecay3.2... yes
checking for G4EMLOW6.9... yes
checking for G4NDL3.13... yes
checking for G4ABLA3.0... yes
checking for RealSurface1.0... yes

*CHECKS FOR CORRECT MAKE IMPLEMENTATION*
Checking for make... /usr/ccs/bin/make
Checking for gmake... /usr/sfw/bin/gmake
Checking if make is GNU make... no
Checking if gmake is GNU make... yes

*CHECKS FOR REQUIRED EXTERNAL PACKAGE CLHEP*
checking for a CLHEP installation... /users-data/Geant_x86/CLHEP

Is this the CLHEP installation you want to use?
[/users-data/Geant_x86/CLHEP]

You can customize paths and library name of you CLHEP installation:

1) CLHEP_INCLUDE_DIR: /users-data/Geant_x86/CLHEP/include
2) CLHEP_LIB_DIR: /users-data/Geant_x86/CLHEP/lib
3) CLHEP_LIB: CLHEP
To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings]

*OPTIONS FOR GEANT4 USER INTERFACE MODULES*
Enable building of User Interface (UI) modules? [y]
Enable building of the XAW (X11 Athena Widget set) UI module? [n]
Enable building of the X11-Motif (Xm) UI module? [n]
Enable building of the Qt UI module? [n]

*OPTIONS FOR GEANT4 VISUALIZATION DRIVERS*
Enable building of visualization drivers? [y]

Enable building of the X11 OpenGL visualization driver? [n]
Enable building of the X11-Motif OpenGL visualization driver? [n]

Enable building of the FukuiRenderer/DAWN visualization driver? [n]
Enable building of the X11 OpenInventor visualization driver? [n]
Enable building of the X11 RayTracer visualization driver? [n]
Enable building of the VRML visualization driver? [n]

*OPTIONS FOR GEANT4 OPTIONAL EXTENSION MODULES*

Enable the Geometry Description Markup Language (GDML) module? [n]
Enable build of the g3tog4 utility module? [n]
Enable internal zlib compression for HepRep visualization? [n]
End of configuration phase.

Creating configuration setup file...

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Geant4 on Sparc and i386 [SOLVED]   (David Clark - 02 Sep, 2010)
2 News: Re: Geant4 on Sparc and i386   (Marcin Kuzniak - 03 May, 2011)
1 None: Re: Geant4 on Sparc and i386   (David Clark - 04 May, 2011)
 Add Message Add Message
to: "Geant4 on Sparc and i386"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]