Skip Menu |
 
rt.cpan.org 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

People
Owner: chm [...] cpan.org
Requestors: GSB [...] cpan.org
Cc:
AdminCc:

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

Attachments
0001-Add-check-for-GNU-fortran-.so-files-as-well-as-.a.patch



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 libgfortran.so 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.
Subject: 0001-Add-check-for-GNU-fortran-.so-files-as-well-as-.a.patch
From 883f88237885366d5146f2f6045200725f8e4e6d Mon Sep 17 00:00:00 2001 From: Graham Bell <g.bell@jach.hawaii.edu> Date: Mon, 25 Nov 2013 16:46:33 -1000 Subject: [PATCH] Add check for GNU fortran .so files as well as .a. --- F77.pm | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/F77.pm b/F77.pm index 6d35e80..a28ea49 100644 --- a/F77.pm +++ b/F77.pm @@ -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$test.so`; + chomp $dir; + if (defined $dir && $dir ne "lib$test.so") { + $lib = $test; # Found an existing library + $dir =~ s,/lib$lib.so$,,; + 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 Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.