Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Trouble installing Math::Pari by grinder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-16 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found