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 !
Created attachment 155336 [details] code used in the compilation
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.)
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
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.