Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Trouble installing Math::Pari

by grinder (Bishop)
on Jul 26, 2001 at 18:52 UTC ( [id://100001]=perlquestion: print w/replies, xml ) Need Help??

grinder has asked for the wisdom of the Perl Monks concerning the following question:

I read Factoring Decimal Digits with interest yesterday, especially tilly's response about using Math::Pari. I wish I had known about this when I wrote a a very simple obfuscation. Said obfu revolved around dividing and taking the remainder of a very large number (3269658930343791523110212544821057737304852999550, to be precise). What I had wanted to do at the time was to factor that number. Math::Pari would have come in handy for that purpose.

So I thought I'd install it. And that is where my troubles began.

I've tried two different Linux flavours, OpenBSD, FreeBSD and Solaris, and each time it bombs out, with the same error. The PARI library itself appears to install okay. Its own regression tests pass. But when I try to run the Perl tests I see nothing but failures.

Trying to run just the first test I get the following:

[root@rouzic]:/usr/src/Math-Pari-2.001804# PERL_DL_NONLAZY=1 /usr/bin/ +perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.1/i686-linux - +I/usr/local/lib/perl5/5.6.1 -e 'use Test::Harness qw(&runtests $verbo +se); $verbose=0; runtests @ARGV;' t/analyz.t t/analyz............Variable in perl2pari is not of known type at test +_eng/Testout.pm line 8. ...propagated at t/analyz.t line 5. t/analyz............dubious Test returned status 255 (wstat 65280, 0xff00) FAILED--1 test script could be run, alas--no output ever seen

So let's have a look at t/analyz.t and test_eng/Testout.pm and see what is going on

t/anaylz.t

$file = __FILE__; $file =~ m|([^/.]*)\.t$| or die; @ARGV = "pari-2.1.1/src/test/32/$1"; do 'test_eng/Testout.pm'; die if $@;

Ok, this just appears to be doing an indirection to PARI's own regression tests.

test_eng/Testout.pm

1 #! perl 2 # $rcs = ' $Id: testout.t,v 1.2 1997/09/22 10:13:37 ilya + Exp ilya $ ' ; 3 4 use Math::Pari qw(:DEFAULT pari_print :all); 5 use vars qw($x $y $z $k $t $q $a $u $j $l $name $other $n); 6 die "Need a path to a testout file" unless @ARGV; 7 8 $file = shift; 9 { 10 open TO, "< $file" or die "open `$file': $!"; 11 local $/ = "\n? "; 12 @tests = <TO>; 13 close TO or die "close: $!"; 14 } [...]

Here I drew a blank. I don't understand how the error message "Variable in perl2pari is not of known type at test_eng/Testout.pm line 8." relates to the above code. Line 8 is just saying $file = shift;

I don't know if you've ever tried to run the debugger on a regression test, but after a bit of spelunking I was able to see that all Test::Harness does is to say words to the effect of

$cmd = '/usr/bin/perl -w t/analyz.t|' my $fh = new FileHandle; $fh->open($cmd) or print "can't run $test. $!\n";

That sounds easy enough, I think I'll try that myself. This time I've got it.

Too few args 0 for PARI function shift at test_eng/Testout. ...propagated at t/analyz.t line 5.

Okay, so there's some sneaky overloading going on... what am I to do about it? Another thing that dampens my spirits it that the CPAN Testers rate the module as a FAIL on both ppc-linux and sparc-openbsd platforms. Certainly I have nothing so exotic, but right now I'd appreciate any pointers to help me solve my problem. I must say that the README and INSTALL files are particularly useless with respect to troubleshooting.

So, tilly, how did you do it?

--
g r i n d e r

Replies are listed 'Best First'.
Re: Trouble installing Math::Pari
by runrig (Abbot) on Jul 26, 2001 at 19:49 UTC
    Math::Pari is exporting its own shift function (and some others) to the test, causing some real problems. Download the latest version from Ilya's home directory here (and maybe send him a friendly note asking when will it be available on CPAN :).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://100001]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found