summaryrefslogtreecommitdiff
path: root/INSTALL
blob: dba032ff28f98b19c71874ab4ce9461b614a57fe (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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
			Installing MPFR
			===============

0. You first need to install GMP. See <http://www.swox.com/gmp/>.
   MPFR requires GMP version 4.1 or later.

1. In the MPFR build directory, to detect your system, type:
     ./configure 

2. To build the library, type:
     make

3. To check the built library (runs the test files), type:
     make check

4. To install it (default `/usr/local` | see `--prefix` option), type:
     make install


Building the documentation
==========================

To build the documentation in various formats, you may first need to
install recent versions of some utilities such as texinfo.

* Type "make info" to produce the documentation in the info format.

* Type "make dvi" to produce the documentation in the DVI format.

* Type "make mpfr.ps" to produce the documentation in the Postscript format.


Building MPFR with internal GMP header files
============================================

   MPFR built with internal GMP header files is a few faster,
   so you may want to build it with them. Just do this in step 1:

     ./configure --with-gmp-build=GMPBUILD

   where GMPBUILD is the GMP build directory.
   The needed header files are:
     gmp-impl.h, longlong.h and all the necessary headers to use them.

./configure options
===================

--prefix=DIR            installs MPFR headers and library in DIR/include
                        and DIR/lib respectively (The default is `/usr/local`).

--with-gmp-include=DIR  assumes that DIR contains gmp.h [, gmp-impl.h, ...]
--with-gmp-lib=DIR      assumes that DIR contains libgmp.a
--with-gmp-build=DIR	assumes that DIR contains the source of GMP.    
			same as --with-gmp-lib=DIR/.libs
			and     --with-gmp-include=DIR
--with-gmp=DIR        	assumes that DIR is where you have installed GMP.
			same as --with-gmp-lib=DIR/lib
                        and     --with-gmp-include=DIR/include

--enable-assert		Build MPFR with assertions.
--with-irix64           Irix64 support.

Run "./configure --help" to see the other options (`autoconf` default options).


In case of problem
==================

   If the `configure` fails, please check that the C compiler and
   its options are the same as those for the GMP build (specially the ABI).
   You can see the latter with the following:
     grep "^CC\|^CFLAGS" GMPBUILD/Makefile

   Then type (for example, under a sh-compatible shell):
     CC=<C compiler> CFLAGS=<compiler options> ./configure \
       --with-gmp-include=GMPBUILD --with-gmp-lib=GMPINSTALL/lib
   And continue the install.

   On some architectures, you should provide further options to match
   those used by GMP, for example, on powerpc-aix:
     make AR="ar -X64"

   On some architectures, try with `gmake` instead of `make`.

   If you can't solve your problem, you could contact us at mpfr@loria.fr,
   indicating the machine and operating system used (uname -a), the compiler
   and version used (gcc -v if you use gcc), the compile options used if any,
   the version of GMP and MPFR used and a description of the problem 
   encountered. Please send us also a log of the installation.

Notes on Windows
================

1 - we advise to use mingw (http://www.mingw.org/), which is simpler and
    less demanding than cygwin. Contrary to Cygwin, it also provides native
    windows code. The binaries compiled with Cygwin require a dynamic
    library (cygwin.dll) to work; there is a Cygwin option -mno-cygwin to
    build native code, but it may require some non-portable tricks.

2 - if you just want to make a binary with gcc, there is nothing to do:
    gmp, mpfr and the program compile exactly as under Linux.

3 - if you want to make libraries to work under a native Windows compiler
    like Visual C / C++, the "trick" is that the unix-like *.a files created
    by gcc are entirely compatible with the Windows *.lib files. So you just
    have to rename the *.a files into *.lib.

    With gmp-4.1.3, the only remaining problem seems to be the "alloca" calls
    in gmp. Configuring gmp and mpfr with --enable-alloca=malloc-reentrant
    should work.