problem building gmp on Mac G5

Kate Minola kminola at po0.glue.umd.edu
Tue Jan 6 16:46:25 CET 2004


Kevin Ryde <user42 at zip.com.au> write:
> 
> Kate Minola <kminola at po1.glue.umd.edu> writes:
> >
> > (powerpc-apple-darwin7.2.0 according to config.guess and
> > configfsf.guess.)
> >
> > : ../../../gmp-4.1.2/tests/misc/t-scanf.c:1421: GNU MP assertion failed: ret == -1
> > : FAIL: t-scanf
> 
> This sounds like a libc sscanf bug we encountered recently on that
> system (darwin7.2.0).
> 
> The program below should print -1.  If it prints 0 then you have the
> bug (and should complain to Apple or whoever looks after the libc).
> 
> This bug affects gmp_sscanf, but we're not intending to make a
> workaround (a bit tricky), though we will try to suppress the
> offending test for the next release.
> 
> #include <stdio.h>
> 
> int
> main (void)
> {
>   printf ("%d\n",
>           sscanf ("", "%*d"));
>   return 0;
> }

Thank you for the information.  If I am correctly reading
the thread on the freebsd list beginning with

http://lists.freebsd.org/pipermail/freebsd-current/2003-October/012767.html

it seems that the output of sscanf in the above situation
is not well-defined ... and in the FreeBSD case, not likely
to change any time soon.

I do not have access to other machines with operating
systems based on FreeBSD other than Mac OS X v10.3 (which
is based upon FreeBSD 5.0).  Thus I can not do a comparison
check.

Suppressing the offending test seems a reasonable course of
action.

I was able to do this by removing 't-scanf' from line 27 of

   gmp-4.1.2/tests/misc/Makefile.am

and then running 'automake' in the top-level directory of
gmp-4.1.2.  Then the usual sequence of 'configure', 'make',
'make check', and 'make install' worked just fine.

I built gmp once with --host=none-unknown-darwin (generic)
and once using the default options (which look to use some
powerpc32 assembler code).  Wordsize in both cases
according to gmp.h is 32.  The GMPbench results are as
follows:

           base.multiply   base.divide  app.rsa  GMPbench
generic      3039.3          1756.4      133.06    554.46
default      9139.6          4829.9      386.8    1603.1

The machine is a 2 CPU 2GHz G5.

Perhaps not spectacular ... but better than the GMPbench
score of 0 that I was getting when I could not get gmp to
run!

Kate Minola
Engineering Department
University of Maryland, College Park


More information about the gmp-bugs mailing list