summaryrefslogtreecommitdiff
path: root/doc/mini-gmp
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2014-01-18 09:41:16 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2014-01-18 09:41:16 +0000
commit9cd4cdb483efeee923253f638e00a291b2fe81fd (patch)
tree9c66ba17e753f8d1662611e5acc2c35972af3f8f /doc/mini-gmp
parent6fa234d57272cd46673af7b8ac7049bf4dec2bc5 (diff)
downloadmpfr-9cd4cdb483efeee923253f638e00a291b2fe81fd.tar.gz
instructions to compile MPFR with mini-gmp
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8790 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'doc/mini-gmp')
-rw-r--r--doc/mini-gmp38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/mini-gmp b/doc/mini-gmp
new file mode 100644
index 000000000..85149857c
--- /dev/null
+++ b/doc/mini-gmp
@@ -0,0 +1,38 @@
+How to compile GNU MPFR with mini-gmp
+=====================================
+
+(this was tested with MPFR 3.1.2 and GMP 5.1.3 on x86_64 GNU/Linux machine)
+
+1) extract the GMP tarball in say /tmp/gmp-5.1.3
+ go into /tmp/gmp-5.1.3/mini-gmp
+ add the following line in mini-gmp.c (say at line 43):
+ char gmp_version[] = "5.1.3";
+ 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
+ mv libgmp.a /tmp/lib
+ cp mini-gmp.h /tmp/include/gmp.h
+
+3) do the following changes in /tmp/include/gmp.h:
+
+$ diff gmp.h.orig gmp.h
+29a30,35
+> #define __GNU_MP_VERSION 5
+> #define __GNU_MP_VERSION_MINOR 1
+> #define __GNU_MP_VERSION_PATCHLEVEL 3
+>
+> extern char gmp_version[];
+>
+34a41,46
+> #endif
+>
+> /* random generation functions */
+> #ifndef gmp_randstate_t
+> typedef long int __gmp_randstate_struct;
+> typedef __gmp_randstate_struct gmp_randstate_t[1];
+
+4) extract the MPFR tarball in say /tmp/mpfr-3.1.2
+ ./configure --with-gmp=/tmp --enable-mini-gmp