Bug 241203 - Problem with cernlib-devel - libpacklib.a (undefined reference to `intrac_')
Problem with cernlib-devel - libpacklib.a (undefined reference to `intrac_')
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: cernlib (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Patrice Dumas
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-24 08:56 EDT by Andreia Pio da Silva
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-24 12:57:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
code used in the compilation (2.05 KB, application/octet-stream)
2007-05-24 08:56 EDT, Andreia Pio da Silva
no flags Details

  None (edit)
Description Andreia Pio da Silva 2007-05-24 08:56:32 EDT
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 08:56:32 EDT
Created attachment 155336 [details]
code used in the compilation
Comment 2 Patrice Dumas 2007-05-24 09:39:06 EDT
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 12:56:22 EDT
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 13:12:24 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.