Message: shared library problem with QGSP_BIC Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question shared library problem with QGSP_BIC 

Forum: Installation and Configuration
Date: 29 Jul, 2009
From: Tom Roberts <Tom Roberts>

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:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 More: Re: shared library problem with QGSP_BIC   (Tom Roberts - 29 Jul, 2009)
2 Question: Re: shared library problem with QGSP_BIC   (Gabriele Cosmo - 30 Jul, 2009)
1 News: Re: shared library problem with QGSP_BIC   (Tom Roberts - 30 Jul, 2009)
1 Question: Re: shared library problem with QGSP_BIC   (Tom Roberts - 30 Jul, 2009)
2 News: Re: shared library problem with QGSP_BIC   (Tom Roberts - 30 Jul, 2009)
3 More: Re: shared library problem with QGSP_BIC   (Gabriele Cosmo - 31 Jul, 2009)
4 Ok: Re: shared library problem with QGSP_BIC   (Tom Roberts - 31 Jul, 2009)
1 Agree: Re: shared library problem with QGSP_BIC   (Gabriele Cosmo - 31 Jul, 2009)
 Add Message Add Message
to: "shared library problem with QGSP_BIC"

 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 ]