[gate-users] geant4 installation question

Martin L. Purschke purschke at bnl.gov
Mon Nov 28 01:40:18 CET 2005


Ahmet,

looks like it's missing the pthread library, that is, the -lpthread
library reference in the link step. Your libGL has appaently been
compiled/installed with thread support, so you need to add that library
when you link with it.

I'm not sure if there is any intended way of accomplishing that at
installation time, but you can edit your  $G4INSTALL/config/architecture.gmk
where a variable "LOADLIBS" is set up --

> ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
>   LDFLAGS   += -link $(LIB_PATH)$(CLHEP_LIB_DIR)
>   LOADLIBS  := $(CLHEP_LIB)
> else
>   LDFLAGS   += -L$(CLHEP_LIB_DIR)
>   LOADLIBS  := -l$(CLHEP_LIB)
>   LOADLIBS  += -lm
> endif

In the else block, add

ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
  LDFLAGS   += -link $(LIB_PATH)$(CLHEP_LIB_DIR)
  LOADLIBS  := $(CLHEP_LIB)
else
  LDFLAGS   += -L$(CLHEP_LIB_DIR)
  LOADLIBS  := -l$(CLHEP_LIB)
  LOADLIBS  += -lm
  LOADLIBS  += -lpthread              < --------
endif

That done, in the N01 area, do

make -n | grep pthread

just to check that it worked - you should a long string of -lthis and
-lthat and in the end ... -lCLHEP -lm -lpthread.

Hope it helps,

	Martin


ayanas at mail.med.upenn.edu wrote:
> Hello,
> I have a problem with GEANT4/OpenGL installation on a Xeon CPU machine running
> RHEL4. I posted this question to geant4 discussion list but so fat have not
> received any response yet. So I am writing here in case others GATE-users
> experienced the same problem.
> 
> GEANT4 compiles fine w/o any problem. however when I try to test the G4
> installation with an example , say N01, during the linking face I get the 
> errors as:
> 
> ---------------------------------
> Compiling exampleN01.cc ...
> Using granular libraries ...
> Linking exampleN01 ...
> /usr/X11R6/lib64/libGL.a(glthread.o)(.text+0x17): In function `_glthread_InitTSD':
> : undefined reference to `pthread_key_create'
> /usr/X11R6/lib64/libGL.a(glthread.o)(.text+0x55): In function `_glthread_GetTSD':
> : : undefined reference to `pthread_getspecific'
> /usr/X11R6/lib64/libGL.a(glthread.o)(.text+0x96): In function `_glthread_SetTSD':
> : undefined reference to `pthread_setspecific'
> collect2: ld returned 1 exit status
> -------------------------------------------------------
>  
> 
> I would appreciate any suggestions as to what I need to do to solve this problem .
> Thanks,
> 


-- 
Martin L. Purschke               ;   purschke at bnl.gov
                                 ;   http://www.phenix.bnl.gov/~purschke
                                 ;
Brookhaven National Laboratory   ;   phone: +1-631-344-5244
Physics Department Bldg 510 C    ;   fax:   +1-631-344-3253
Upton, NY 11973-5000             ;
-----------------------------------------------------------------------


More information about the Gate-users mailing list