Bug 185394 - cannot link statically with g77
cannot link statically with g77
Product: Fedora
Classification: Fedora
Component: lapack (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom "spot" Callaway
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2006-03-14 06:33 EST by Patrice Dumas
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-14 12:43:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Patrice Dumas 2006-03-14 06:33:53 EST
Description of problem:

Not sure that it is fixable. gfortran is still immature and lacking g77
features. So there is still a need to compile with g77. Now i am trying to link
statically with lapack, using g77 as a linker, but it fails. Here is what I get:

[dumas@nor75-15-82-67-190-22 examples]$ cat call_sgemm.f 
       program main
       call sgemm

[dumas@nor75-15-82-67-190-22 examples]$  g77 -static -o call_sgemm -g -O2
call_sgemm.f -lblas
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libblas.a(xerbla.o): In
function `xerbla_': undefined reference to `_gfortran_st_write'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libblas.a(xerbla.o): In
function `xerbla_': undefined reference to `_gfortran_transfer_character'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libblas.a(xerbla.o): In
function `xerbla_': undefined reference to `_gfortran_transfer_integer'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libblas.a(xerbla.o): In
function `xerbla_': undefined reference to `_gfortran_st_write_done'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../libblas.a(xerbla.o): In
function `xerbla_': undefined reference to `_gfortran_stop_numeric'
collect2: ld returned 1 exit status

It works when called with -lgfortran:
 g77 -static -o call_sgemm -g -O2 call_sgemm.f -lblas -L
/usr/lib/gcc/i386-redhat-linux/4.1.0/ -lgfortran

Version-Release number of selected component (if applicable):

How reproducible:


Steps to Reproduce:
1. link statically with g77 without an expplicit call to -lgfortran
Actual results:

link failure.

Expected results:

No link error.

Additional info:

This is one of many issues with g77/gfortran incompatibilities issues. The ABI
is different, too, but it doesn't affect lapack because it only affect functions.
Comment 1 Tom "spot" Callaway 2006-03-14 12:43:15 EST
i'm not sure how this is resolvable. g77 is dead branch code, instead of trying to use it, I recommend that you file bugs against gfortran where it does not provide needed feature functionality.
Comment 2 Patrice Dumas 2006-03-14 15:19:16 EST
There is allready a meta bug with g77 regressions. There aren't that much move
on the intrinsic front...


but the gfortran team isn't very big. Given that fact their solution is to keep
g77 in distributions. But if it isn't usable... For example you can have a look
on what kind of 'discussion' this leads to:


I have reported the lack of intrinsics that prevent cernlib to build on fedora
in the fedora bugzilla, but I was (rightfully) redirected to upstream.
Comment 3 Hans de Goede 2006-07-21 14:36:43 EDT

why is the Component for this bug set to aalib? That can't be right.
Comment 4 Patrice Dumas 2006-07-21 16:05:15 EDT
It should be on lapack or blas. I'll try to fix it.

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