summaryrefslogtreecommitdiff
path: root/doc/mini-gmp
blob: 8224d67fdeb6f005b858e351523a5f537a04ae78 (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
How to compile GNU MPFR with mini-gmp
=====================================

This was tested with MPFR svn 13047 and GMP 6.1.2 on x86_64 GNU/Linux:
============================================================================
Testsuite summary for MPFR 4.0.0-dev
============================================================================
# TOTAL: 183
# PASS:  173
# SKIP:  10
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

There are 2 ways to build MPFR against mini-gmp.

A) With --with-mini-gmp:

   ./configure --with-mini-gmp=DIR [other configure options]

"make" will build mini-gmp with the same compiler as for MPFR.

B) With --enable-mini-gmp:

1) extract the GMP tarball in say /tmp/gmp-6.1.2
   go into /tmp/gmp-6.1.2/mini-gmp
   gcc -O2 -g -fPIC -c mini-gmp.c
   ar r libgmp.a mini-gmp.o

2) create a GMP install directory in say /tmp
   mkdir /tmp/include
   mkdir /tmp/lib
   cp libgmp.a /tmp/lib
   cp mini-gmp.h /tmp/include/gmp.h

3) extract the MPFR tarball in say /tmp/mpfr
   ./configure --with-gmp=/tmp --enable-mini-gmp --disable-shared

Note: In both cases, 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 as is if mini-gmp.h doesn't declare gmp_randstate_t.