Skip Menu |
 

This queue is for tickets about the Math-Pari CPAN distribution.

Report information
The Basics
Id: 72861
Status: open
Priority: 0/
Queue: Math-Pari

People
Owner: Nobody in particular
Requestors: CLEACH [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.0305_01080605
Fixed in: (no value)



Subject: An AIX patch for Math-Pari and other OS ...
Hi Everyone, As you may know, Math-Pari doesn’t build for AIX today. It hits a fatal error when “perl Makefile.PL” is run. But there is a simple patch available to fix this problem. I ran into this known bug in pari-2.3.2 years ago when it first came out and they never used my reported patch for AIX, so it was never incorporated into Math-Pari. So because of this it only took me a couple of days to find and figure out a similar solution for Math-Pari. (Please remember you don’t need to build pari yourself, you just need the source code so that Math-Pari can compile what it needs.) The bug is in utils/Math/PariBuild.pm from code it copied over from the pari build and can be found in: pari-2.3.x/config/Makefile.SH The issue is that evaluating “../functions/*/*” in the shell for some systems like AIX is that it returns too many files and causes the system call to merge_822 to fail, causing “perl Makefile.PL” to fail as well. My patch has one bug I didn’t encode for, that’s if one of the sub-directories under functions is empty. But that doesn’t happen in the 2.3.x tree (I didn’t try the 2.1.x tree or the incompatible 2.5.x tree to see if they had any empty directories.) So my patch is: …/Math-Pari-2.01080605/utils/Math> diff PariBuild.pm PariBuild.pm.orig 1332,1338c1332,1334 < unlink ($t); < warn "Running My Customization:: `$^X merge_822 ../functions/*/* > $t'...\n"; < foreach (glob ("../functions/*")) { < next unless (-d $_); < my $d = basename ($_); < system "$^X merge_822 ../functions/$d/* >> $t" < and die "Can't run `$^X merge_822 ../functions/$d/* >> $t'"; < } --- Show quoted text
> #warn "Running `$^X merge_822 ../functions/*/* > $t'...\n"; > system "$^X merge_822 ../functions/*/* > $t" > and die "Can't run `$^X merge_822 ../functions/*/* > $t'";
…./Math-Pari-2.01080605/utils/Math> Hopefully this patch makes it into the next release of Math-Pari. But until then I hope this patch makes building this module easier for others. Enjoy! Curtis
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #72861] An AIX patch for Math-Pari and other OS ...
Date: Wed, 30 Nov 2011 21:17:17 -0800
To: Curtis Leach via RT <bug-Math-Pari [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
Download (untitled) / with headers
text/plain 1.1k
On Wed, Nov 30, 2011 at 09:16:32PM -0500, Curtis Leach via RT wrote: Show quoted text
> But there is a simple patch available to fix this problem.
Thanks! Show quoted text
> So my patch is:
The patch is inverted, and not very much useful (too few options to diff - I prefer "-pu"). Show quoted text
> ???/Math-Pari-2.01080605/utils/Math> diff PariBuild.pm PariBuild.pm.orig > 1332,1338c1332,1334 > < unlink ($t); > < warn "Running My Customization:: `$^X merge_822 ../functions/*/* > > $t'...\n"; > < foreach (glob ("../functions/*")) { > < next unless (-d $_); > < my $d = basename ($_); > < system "$^X merge_822 ../functions/$d/* >> $t" > < and die "Can't run `$^X merge_822 ../functions/$d/* >> $t'"; > < } > ---
> > #warn "Running `$^X merge_822 ../functions/*/* > $t'...\n"; > > system "$^X merge_822 ../functions/*/* > $t" > > and die "Can't run `$^X merge_822 ../functions/*/* > $t'";
> ???./Math-Pari-2.01080605/utils/Math>
Are you sure that just { local STDOUT; open STDOUT, '>', 't' or DOSOMEERRORHANDLING; system $^X, 'merge_822', glob ("../functions/*/*") and die .... } won't be enough? Thanks again, Ilya
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #72861] An AIX patch for Math-Pari and other OS ...
Date: Wed, 30 Nov 2011 21:19:21 -0800
To: Curtis Leach via RT <bug-Math-Pari [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
Download (untitled) / with headers
text/plain 328b
On Wed, Nov 30, 2011 at 09:17:17PM -0800, Ilya Zakharevich wrote: Show quoted text
> { local STDOUT;
Oups, this should have been { local *STDOUT; Show quoted text
> open STDOUT, '>', 't' or DOSOMEERRORHANDLING; > system $^X, 'merge_822', glob ("../functions/*/*") > and die .... > } > won't be enough? > > Thanks again, > Ilya
Sorry, Ilya
Sorry, Your suggestion doesn't work. You are going to have to make multiple system calls to merge_822 and merge the results like I did in my patch. The problem is the resulting system command has way too many parameters for AIX to handle once the glob() command expands. (659 files in pari-2.3.5 for a command length of 23,688 chars.) You are going to have to do some type of loop as I did for my patch. There is a max length for a spawned job in AIX that your command exceeds. Here's the error message returned by your example's system call: Can't exec "perl": The parameter or environment lists are too long. Curtis On Thu Dec 01 00:19:32 2011, nospam-abuse@ilyaz.org wrote: Show quoted text
> On Wed, Nov 30, 2011 at 09:17:17PM -0800, Ilya Zakharevich wrote:
> > { local STDOUT;
> > Oups, this should have been > { local *STDOUT; >
> > open STDOUT, '>', 't' or die ("Can't reopen STDOUT\n"); > > system $^X, 'merge_822', glob ("../functions/*/*") > > or die ("$!\n"); > > } > > won't be enough? > > > > Thanks again, > > Ilya
> > Sorry, > Ilya
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #72861] An AIX patch for Math-Pari and other OS ...
Date: Thu, 1 Dec 2011 15:48:06 -0800
To: Curtis Leach via RT <bug-Math-Pari [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
Download (untitled) / with headers
text/plain 698b
On Wed, Nov 30, 2011 at 09:16:32PM -0500, Curtis Leach via RT wrote: Show quoted text
> ???/Math-Pari-2.01080605/utils/Math> diff PariBuild.pm PariBuild.pm.orig > 1332,1338c1332,1334 > < unlink ($t); > < warn "Running My Customization:: `$^X merge_822 ../functions/*/* > > $t'...\n"; > < foreach (glob ("../functions/*")) { > < next unless (-d $_); > < my $d = basename ($_); > < system "$^X merge_822 ../functions/$d/* >> $t" > < and die "Can't run `$^X merge_822 ../functions/$d/* >> $t'"; > < }
I do not like your basename(). Can you do with my @l = glob "$_/*" or next; system "$^X merge_822 @l >> $t" and die "Can't run `$^X merge_822 @l >> $t'"; Ilya
Download (untitled) / with headers
text/plain 1.1k
Your change below should work nicely. I only used basename() to make it clearer what I was doing. I originally did: system "$^X merge_822 $_/* >> $t" But I wanted my patch to make it obvious to you what I was doing. Just processing one sub-directory in functions at a time. So if you fix it like you have it below so that it works on your system, I'll be glad to give the finished product a try on my AIX box. Curtis On Thu Dec 01 18:48:16 2011, nospam-abuse@ilyaz.org wrote: Show quoted text
> On Wed, Nov 30, 2011 at 09:16:32PM -0500, Curtis Leach via RT wrote:
> > ???/Math-Pari-2.01080605/utils/Math> diff PariBuild.pm PariBuild.pm.orig > > 1332,1338c1332,1334 > > < unlink ($t); > > < warn "Running My Customization:: `$^X merge_822 ../functions/*/* > > > $t'...\n"; > > < foreach (glob ("../functions/*")) { > > < next unless (-d $_); > > < my $d = basename ($_); > > < system "$^X merge_822 ../functions/$d/* >> $t" > > < and die "Can't run `$^X merge_822 ../functions/$d/* >> $t'"; > > < }
> > I do not like your basename(). Can you do with > > my @l = glob "$_/*" or next; > system "$^X merge_822 @l >> $t" > and die "Can't run `$^X merge_822 @l >> $t'"; > > Ilya


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.