The canard à l'orange release.
MPFR 3.1.0 requires GMP 4.1.0 or higher (GMP 4.2.3 or higher is recommended).
Note: the bug-fix release MPFR 3.1.1 is available. Please upgrade!
Warning! Due to the fact that Thread-Local Storage
(TLS) support is now detected
automatically, the MPFR build can be incorrect on some
platforms (compiler or system bug). Indeed,
the
TLS implementation of some compilers/platforms is buggy,
and MPFR cannot detect every problem at configure time.
Please run make check
to see if your build is affected.
If you get failures, you should try the --disable-thread-safe
configure option to disable TLS and see if this solves
these failures. But you should not use an MPFR library
with TLS disabled in a multithreaded program (unless
you know what you are doing).
The MPFR 3.1.0 source can be downloaded in the following archive formats:
MPFR is also available via third-party packages and ports.
The bugs listed below have been fixed (latest update: 2012-05-07). The patches are distributed under the same license as this version of MPFR, that is, the GNU Lesser General Public License (GNU Lesser GPL), version 3 or later.
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 if the cumulative patch has some file listed several times.
svn co svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1 mpfr-3.1In 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
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, with patches:
MPFR_UNLIKELY
internal macro definition for
GCC is incorrect. The compiled code can be affected
when a limb is larger than a long (e.g. with
some ABI's, such as
mode32 on PowerPC). The MPFR_UNLIKELY
definition
has been incorrect since it was introduced in MPFR 2.1.0,
but problems started to be visible only in MPFR 3.1.0
with all assertions checked (the MPFR code is normally
written to work with the incorrect definition). This bug is fixed by the
mpfr_unlikely patch."%.20RNg"
may give "100" instead of "1000"). This bug,
which has always been present (since these functions were introduced
in MPFR 2.4.0),
is fixed by the vasprintf patch
(which also provides testcases). Note: MPFR 3.1.0
also introduced a regression in some other cases, such as -9.996 in
32 bits printed with "%.2Rg"
.mpfr_add_d
, mpfr_add_ui
and mpfr_mul_d
; but mpfr_add_ui
is used by
other functions (directly or indirectly). This is due to a typo in an
argument for the internal logging macro MPFR_LOG_FUNC
:
instead of the variable mpfr_log_prec
(whose value is 6
by default), the function pointer mpfr_get_prec
is used,
and it has an arbitrary value. This bug
(#13933)
is fixed by the logging-freeze patch.MPFR_LOG_VAR
. If the logged variable has a huge value,
the output has many digits; this can potentially take much memory
and disk space. This bug is fixed by the
logging-varfmt patch.mpfr_prec_t
to a signed type, it
is no longer possible to use precisions close to MPFR_PREC_MAX
in some cases where it used to work. This problem is fixed by the
large-prec patch, which also provides
a simple testcase. Note that:
32-bit machines, or
64-bit machineswhere MPFR is built with a 32-bit ABI, e.g. with the -m32 compiler option).
MPFR_PREC_MAX
,
because of this type limitation or a lack of memory.__gmp_const
macro, which has been
removed
from the GMP repository on 2012-03-04.
The __gmp_const patch provides
a temporary fix. More precisely, in the past, this macro was used
for K&R (pre-ANSI) C compatibility, and it
should nowadays be defined to const
; this is what the
patch does when GMP doesn't define this macro.
Future major MPFR versions (3.2.0 and later)
will replace __gmp_const
by const
, like
what has been done in GMP.mpfr_gamma
is
buggy: some results may incorrectly be regarded as underflow. This bug
is fixed by the gamma-underflow patch,
which also provides a testcase. Warning! While this patch avoids
incorrect results on values close to underflow, it makes another problem
appear: a possible infinite loop for some underflow cases. In particular,
the testsuite will freeze on 32-bit machines. You also need the following
patch to avoid that.mpfr_gamma
is not exact, the exact detection must be performed
in the general computation code to avoid an endless loop. This is done by
the gamma-overunderflow patch, which
also provides testcases.See the tracker and the BUGS file.
mpfr_urandom
and mpfr_urandomb
functions
now return identical values on processors with different word size (assuming
the same random seed, and since the GMP random generator
does not depend itself on the word size, cf
https://gmplib.org/list-archives/gmp-devel/2010-September/001642.html).mpfr_add_one_ulp
and mpfr_sub_one_ulp
macros (which are obsolete and no more documented) will be removed in a
future release.mpfr_sqr
and mpfr_div
functions using Mulders' algorithm. As a consequence, other functions using
those routines are also faster.mpfr_printf
, etc.)
with %Rg and similar.mpfr_buildopt_gmpinternals_p
,
mpfr_buildopt_tune_case
, mpfr_frexp
,
mpfr_grandom
and mpfr_z_sub
.make check(so that running the tests under valgrind or gdb is easier).
Note: The mpfr_subnormalize
implementation up to
MPFR 3.0.0 did not change the flags.
In particular, it did not follow the generic rule concerning the
inexact flag (and no special behavior was specified). The case of
the underflow flag was more a lack of specification.
MPFR 3.1.0 has been successfully compiled and checked on the following platforms: