Skip Menu |

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

Report information
The Basics
Id: 19404
Status: rejected
Priority: 0/
Queue: ExtUtils-F77

People
Owner: Nobody in particular
Requestors: at [...] altlinux.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.15
Fixed in: (no value)



Subject: fix for gfortran (gcc4.1)
Hello, gcc4.1 has no longer -lg2c and -lf2c but -lgfortran. This patch will also look for shared library first and then for static. -- Alexey Tourbin ALT Linux Team
Subject: perl-ExtUtils-F77-1.15-alt-g77.patch
--- ExtUtils-F77-1.15/F77.pm- 2005-02-03 18:12:49 +0300 +++ ExtUtils-F77-1.15/F77.pm 2006-05-22 14:01:09 +0400 @@ -170,28 +170,29 @@ ### Generic GNU-77 or F2C system ### $F77config{Generic}{G77}{Link} = sub { - my @libs = ('g2c', 'f2c'); +foreach my $ext qw(so a) { + my @libs = ('gfortran', 'g2c', 'f2c'); my ($dir, $lib, $test); foreach $test (@libs) { - $dir = `g77 -print-file-name=lib$test.a`; + $dir = `g77 -print-file-name=lib$test.$ext`; chomp $dir; # Note that -print-file-name returns just the library name # if it cant be found - make sure that we only accept the # directory if it returns a proper path (or matches a /) - if (defined $dir && $dir ne "lib$test.a") { + if (defined $dir && $dir ne "lib$test.$ext") { $lib = $test; # Found an existing library last; } } if( defined $dir && defined $lib) { - $dir =~ s,/lib$lib.a$,,; + $dir =~ s,/lib$lib.$ext$,,; } else { $dir = "/usr/local/lib"; $lib = "f2c"; } return( "-L$dir -L/usr/lib -l$lib -lm" ); -}; +}}; $F77config{Generic}{G77}{Trail_} = 1; $F77config{Generic}{G77}{Compiler} = find_in_path('g77','f77','fort77'); $F77config{Generic}{G77}{Cflags} = '-O'; @@ -219,6 +220,7 @@ $F77config{Linux}{G77} = $F77config{Generic}{G77}; $F77config{Linux}{F2c} = $F77config{Generic}{G77}; $F77config{Linux}{DEFAULT} = 'G77'; +$F77config{Linux}{G77}{Cflags} = $Config{optimize}; ### DEC OSF/1 ###
CC: at [...] altlinux.org
Subject: Re: [rt.cpan.org #19404] fix for gfortran (gcc4.1)
Date: Mon, 22 May 2006 11:25:55 -0400
To: bug-ExtUtils-F77 [...] rt.cpan.org
From: Karl Glazebrook <kgb [...] pha.jhu.edu>
Hi Alex. I already have my own patch to handle gfortran in an unreleased version I am testing. Would you care to give it a whirl? - Karl On May 22, 2006, at 6:10 AM, Guest via RT wrote: Show quoted text
> > Mon May 22 06:10:07 2006: Request 19404 was acted upon. > Transaction: Ticket created by guest > Queue: ExtUtils-F77 > Subject: fix for gfortran (gcc4.1) > Broken in: 1.15 > Severity: (no value) > Owner: Nobody > Requestors: at@altlinux.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=19404 > > > > Hello, gcc4.1 has no longer -lg2c and -lf2c but -lgfortran. > This patch will also look for shared library first and then for > static. > > -- > Alexey Tourbin > ALT Linux Team > > --- ExtUtils-F77-1.15/F77.pm- 2005-02-03 18:12:49 +0300 > +++ ExtUtils-F77-1.15/F77.pm 2006-05-22 14:01:09 +0400 > @@ -170,28 +170,29 @@ > ### Generic GNU-77 or F2C system ### > > $F77config{Generic}{G77}{Link} = sub { > - my @libs = ('g2c', 'f2c'); > +foreach my $ext qw(so a) { > + my @libs = ('gfortran', 'g2c', 'f2c'); > my ($dir, $lib, $test); > foreach $test (@libs) { > - $dir = `g77 -print-file-name=lib$test.a`; > + $dir = `g77 -print-file-name=lib$test.$ext`; > chomp $dir; > # Note that -print-file-name returns just the library name > # if it cant be found - make sure that we only accept the > # directory if it returns a proper path (or matches a /) > - if (defined $dir && $dir ne "lib$test.a") { > + if (defined $dir && $dir ne "lib$test.$ext") { > $lib = $test; # Found an existing library > last; > } > } > > if( defined $dir && defined $lib) { > - $dir =~ s,/lib$lib.a$,,; > + $dir =~ s,/lib$lib.$ext$,,; > } else { > $dir = "/usr/local/lib"; > $lib = "f2c"; > } > return( "-L$dir -L/usr/lib -l$lib -lm" ); > -}; > +}}; > $F77config{Generic}{G77}{Trail_} = 1; > $F77config{Generic}{G77}{Compiler} = find_in_path > ('g77','f77','fort77'); > $F77config{Generic}{G77}{Cflags} = '-O'; > @@ -219,6 +220,7 @@ > $F77config{Linux}{G77} = $F77config{Generic}{G77}; > $F77config{Linux}{F2c} = $F77config{Generic}{G77}; > $F77config{Linux}{DEFAULT} = 'G77'; > +$F77config{Linux}{G77}{Cflags} = $Config{optimize}; > > ### DEC OSF/1 ### >
From: mcummings [...] gentoo.org
On Mon May 22 11:25:28 2006, kgb@pha.jhu.edu wrote: Show quoted text
> Hi Alex. > > I already have my own patch to handle gfortran in an unreleased > version I am testing. Would you care to give it a whirl? > > - Karl
Any chance of a release? The patch the OP supplied doesn't seem to work, and gcc-4.1 isn't going away :)
Subject: Re: [rt.cpan.org #19404] fix for gfortran (gcc4.1)
Date: Mon, 16 Apr 2007 08:05:27 -0700
To: bug-ExtUtils-F77 [...] rt.cpan.org
From: Karl Glazebrook <karl [...] astro.swin.edu.au>
I will release it if you test it first! I am not completely confident in it. Karl On 16/04/2007, at 8:03 AM, mcummings@gentoo.org via RT wrote: Show quoted text
> > Queue: ExtUtils-F77 > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=19404 > > > On Mon May 22 11:25:28 2006, kgb@pha.jhu.edu wrote:
>> Hi Alex. >> >> I already have my own patch to handle gfortran in an unreleased >> version I am testing. Would you care to give it a whirl? >> >> - Karl
> > Any chance of a release? The patch the OP supplied doesn't seem to > work, > and gcc-4.1 isn't going away :)
---------------- Prof. Karl Glazebrook Phone: +61-3-9214-4384 karl@astro.swin.edu.au Centre for Astrophysics & Supercomputing Swinburne University of Technology
From: mcummings [...] gentoo.org
On Mon Apr 16 11:06:22 2007, karl@astro.swin.edu.au wrote: Show quoted text
> I will release it if you test it first! I am not completely confident > in it. > > Karl >
Happily and easily done :) FWIW, here's my pass at the patch (modified version of the one posted previously)
diff -Naurp ExtUtils-F77-1.15.old/F77.pm ExtUtils-F77-1.15/F77.pm --- ExtUtils-F77-1.15.old/F77.pm 2005-02-03 10:12:49.000000000 -0500 +++ ExtUtils-F77-1.15/F77.pm 2007-04-16 12:28:35.000000000 -0400 @@ -169,31 +169,32 @@ $F77config{Solaris}{DEFAULT} = 'F77'; ### Generic GNU-77 or F2C system ### +$F77config{Generic}{G77}{Compiler} = find_in_path('g77','f77','fort77','gfortran'); $F77config{Generic}{G77}{Link} = sub { - my @libs = ('g2c', 'f2c'); +foreach my $ext qw(so a) { + my @libs = ('gfortran', 'g2c', 'f2c'); my ($dir, $lib, $test); foreach $test (@libs) { - $dir = `g77 -print-file-name=lib$test.a`; + $dir = `$F77config{Generic}{G77}{Compiler} -print-file-name=lib$test.$ext`; chomp $dir; # Note that -print-file-name returns just the library name # if it cant be found - make sure that we only accept the # directory if it returns a proper path (or matches a /) - if (defined $dir && $dir ne "lib$test.a") { + if (defined $dir && $dir ne "lib$test.$ext") { $lib = $test; # Found an existing library last; } } if( defined $dir && defined $lib) { - $dir =~ s,/lib$lib.a$,,; + $dir =~ s,/lib$lib.$ext$,,; } else { $dir = "/usr/local/lib"; $lib = "f2c"; } return( "-L$dir -L/usr/lib -l$lib -lm" ); -}; +}}; $F77config{Generic}{G77}{Trail_} = 1; -$F77config{Generic}{G77}{Compiler} = find_in_path('g77','f77','fort77'); $F77config{Generic}{G77}{Cflags} = '-O'; $F77config{Generic}{DEFAULT} = 'G77'; $F77config{Generic}{F2c} = $F77config{Generic}{G77}; @@ -219,6 +220,7 @@ $F77config{Cygwin}{DEFAULT} = 'G77'; $F77config{Linux}{G77} = $F77config{Generic}{G77}; $F77config{Linux}{F2c} = $F77config{Generic}{G77}; $F77config{Linux}{DEFAULT} = 'G77'; +$F77config{Linux}{G77}{Cflags} = $Config{optimize}; ### DEC OSF/1 ###
Subject: Re: [rt.cpan.org #19404] fix for gfortran (gcc4.1)
Date: Tue, 17 Apr 2007 06:51:34 -0700
To: bug-ExtUtils-F77 [...] rt.cpan.org
From: Karl Glazebrook <karl [...] astro.swin.edu.au>
can you try my latest version: http://pentane.ssi.swin.edu.au/~karl/tmp2/PGPLOT-2.20snap.tar.gz Without your patch, that is. I think it should already work. Karl On 16/04/2007, at 9:41 AM, mcummings@gentoo.org via RT wrote: Show quoted text
> > Queue: ExtUtils-F77 > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=19404 > > > On Mon Apr 16 11:06:22 2007, karl@astro.swin.edu.au wrote:
>> I will release it if you test it first! I am not completely confident >> in it. >> >> Karl >>
> Happily and easily done :) > > FWIW, here's my pass at the patch (modified version of the one posted > previously) > > > diff -Naurp ExtUtils-F77-1.15.old/F77.pm ExtUtils-F77-1.15/F77.pm > --- ExtUtils-F77-1.15.old/F77.pm 2005-02-03 10:12:49.000000000 -0500 > +++ ExtUtils-F77-1.15/F77.pm 2007-04-16 12:28:35.000000000 -0400 > @@ -169,31 +169,32 @@ $F77config{Solaris}{DEFAULT} = 'F77'; > > ### Generic GNU-77 or F2C system ### > > +$F77config{Generic}{G77}{Compiler} = find_in_path > ('g77','f77','fort77','gfortran'); > $F77config{Generic}{G77}{Link} = sub { > - my @libs = ('g2c', 'f2c'); > +foreach my $ext qw(so a) { > + my @libs = ('gfortran', 'g2c', 'f2c'); > my ($dir, $lib, $test); > foreach $test (@libs) { > - $dir = `g77 -print-file-name=lib$test.a`; > + $dir = `$F77config{Generic}{G77}{Compiler} -print-file- > name=lib$test.$ext`; > chomp $dir; > # Note that -print-file-name returns just the library name > # if it cant be found - make sure that we only accept the > # directory if it returns a proper path (or matches a /) > - if (defined $dir && $dir ne "lib$test.a") { > + if (defined $dir && $dir ne "lib$test.$ext") { > $lib = $test; # Found an existing library > last; > } > } > > if( defined $dir && defined $lib) { > - $dir =~ s,/lib$lib.a$,,; > + $dir =~ s,/lib$lib.$ext$,,; > } else { > $dir = "/usr/local/lib"; > $lib = "f2c"; > } > return( "-L$dir -L/usr/lib -l$lib -lm" ); > -}; > +}}; > $F77config{Generic}{G77}{Trail_} = 1; > -$F77config{Generic}{G77}{Compiler} = find_in_path > ('g77','f77','fort77'); > $F77config{Generic}{G77}{Cflags} = '-O'; > $F77config{Generic}{DEFAULT} = 'G77'; > $F77config{Generic}{F2c} = $F77config{Generic}{G77}; > @@ -219,6 +220,7 @@ $F77config{Cygwin}{DEFAULT} = 'G77'; > $F77config{Linux}{G77} = $F77config{Generic}{G77}; > $F77config{Linux}{F2c} = $F77config{Generic}{G77}; > $F77config{Linux}{DEFAULT} = 'G77'; > +$F77config{Linux}{G77}{Cflags} = $Config{optimize}; > > ### DEC OSF/1 ### >
---------------- Prof. Karl Glazebrook Phone: +61-3-9214-4384 karl@astro.swin.edu.au Centre for Astrophysics & Supercomputing Swinburne University of Technology
From: mcummings [...] gentoo.org
On Tue Apr 17 09:53:01 2007, karl@astro.swin.edu.au wrote: Show quoted text
403's :/ (sorry for the delay, since I haven't figured out how to get email for bugs i'm not OP on :)
Sorry I think this patch goes about things the wrong way. I don't think you should modify the G77 database entry based on whether g77, gfortran etc are present - rather the code should choose database entries. My new version goes some way to addressing this, please try this when I post a test version to PDL-Porters in the next few days