Root with Geant4

Hello,
I work on my pc with geant4.7.0, gcc3.2.3 and Root 4.02.
I write a few code and it works very well.
Then, i put all the code (geant4+root+my code) on a cluster with gcc3.2.3.
I compile geant4 and it ‘s ok.
But when I want to compile my code, i have got a probleme with link :
Using granular libraries …
Linking Csaa …
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to TROOT::TROOT[in-charge](char const*, char const*, void (**)())' /users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference toTStorage::ObjectAlloc(unsigned)’
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to TROOT::~TROOT [in-charge]()' /users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference toTNtuple::TNtuple[in-charge](char const*, char const*, char const*, int)’
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to TObject::operator delete(void*)' /users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference toTFile::TFile[in-charge](char const*, char const*, char const*, int)'
collect2: ld a retourné 1 code d’état d’exécution
gmake: *** [/users_local2/tl/courtine/users_local/work/geant4/bin/Linux-g++/Csaa] Erreur 1
I check that i have G4_BUILD_ROOT_SESSION, G4_UI_USE_ROOT, G4LIB_BUILD_SHARED and H4LIB_USE_SHARED set to 1.
I also check ROOTSYS and LD_LIBRARY_PATH (i add $G4WORKDIR/tmp/$G4SYSTEM/Csaa).
I don’t understand why it fails when linking on this cluster.
I try to compile some code without root (geant4 alone) and it’s ok.
Can anybody help me? :cry:
Thanks.
Fabien

Hi,

The link line of Csaa is missing the root library (-L$ROOTSYS/lib -lCore -LCint -lTree) or ( root-config --libs).

Cheers,
Philippe.

In GNUMakefile, I have :
ROOTLIBS = -lCore -lCint -lHist -lGraph -lGraph3d -lGpad -lTree -lRint
-lPostscript -lMatrix -lPhysics
ROOTGLIBS = -lGui

CPPFLAGS += root-config --cflags
LDFLAGS += root-config --libs
I try gmake -I$ROOTSYS/lib -Core -lCint -lTree but it dosn’t work!
Fabien

Humm this is strange.
What is the link line really used? (You might be able to obtain it by running gmake -n)

Philippe.