[MPFR] bug report (?)

Vincent Lefevre vincent at vinc17.net
Tue Apr 15 07:58:00 UTC 2014


On 2014-04-14 19:28:41 -0600, Matthew Niemerg wrote:
> As suggested, here are the config.log files for both GMP and MPFR (renamed
> appropriately).  As you can see, I did both the clang compiler and the
> gcc-4.7.3 compiler, with both yielding the same error message.

1. In config.log_mpfr_clang:

conftest.c:59:27: error: use of undeclared identifier 'BYTES_PER_MP_LIMB'
  return GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
                          ^
conftest.c:60:34: error: use of undeclared identifier 'BYTES_PER_MP_LIMB'
         && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1;
                                 ^

Even though configure outputs "error: GMP_NUMB_BITS is incorrect.",
the real error is that BYTES_PER_MP_LIMB is undefined. This seems to
be a change in GMP 6 (I can confirm). So, don't use --with-gmp-build
for the moment. We'll publish a patch for MPFR 3.1.2.

2. In config.log_mpfr_gcc-4.7.3:

conftest.c:59:27: error: 'BYTES_PER_MP_LIMB' undeclared (first use in this function)

So, same problem. In this second case, there is another problem,
though:

> On Mon, Apr 14, 2014 at 5:29 PM, Vincent Lefevre <vincent at vinc17.net> wrote:
> > On 2014-04-14 16:21:47 -0600, Matthew Niemerg wrote:
> > > I am using no additional configure flags, apart from using the
> > > gcc-4.7.3 compiler.
> >
> > If you use CC=gcc-4.7.3 in the configure line, this will disable the
> > automatic CFLAGS detection by MPFR, with known problems if you are on
> > a machine with a 32-bit ABI by default. Something like that.

This one. You have a 32-bit ABI by default, and GMP was built
with the -m64 switch (64-bit ABI). By default, MPFR will detect
this, but if you use CC and/or CFLAGS as you did here
(CC=/usr/local/gcc-4.7.3/bin/gcc), this detection is disabled
so that MPFR won't override your choices. This means that you
are responsible for providing the right flags, i.e. you should
use CFLAGS too, with at least -m64 in it.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list