Bug 191497 - "gcc -lgfortran" fails because libgfortran RPM lacks libgfortran.so
Summary: "gcc -lgfortran" fails because libgfortran RPM lacks libgfortran.so
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4 (Show other bugs)
(Show other bugs)
Version: 5
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Keywords: Reopened
Depends On:
TreeView+ depends on / blocked
Reported: 2006-05-12 14:50 UTC by Sam Steingold
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-05-16 07:04:01 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Sam Steingold 2006-05-12 14:50:57 UTC
libgfortran 4.1.0 does not install /usr/lib/libgfortran.so
on which some executables rely.
the user has to create a symlink:

cd /usr/lib
test -f libgfortran.so || sudo ln -sv libgfortran.so.*.* libgfortran.so

(there is no component named libgfortran in bugzilla, so I have to use gcc which
is the source of the Fortran 95 runtime)

Comment 1 Jakub Jelinek 2006-05-12 14:59:52 UTC
Programs which do that are incredibly broken.
libgfortran.so is included in gcc/gfortran specific directory, similarly
to other gcc provided libraries, as what exactly this points to is dependent
on the compiler version used (you need different libgfortran (libgfortran.so.0)
when using GCC 4.0.x, different when using 4.1.x (libgfortran.so.1) and yet
different when using 4.2.x (libgfortran.so.2)).
So, rather than using crappy checks for /usr/lib/libgfortran.so (after all,
on x86_64, ppc64, s390x etc. that wouldn't be in /usr/lib64 anyway) they should
use standard (e.g. autoconf) checks for presence of libraries.

Comment 2 Sam Steingold 2006-05-15 21:13:25 UTC
without the symbolic link /usr/lib/libgfortran.so, "-lgfortran" does not work:
/usr/bin/ld: cannot find -lgfortran
collect2: ld returned 1 exit status

I am reopening the bug:
 how do I recompile my program so that it uses /usr/lib/libgfortran.so.1?


Comment 3 Jakub Jelinek 2006-05-15 21:21:23 UTC
When you forgot to install gcc-gfortran package, that's not really surprising.
If you install it, that command will work just fine.

Comment 4 Sam Steingold 2006-05-15 22:15:13 UTC
I have these packages:

(Alas, I am stuck with c++ software that want 3.2)

Comment 5 Jakub Jelinek 2006-05-16 07:04:01 UTC
If you are using compat-gcc-32, then you obviously can't mix that with gfortran,
you should use compat-gcc-32 with g77 (and it's -lg2c), or gcc 4.x with gfortran.
Please stop reopening this.

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