Math::GMP and Pari Installed, But BigInt Can't Find Them

M

MaggotChild

perl -MMath::pari -e'$a=PARI 2;print $a**10000'
#Big number...
perl -MMath::GMP -e'print Math::GMP->new(2) ** 1000'
#Same Big Number...
perl -e'use Math::BigInt lib => "GMP,Pari";'
Math::BigInt: couldn't load specified math lib(s), fallback to
Math::BigInt::Calc at -e line 1

What gives?

As an aside, is it possible to import GMP or Pari from the command
line? -M doesn't play nice with a string of import args:
perl -MMath::BigInt='lib,Pari' -e'1'
#OK, can't load module error

But:
perl -MMath::BigInt='lib,"GMP,Pari"' -e'1'
"Pari"" is not exported by the Math::BigInt module
Can't continue after import errors at -e line 0
BEGIN failed--compilation aborted.
 
M

MaggotChild

You also need to install Math::BigInt::GMP and Math::BigInt::pari. (I
believe the former doesn't actually use the Math::GMP bindings at all,
and instead links with the C library directly.)

Doh! OK, thanks.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top