Bug 241203 - Problem with cernlib-devel - libpacklib.a (undefined reference to `intrac_')
Summary: Problem with cernlib-devel - libpacklib.a (undefined reference to `intrac_')
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: cernlib   
(Show other bugs)
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Patrice Dumas
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-24 12:56 UTC by Andreia Pio da Silva
Modified: 2007-11-30 22:12 UTC (History)
0 users

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: ---


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

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.


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