[ROOT] relocation errors and invalid ELF error

From: Ricardo Eusebi (eusebi@fnal.gov)
Date: Thu Oct 21 2004 - 17:41:06 MEST


Hi,
I'm (trying to) implement a Root C++ interface to the fortran program 
HDecay.
I can succesfully create  a  executable that calls the proper fortran 
routines. However when trying to link to root everything seems to fail.
I took a look at http://root.cern.ch/root/HowtoCERNLIB.html but that 
particular case refers to  CERN routines compiled without the option 
Position Independent Code (whatever that means).

So I essentially follow the third way in the above web page up to the 
step 2 exclusive. I do not recompile root, nor I want to.

so when loading the libraries I get

root [0] gSystem->Load("libHDecay.so")
(int)0
root [1] HDecay a
root [2] HDECAY_InputVars in = a.DefineInputs()
root [3] BR_HC B = a.GetHiggsBR(120,in)
/home/cdfsoft/products/root/v3_05_04dKCC_4_0/Linux+2.4/bin/root.exe: 
relocation error: 
/mnt/autofs/misc/people/eusebi/root_macros/./libHDecay.so: undefined 
symbol: read_hdec_

I thought that's because I didn't link the fortran libraries. So I added 
the libraries (hdecay/*.o) in the makefile
libHDecay.so : HDecay.o  hdecay/hdecay.o  hdecay/haber.o 
hdecay/feynhiggs.o  HDecayDict.o 
        $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@

This compiles fine again, but the error in root this time is not 
relocation but this :

root [0] gSystem->Load("libHDecay.so")
dlopen error: /mnt/autofs/misc/people/eusebi/root_macros/./libHDecay.so: 
undefined symbol: s_wsle
Load Error: Failed to load Dynamic link library 
/mnt/autofs/misc/people/eusebi/root_macros/./libHDecay.so
(int)(-1)
*** Interpreter error recovered ***


QUESTIONS :
A- is this because the fortran libraries hdecay/*.o have not been 
 compiled with the Position Independent Code option ?
How do I compile with that option????

B- Is there away to circunvent this that do not require the 
recompilation of root ? At FermiLab we change root versions pretty often.

Thanks a lot

Ricardo




 



-- 
  --------------------------------------------------------------------
| Ricardo Eusebi                |   Office :  CDF trailer 168-"O"    |
| High Energy Physics           |   Phone  : (630) 840 8622          |
| University of Rochester       |   email  : eusebi@fnal.gov         |
  --------------------------------------------------------------------
|               Fermi National Accelerator Laboratory                |
|                    CDF - MS318 .  PO Box 500                       |
|                     Batavia 60510, Illinois.                       |
  --------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET