-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
executable file
·93 lines (68 loc) · 3.31 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
This module wraps all of the 'mpz' (integer) functions that
the Gnu MP (GMP) library provides. Requires gmp-4.2.0 or later.
You therefore need the GMP library installed on your computer. See:
https://gmplib.org/
To build this module you need perl 5.6.0 or later. I'm not sure of all
the requirements to get it to build with earlier versions of perl, but
it's definite that the XS code relating to operator overloading will
not compile with perl versions prior to 5.6.
No OO interface - just plain access to GMP's integer functions.
Build in the usual way:
perl Makefile.PL
make
make test
make install
When building this module, the GMP library will need to be accessible.
If it's not in a location where your compiler finds it by default,
then instead of running 'perl Makefile.PL', you'll need to run:
perl Makefile.PL INC="-I/path/to/gmp_include" LIBS="-L/path/to/gmp_lib -lgmp"
==============
64-bit support
==============
If your perl's Config reports that 'ivsize' is greater than or
equal to 8 && 'ivtype' is not 'long', then Math::GMPz will, by
default, be built to enable you to use the 64-bit long long int
values with the new() function and the overloaded operators.
Similarly, if your perl's Config reports that 'nvsize' > 8,
then Math::GMPz will, by default, be built to enable you to use the
larger precision values (be they either 'long double' or '__float128'
with the new() function and the overloaded operators.
I am contactable by email at sisyphus at(@) cpan dot (.) org.
==========
MAC OS X
==========
I don't test on Macs ... and I don't know if the following advice is
still relevant:
If you have MacPorts installed, you may need to install gmp +universal
for the bindings to work. After installing you'll need to run:
perl Makefile.PL INC="-I/opt/local/include" LIBS="-L/opt/local/lib -lgmp"
===============================
MS WINDOWS (Visual Studio 2019)
===============================
I don't know how to build the gmp library using Visual Studio 2019, so
when building this module with Visual Studio 2019 I build against a
gmp library that was built using MinGW-w64.
Building with Visual Studio 2019 against a *dynamic* gmp library that was
built using a MinGW-w64 compiler is not recommended, as strange results
can then arise when calling gmp functions that take a FILE* argument.
If building with Visual Studio 2019 against a static gmp library that was
built using a MinGW-w64 compiler I first make a copy of the gmp library
(libgmp.a) along with copies of the following MinGW-w64 library files:
libgcc.a
libmingwex.a
libmingw32.a
For each of the 4 copied files, I leave the filename unchanged (though the
"lib" at the begining of the name is optional), and change the file
extension to ".lib".
In making those copies, I've left them in the same directory as the
original, but I assume (untested) that the copies could be moved to any
location of your choice.
Then build this module by cd'ing to the top level Math::GMPz source folder
and running:
perl Makefile.PL INC="-IC:/path/to/gmp_header" LIBS="-LC:/path/to/libgcc -lgcc -LC:/path/to/standard_libs -lmingwex -lmingw32 -LC:/path/to/libgmp -lgmp"
nmake test
nmake install
NOTES:
1) The given example "perl Makefile.PL ..." command assumes that libmingwex
and libmingw32 libraries are in the same location;
2) The same method can be used to build Math::GMP using VS 2019.