blob: 085e776088ae64a9fbd389e78f4bfa87e79128a0 (
plain)
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
|
How to compile GNU MPFR with mini-gmp
=====================================
To build and test MPFR against mini-gmp:
./configure --with-mini-gmp=DIR [other configure options]
make
make check
"make" will build mini-gmp with the same compiler as for MPFR.
For "make check", tests that use features not supported by mini-gmp
(mpq_t, mpf_t, and the gmp_*printf functions) are skipped.
Note: To use this version of the MPFR library, you need to define
the MPFR_USE_MINI_GMP macro before including mpfr.h (alternatively,
you can modify mpfr.h to define this macro at the beginning). But
this will currently not be usable since mini-gmp.h does not declare
gmp_randstate_t (you need to modify either mini-gmp.h or mpfr.h).
Remark: the random functions provided by MPFR configured with mini-gmp
use the lrand48() function, thus one should avoid this configuration if one
needs some really serious random functions.
This was tested with MPFR svn r13226 and GMP 6.1.2 on x86_64 GNU/Linux:
============================================================================
Testsuite summary for MPFR 4.1.0-dev
============================================================================
# TOTAL: 183
# PASS: 173
# SKIP: 10
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
How to use mini-gmp with reduced limb size
==========================================
Following the idea of Micro-GMP [1], the GMP developers have adapted mini-gmp
so that it can be used with a reduced limb size.
For that, you have to take a GMP snapshot from December 09, 2018, or later
(see https://gmplib.org/download/snapshot/).
Then replace the "typedef unsigned long mp_limb_t;" line of mini-gmp.h
to have for example:
#include <stdint.h>
typedef uint8_t mp_limb_t;
#define __GMP_SHORT_LIMB
Then you can configure MPFR with that version of mini-gmp, as indicated above.
[1] https://members.loria.fr/PZimmermann/talks/microgmp.pdf
|