Problem 623

Summary: Configuration problems
Product: Geant4 Reporter: euro.cocolo
Component: configAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P2    
Version: 6.1   
Hardware: PC   
OS: Linux   

Description euro.cocolo 2004-05-06 09:50:00 CEST
Hello sirs,

I'm trying to upgrade my GEANT4 (v5.##) to geant4.6.1.
I'm using a Linux RH 7.1.2 with kernel "2.4.18-openmosix4smp"
with GCC-3.2

I've downloaded the following new software versions:
"geant4.6.1.gtar.gz"
"clhep-1.8.1.0-gcc-3.2.tgz"

I've decompressed them either in /opt/geant4.6.1/ and /opt/clhep-1.8.1.0
From the previous version I used GCC-3.2, OpenGL(Mesa)located in /usr, STL
v.3.3,XAW (rpm XAW3D), DAWN (v.3_85) and VRML

Then I defined the variables:
PATH
LS_LIBRARY_PATH
LD_RUN_PATH
GCC_INCLUDE_DIR
CPATH
including all of the roots with gcc and clhep libraries and include files...

When I run "./Configure -install" and ".Configure" all seams to be ok...

But if I try to login as an unprivileged user in order to run the example "N03",
I get many errors in linking the object files....
Here you can find a little part of the error I get:
bash-2.05$ gmake
Making dependency for file exampleN03.cc...
Making dependency for file src/ExN03VisManager.cc ...
Making dependency for file src/ExN03SteppingVerbose.cc ...
Making dependency for file src/ExN03SteppingAction.cc ...
Making dependency for file src/ExN03RunAction.cc ...
Making dependency for file src/ExN03PrimaryGeneratorMessenger.cc ...
Making dependency for file src/ExN03PrimaryGeneratorAction.cc ...
Making dependency for file src/ExN03PhysicsList.cc ...
Making dependency for file src/ExN03EventActionMessenger.cc ...
Making dependency for file src/ExN03EventAction.cc ...
Making dependency for file src/ExN03DetectorMessenger.cc ...
Making dependency for file src/ExN03DetectorConstruction.cc ...
Making dependency for file exampleN03.cc...
Compiling ExN03DetectorConstruction.cc ...
cc1plus: warning: changing search order for system directory "/opt/gcc-3.2/include"
cc1plus: warning:   as it has already been specified as a non-system directory
cc1plus: warning: changing search order for system directory
"/opt/clhep-1.8.1.0/include"
cc1plus: warning:   as it has already been specified as a non-system directory

....

Using granular libraries ...
Linking exampleN03 ...
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o: In function
`main':
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x7b):
undefined reference to `G4VSteppingVerbose::SetInstance(G4VSteppingVerbose*)'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0xac):
undefined reference to `G4RunManager::G4RunManager[in-charge]()'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x12d):
undefined reference to `G4UIXm::G4UIXm[in-charge](int, char**)'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x15c):
undefined reference to `G4VisManager::Initialise()'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x1e5):
undefined reference to `G4EventManager::SetUserAction(G4UserEventAction*)'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x22f):
undefined reference to `G4EventManager::SetUserAction(G4UserSteppingAction*)'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x274):
undefined reference to `G4UImanager::GetUIpointer()'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x28c):
undefined reference to `G4UImanager::ApplyCommand(char const*)'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x29c):
undefined reference to `G4UImanager::ApplyCommand(char const*)'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/exe/exampleN03.o(.text+0x34c):
undefined reference to `G4UImanager::ApplyCommand(G4String)'
/home/euro.cocolo/geant4/tmp/Linux-g++/exampleN03/libexampleN03.a(ExN03DetectorConstruction.o):
In function `ExN03DetectorConstruction::ExN03DetectorConstruction[not-in-charge]()':


I'm not sure this is enough to understand the problem, (I hope so..!)
but if you need more infos, I can provide them...

Many thanks in advance!!

Euro Cocolo
Comment 1 Gabriele Cosmo 2004-05-06 11:30:59 CEST
It looks like it's a configuration problem in the user's setup.
Some observations:

> PATH
> LS_LIBRARY_PATH
> LD_RUN_PATH
> GCC_INCLUDE_DIR
> CPATH

