MPFR 2.3.1 requires GMP 4.1.0 or higher.
The MPFR 2.3.1 source can be downloaded in the following archive formats:
Important note: If the MPFR build fails, please read the section In case of problem of the INSTALL file. In particular, GMP is known for using a different ABI from the default one on some 64-bit platforms, and in such a case, if you do not provide the same compiler flags as those automatically selected by GMP, things will probably go wrong, e.g. libgmp not found error message at configure time (this error message will be improved in future MPFR versions).
MPFR is also available via third-party packages and ports.
The bugs listed below have been fixed (latest update: 2008-05-11). The following instructions are for Linux and may be similar for other operating systems. You can apply the patches in several ways:
patch -N -Z -p1 < path_to_patches_filefrom the source directory. The -N option allows the patch command to ignore patches already applied. The -Z option sets the modification time of the patched files from time stamps given in the patch file, thus avoiding the need of some development utilities (such as autoconf); this may generate a
Not setting timewarning for the PATCHES file, but you can safely ignore it. Under Microsoft Windows, in addition to the above options, you may need the --binary option (this depends whether the end-of-lines have been converted when you downloaded the patch file). Also note that the --dry-run option does not work with this cumulative patch.
svn co svn://scm.gforge.inria.fr/svn/mpfr/branches/2.3 mpfr-2.3In this case, as said on the Gforge page, you should read the README.dev file for details on how to build MPFR. Also note that the branch may contain additional minor fixes.
With the first two ways, the PATCHES file is modified,
so that one can know what patches have been applied, using the new
mpfr_get_patches
function. Moreover a suffix is added to
the version string, but note that for practical reasons, not all the
files where the version appears are patched; thus one can also track
applied patches with the MPFR_VERSION_STRING
macro (header)
and the mpfr_get_version
function (library). However, if
some patches are not applied or if patches are applied in a different
order, then the patch command will fail to update some chunks, so that
the suffix is not always reliable for patches.
Note: These patches are in unified diff format and some vendors' patch commands cannot deal with them; in this case, please use GNU patch (it may already be installed on your system, e.g. as /usr/local/bin/patch or gpatch).
Fixed bugs:
The thread-safe configure test (enabled when the --enable-thread-safe option is given) always fails when the build directory is different from the source directory. This is fixed by the thread-safe configure patch.
Note that two files are patched: acinclude.m4 and configure, but the timestamp of acinclude.m4 is not updated (if the -Z patch option is given as recommended above) to avoid the unnecessary rebuild of some files by additional development tools (not always available).
Some other bugs have been found and fixed both in the trunk and in the 2.3 branch. The ones that may affect the user are listed below. The corresponding patches are not published (these bugs will be fixed in the upcoming 2.3.2 release), but the changeset numbers (in the 2.3 branch) are given for the reference.
mpfr_pow_ui
, mpfr_pow_si
and
mpfr_pow_z
(but not mpfr_pow
) on NaN^0 return NaN
instead of 1 (as documented, MPFR's power functions are
based on the specifications of the ISO C99 standard).mpfr_div
, which returns
+2emin−1 (resp. −2emin−1)
instead of +0 (resp. −0) in rounding to nearest when
the rounded result in unbounded exponent range is ±2emin−2
and the corresponding ternary value is positive (resp.
negative).mpfr_mul_2si
, mpfr_div_2si
and
mpfr_div_2ui
, which return +0 (resp. −0)
instead of +2emin−1 (resp.
−2emin−1) in rounding to nearest when the rounded
result in unbounded exponent range is ±2emin−2 and the
corresponding ternary value is negative (resp. positive).mpfr_exp
has the following problems:
bug20080731
in
texp.c
for an example).mpfr_pow_si
, Ziv's iteration is done in a linear way
(old code) instead of the common way. This means a noticeable performance
loss in very special cases.MPFR_EMAX_MAX
(this is the default on 32-bit
platforms, but not on 64-bit platforms) when the temporary result (in a
higher precision) is representable but once rounded, it yields an overflow.
Most code is very unlikely to be affected by this bug.mpfr_pow
,
mpfr_pow_ui
, mpfr_pow_si
, mpfr_pow_z
)
have the following problems:
mpfr_pow(z, x, y, rnd)
with integer
|y| ≥ 2256, unless an overflow or underflow had been detected
first;mpfr_hypot
has the following problems:
mpfr_hypot
can loop on tiny values (due to
internal underflow);Other bugs: please see the BUGS file.
mpfr_strtofr
and in
its documentation concerning particular cases where the code and
the documentation did not match.MPFR 2.3.1 has been successfully compiled and checked on the following platforms: