| Message: shared library problem with QGSP_BIC | Not Logged In (login) |
|
I have used Geant4 for many years, using static libraries, and am exploring using shared libraries. The changes to exampleN01 below work fine with static granular libraries, but not with shared libraries. Does anybody use Geant4 with shared libraries on Mac OS X? on Linux? on Windows? Does anybody know why this works with static libraries but not shared ones? This is geant4-09-02-patch-01 (13-March-2009), on Mac OS 10.5.7. I first noticed that "global libraries" do not work; it appears that common.gmk simply does not have the code to build global shared libraries. So I'm living with over 100 libraries. exampleN01 compiles and runs as is. But I want to use various physics lists, so I modified exampleN01.cc to include G4PhysListFactory.hh and use it instead of ExN01PhysicsList: //TJR G4VUserPhysicsList* physics = new ExN01PhysicsList; G4PhysListFactory *factory = new G4PhysListFactory(); G4VUserPhysicsList *physics = factory->GetReferencePhysList("QGSP_BIC"); //TJR end runManager->SetUserInitialization(physics); Now it crashes with a Bus Error. After adding printf-s to various classes: ************************************************************* Geant4 version Name: geant4-09-02-patch-01 (13-March-2009) Copyright : Geant4 Collaboration Reference : NIM A 506 (2003), 250-303 WWW : http://cern.ch/geant4 ************************************************************* <<< Geant4 Physics List engine packaging library: PACK 5.4 <<< Geant4 Physics List simulation engine: QGSP_BIC 3.3 ### Adding tracking cuts for neutron TimeCut(ns)= 10000 KinEnergyCut(MeV)= 0 ... many of my printf lines omitted ... G4LossTableManager::EnergyLossProcessIsInitialised i=11 el=0607B800 pm=00000000 el->name=hIoni G4ProcessManager::GetProcessActivation this=00000000 aProcess=0607B800 Bus error That is, an energy loss process was added to the list without having a G4ProcessManager, and the null pointer crashes. This is the same error my much larger program got. It is clearly some initialization code that doesn't work properly with shared libraries (the crash comes when starting tracking, deep inside G4Runmanager::BeamOn / RunInitialization / BuildPhysicsTable / PreparePhysicsTable). Any clue how to fix this? (I was uncertain whether to post this to the configuration forum, to the processes forum, or to report it directly as a bug. I chose the first as this seems primarily to be a configuration issue.) |
| Inline Depth: | Outline Depth: | Add message: |
|
to: |