Pari lib with Math-BigInt (win32)

Discussion in 'Perl Misc' started by gnu valued customer, May 24, 2004.

  1. hello,

    Win2k sp3
    Perl 5.8.1 (ActiveState extensions)

    using Math-Pari 2.010500

    and the latest Math-BigInt i've
    tried to install and use
    Math-BigInt-Pari.

    Everything installs fine, but I get
    this warning when I call like so

    use Math::BigInt lib => 'Pari';

    warning:
    Cannot load outdated Math::BigInt::pari v1.10, please
    upgrade at ... (points to about 'use')

    The script is reverting to the Pure-Perl version of
    Math-BigInt (slow).

    tia for your help,
    Mark Pryor
     
    gnu valued customer, May 24, 2004
    #1
    1. Advertising

  2. gnu valued customer

    Sisyphus Guest

    gnu valued customer wrote:

    >
    > warning:
    > Cannot load outdated Math::BigInt::pari v1.10, please
    > upgrade at ... (points to about 'use')
    >


    Version 1.10 was put on CPAN earlier this year, and is the latest
    available ... calling it "outdated" seems a little severe to me :)

    I get the same. The error is produced by Math::BigInt-1.70 - search
    'BigInt.pm' for "outdated". I tried Math::BigInt-1.64 and the error did
    not arise, though 'nmake test' threw up some other errors. Perhaps using
    version 1.69 or 1.68 instead of 1.70 would provide a temporary workaround.

    The M::BI::p author (Tels), who is also currently maintaining M::BI,
    might be able to provide some insight if you don't get a satisfactory
    answer here. (He should at least be informed of the problem.)

    Cheers,
    Rob

    --
    To reply by email u have to take out the u in kalinaubears.
     
    Sisyphus, May 25, 2004
    #2
    1. Advertising

  3. Hello Rob,
    "Sisyphus" <> wrote in message news:40b29109$0$16599$...
    > gnu valued customer wrote:
    >
    > >
    > > warning:
    > > Cannot load outdated Math::BigInt::pari v1.10, please
    > > upgrade at ... (points to about 'use')
    > >

    >
    > Version 1.10 was put on CPAN earlier this year, and is the latest
    > available ... calling it "outdated" seems a little severe to me :)
    >
    > I get the same. The error is produced by Math::BigInt-1.70 - search
    > 'BigInt.pm' for "outdated". I tried Math::BigInt-1.64 and the error did
    > not arise, though 'nmake test' threw up some other errors. Perhaps using
    > version 1.69 or 1.68 instead of 1.70 would provide a temporary workaround.


    After having this suggestion seconded by Tels, I found v. 1.68 here
    http://backpan.cpan.org/authors/id/T/TE/TELS/math/

    Thanks Rob for pointing out such an easy workaround. Someone was saying
    that I'd have to edit Math-BigInt-Pari myself, or wait 2 weeks!

    By the way, using Pari underneath Math-BigInt is giving me a
    several-order-of-magnitude speed increase. In the Pure-Perl case, computing
    a 2048 bit Diffie-Hellman secret took over 1 minute; with (lib => 'Pari'), it
    takes less than 1 second.

    I'm prototyping the use of Perl(cgi) as a DH key server to the
    Win32 CryptoAPI. With this speed increase I'm now planning on
    finishing the prototyping, instead of giving up (in vain).

    regards,
    Mark

    >
    > The M::BI::p author (Tels), who is also currently maintaining M::BI,
    > might be able to provide some insight if you don't get a satisfactory
    > answer here. (He should at least be informed of the problem.)


    I saw Tels post today in the ASPN Mailing list. Thanks to Tels for
    confirmation the workaround of using an earlier version (<1.70)
    >
    > Cheers,
    > Rob
    >
    > --
    > To reply by email u have to take out the u in kalinaubears.
    >
     
    gnu valued customer, May 25, 2004
    #3
  4. gnu valued customer

    Sisyphus Guest

    gnu valued customer wrote:

    >
    > By the way, using Pari underneath Math-BigInt is giving me a
    > several-order-of-magnitude speed increase. In the Pure-Perl case, computing
    > a 2048 bit Diffie-Hellman secret took over 1 minute; with (lib => 'Pari'), it
    > takes less than 1 second.
    >


    Yes, pure-perl doesn't deal so well with modular exponentiation - which
    I would think is what eats up the time in your Diffie-Hellman computations.

    I generally find that using GMP instead of Pari provides a further
    (significant) speed increase. In the script below, I find GMP to be 20
    times faster than Pari, but results vary depending upon the actual size
    of the operands and the types of computations being conducted.

    ----------------------------------
    use Math::BigInt;
    #use Math::BigInt lib => 'GMP'; # Plug M::BI into M::GMP
    #use Math::BigInt lib => 'Pari'; # Plug M::BI into M::pari

    use warnings;
    use Benchmark;

    $n = Math::BigInt->new('3' x 400);
    $e = Math::BigInt->new('7' x 400);
    $m = $e - 10;

    timethese(1, {
    'bench' => '$n->bmodpow($e, $m);',
    });

    print $n, "\n";
    ----------------------------------

    If you want to try GMP on Win32, you can get the necesssary GMP dll from:
    http://www.kalinabears.com.au/w32perl/GMP-4.1.3-msvc.tar.gz

    Just extract 'libgmp-3.dll' from the tarball and place it somewhere in
    your path. You won't need any of the other files contained in the tarball.

    There's also Win32 binaries of Math::BigInt::GMP available.

    Download for perl 5.6:
    http://www.kalinabears.com.au/w32perl/Math-BigInt-GMP-56.tar.gz

    Download for perl 5.8:
    http://www.kalinabears.com.au/w32perl/Math-BigInt-GMP-58.tar.gz

    Just install as per instructions in the Readme.

    I've only just recently updated those files, and haven't yet checked to
    see if anything has been broken in the process :)
    If anyone does find there's something that's broke, please let me know.

    Cheers,
    Rob

    --
    To reply by email u have to take out the u in kalinaubears.
     
    Sisyphus, May 26, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jussi Mononen

    Math::Pari test fail on Compaq OSF1 5.1b

    Jussi Mononen, Jan 2, 2004, in forum: Perl
    Replies:
    0
    Views:
    702
    Jussi Mononen
    Jan 2, 2004
  2. Haydin

    Install Poblem MATH::Pari

    Haydin, Mar 18, 2005, in forum: Perl
    Replies:
    0
    Views:
    1,477
    Haydin
    Mar 18, 2005
  3. W. Van Hooste

    SSH and Math::Pari prereq on AIX5.1

    W. Van Hooste, Jun 15, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    238
    W. Van Hooste
    Jun 17, 2004
  4. MaggotChild
    Replies:
    1
    Views:
    190
    MaggotChild
    Oct 28, 2009
  5. VK
    Replies:
    15
    Views:
    1,285
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page