Skip Menu | will be shut down on March 1st, 2021.

This queue is for tickets about the ExtUtils-F77 CPAN distribution.

Report information
The Basics
Id: 90845
Status: resolved
Priority: 0/
Queue: ExtUtils-F77

Owner: chm [...]
Requestors: GSB [...]

Bug Information
Severity: Normal
Broken in: 1.17
Fixed in: 1.18


Subject: gfortran having a .so file instead of .a is not found
Download (untitled) / with headers
text/plain 478b
On some systems there is a file but no libgfortran.a file. Since the link_gnufortran_compiler subroutine only looks for libgfortran.a it doesn't find the library. Then it tries -lf2c, fails, and falls back to f77 which probably isn't present. In the attached patch I've copied the test for .a files so that it tries again for .so files. I did it that way so that it would keep the same behavior as before in the case of systems where libgfortran.a is present.
From 883f88237885366d5146f2f6045200725f8e4e6d Mon Sep 17 00:00:00 2001 From: Graham Bell <> Date: Mon, 25 Nov 2013 16:46:33 -1000 Subject: [PATCH] Add check for GNU fortran .so files as well as .a. --- | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/ b/ index 6d35e80..a28ea49 100644 --- a/ +++ b/ @@ -727,10 +727,20 @@ sub link_gnufortran_compiler { $dir =~ s,/lib$lib.a$,,; last; } else { + # Try the same thing again but looking for the .so file + # rather than the .a file. + $dir = `$compiler -print-file-name=lib$`; + chomp $dir; + if (defined $dir && $dir ne "lib$") { + $lib = $test; # Found an existing library + $dir =~ s,/lib$$,,; + last; + } else { $dir = "/usr/local/lib"; $lib = "f2c"; } } + } return( "-L$dir -L/usr/lib -l$lib -lm" ); } -- 1.7.1
Patch applied and available for testing in CHM/ExtUtils-1.17_01.tar.gz

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to