These variables are NOT required by Geant4. Are those required by your
specific compiler setup ?  (btw, you probably mean LD_LIBRARY_PATH, I guess)

> "clhep-1.8.1.0-gcc-3.2.tgz"

Did you install pre-compiled libraries or did you build CLHEP by your own ?
For your specific system/compiler setup I would suggest you download the
source of CLHEP and build it with your system.

> cc1plus: warning: changing search order for system directory
> "/opt/gcc-3.2/include"
> cc1plus: warning: as it has already been specified as a non-system directory
> cc1plus: warning: changing search order for system directory
> "/opt/clhep-1.8.1.0/include"
> cc1plus: warning: as it has already been specified as a non-system directory

to avoid such warnings (which may cause serious side effects!) you should have
either the compiler or CLHEP/Geant4 installed in a different system directory
than /opt (put CLHEP and Geant4 with related tools in /opt/local instead, for
example).

> Linking exampleN03 ...
> /...../Linux-g++/exampleN03/exe/exampleN03.o: In function `main':
> /...../Linux-g++/exampleN03/exe/exampleN03.o(.text+0x7b):
> undefined reference to `G4VSteppingVerbose::SetInstance(G4VSteppingVerbose*)'
> ...

These errors you get are at link stage (not at run-time), since apparently
libraries are not found.
Check that you have the environment for Geant4 correctly set as 'user'.
This means -having executed- first the env.sh (or .csh) script you generated
by running 'Configure' as user. You need to have G4LIB pointing to the area
where the Geant4 libraries are installed.
Hope it helps!
Comment 2 euro.cocolo 2004-05-07 09:04:59 CEST
Salve,
(dal nome direi che sei italiano, quindi forse e` piu` semplice se mi rivolgo a
te nella nostra lingua...)

allora, innanzi tutto grazie per la risposta sollecita!!

Ho provato a seguire i tuoi suggerimenti, in effetti io avevo usato le
librerie clhep precompilate... ora ho scaricato i sorgenti e li ho compilati
seguendo le istruzioni in
(http://wwwasd.web.cern.ch/wwwasd/lhc++/clhep/index.html)
Ho di seguito copiato le "lib" e gli "include" rispettivamente nelle dir:
"/opt/local/include/CLHEP" e "/opt/local/lib".
Seguendo la vecchia installazione (che non ho fatto io) in "/opt/local/lib"
ho creato i link simbolici:
 libCLHEP.a -> libCLHEP-g++.1.8.1.0.a
 libCLHEP-g++.so -> libCLHEP-g++.1.8.0.0.so
 libCLHEP.so -> libCLHEP-g++.so

Ho spostato /opt/geant4.6.1 in /opt/local/geant4;

Ho eseguito poi il "Configure -install" indicando i path corretti per GEANT4
usando gli object files di geant gia` creati con la vecchia compilazione (la
compilazione completa richiede piu` di 12 ore!);
Ho eseguito "Configure" da root;

Ho fatto login come user non privilegiato, ho eseguito, come da tue indicazioni
"Configure" che mi ha creato gli env.[c]sh, ho controllato che le variabili
G4LIB ecc. puntassero alle dir corrette e ho provato l'esempio N03 (copiando
nella dir dell'utente tutta la root di N03, spostandomi in /user/N03 e lanciando
gmake...

Ma gli errori che mi da sono sempre gli stessi...

Che sia un problema dovuto alle GCC? La versione dovrebbe essere quella
corretta (GCC-3.2) e se provo l'esempio N03 della versione precedente,
con geant4 versione precedente, tutto funziona regolarmente...

Help!!! A questo punto non so proprio che pesci pigliare...!!

Se ti serve posso farti avere i file di configurazione che uso, l'env.sh ecc.


Grazie 1000!

Euro Cocolo
Sincrotrone Trieste - Elettra
Comment 3 Gabriele Cosmo 2004-05-07 09:44:59 CEST
Hi, when posting messages in the Problem Reporting System it is more
appropriate if you express yourself in English (Sorry!).
I would suggest you re-install Geant4 from -scratch- according to the new setup.
The reason is that the old object files may be corrupted due to the old wrong
setup where you observed those nasty warnings from the compiler...
If you still observe the problem, send me (offline) the information about your
environment as generated by the env.sh script and a log-file of the build of
the G4 libraries.