Bug 241203

Summary: Problem with cernlib-devel - libpacklib.a (undefined reference to `intrac_')
Product: [Fedora] Fedora Reporter: Andreia Pio da Silva <andreia>
Component: cernlibAssignee: Patrice Dumas <pertusus>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-24 16:57:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
code used in the compilation none

Description Andreia Pio da Silva 2007-05-24 12:56:32 UTC
Description of problem:
When I use static library libpacklib.a is not found intrac.o (undefined
reference you “intrac_”). If to use dynamic library libpacklib.so the problem
does not occur.

Version-Release number of selected component (if applicable):
cernlib-devel-2005-21.fc5

How reproducible:
g77 -fno-automatic fit.for /usr/lib64/cernlib/2005/lib/libpacklib.a
/usr/lib64/cernlib/2005/lib/libpacklib.a(mninit.o): In function `mninit_':
(.text+0x1c3): undefined reference to `intrac_'
collect2: ld returned 1 exit status


Steps to Reproduce:
1.g77 -fno-automatic fit.for /usr/lib64/cernlib/2005/lib/libpacklib.a
2.
3.
  
Actual results:
/usr/lib64/cernlib/2005/lib/libpacklib.a(mninit.o): In function `mninit_':
(.text+0x1c3): undefined reference to `intrac_'
collect2: ld returned 1 exit status

Expected results:
not compilation error

Additional info:
g77 -fno-automatic fit.for /usr/lib64/cernlib/2005/lib/libpacklib.so

This is ok !

Comment 1 Andreia Pio da Silva 2007-05-24 12:56:32 UTC
Created attachment 155336 [details]
code used in the compilation

Comment 2 Patrice Dumas 2007-05-24 13:39:06 UTC
intrac is in kernlib, and not in packlib. In case of the shared lib, 
the dynamic linker resolves itself the reference and uses libkernlib
automatically. when linking statically you have to specify also the kernlib, 
like

g77 -fno-automatic fit.for /usr/lib64/cernlib/2005/lib/libpacklib.a 
/usr/lib64/cernlib/2005/lib/libkernlib.a

(Or use cernlib-static.)

Comment 3 Andreia Pio da Silva 2007-05-24 16:56:22 UTC
In the truth the users were using one variable cern: 
#echo $cern /
usr/lib64/cernlib/2005/lib/libkernlib.a /usr/lib64/cernlib/2005/lib/libmathlib.a
/usr/lib64/cernlib/2005/lib/libpacklib.a /usr/lib64/cernlib/2005/lib/libphtools.a 

When it used this variable  (this order) in the FC3 functioned.

I modified the order of the variable:
/usr/lib64/cernlib/2005/lib/libmathlib.a
/usr/lib64/cernlib/2005/lib/libpacklib.a
/usr/lib64/cernlib/2005/lib/libphtools.a /usr/lib64/cernlib/2005/lib/libkernlib.a 

Now it is functioning.

Thanks,
Andreia

Comment 4 Patrice Dumas 2007-05-24 17:12:24 UTC
Indeed, the dependent library should appear first. The cernlib 
script should take into account those dependencies, and for this case
is leads to 
-lphtools -lmathlib -lpacklib -lkernlib
so if one day you use other symbols such that your order doesn't 
work anymore, you could try this order.