Hmm.... unless this machine doesn't support uint16_t but does support
uint32_t. That is apparently possible as many compilers don't
implement the c99 standard properly. It's also apparently a
fundamental limitation of some platforms, though hopefully none of the
ones we want to support, since FLINT absolutely requires it on
machines whose unsigned long is 32 bits.

There is the file written by Paul Hsieh to fix this for many systems:

http://www.azillionmonkeys.com/qed/pstdint.h

The problem is, the line

#ifndef uint16_t

does not work on some systems. Even though uint16_t is defined, the
compiler will not recognise that it is so (e.g. in Cygwin).
Nonetheless, it apparently does no harm to redefine it, as pstdint.h
does and tthen FLINT builds and runs fine.

This is probably the closest we will get to portability.

I'll include pstdint.h in the next revision of FLINT suitable for
inclusion in SAGE and we'll see if it still builds on all the other
systems it currently builds on. Pretend c99 compliance is a real
problem, and had I known about it before starting, I would have not
made use of anything in the c99 standard.

Bill.

On 24 Nov, 18:39, Bill Hart <[EMAIL PROTECTED]> wrote:
> It's OK. In the latest revision of FLINT this will build. Essentially
> u_int32_t should work, but it doesn't on all c99 systems. However I
> looked into this and uint32_t should always work on "c99 compliant"
> systems, even on systems which the former is a problem for. Therefore
> in the latest FLINT release I've simply replaced all occurrences of
> the former with the latter.
>
> I've tried #defines, e.g. #ifndef u_int32_t, etc., however these
> #defines themselves caused build problems on some systems for me.
> Hopefully what I've done in the latest FLINT will always work on
> systems which claim to be c99 compliant.
>
> Bill.
>
> On 24 Nov, 18:23, "William Stein" <[EMAIL PROTECTED]> wrote:
>
> > On Nov 24, 2007 10:18 AM, mabshoff
>
> > <[EMAIL PROTECTED]> wrote:
>
> > > Hello Bill,
>
> > > > * Sparc Solaris 10 -- flint doesn't build, since maybe u_int16_t
> > > > doesn't exist or
> > > > isn't properly included:
>
> > > this is because Solaris 9 isn't C99 conform. I have a fix for this (a
> > > couple defines) that we also use for Sage in general.
> > > On Solaris 10
> > > flint should build, but I haven't checked. There already is a ticket
> > > about this, see #1178.
>
> > I was building on Solaris 10 not solaris 9 (see below):
>
> > > > SunOS abel 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-V440
> > > > gcc version 4.1.1
>
> > > > gcc -std=c99 
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include/
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include
> > > > -funroll-loops -fexpensive-optimizations  -fPIC -funroll-loops   -O3
> > > > -c fmpz_poly.c -o fmpz_poly.o
> > > > fmpz_poly.c: In function [EMAIL PROTECTED]@~Y:
> > > > fmpz_poly.c:169: error: [EMAIL PROTECTED]@~Y undeclared (first use in
> > > > this function)
> > > > fmpz_poly.c:169: error: (Each undeclared identifier is reported only 
> > > > once
> > > > fmpz_poly.c:169: error: for each function it appears in.)
> > > > fmpz_poly.c:169: error: expected [EMAIL PROTECTED];[EMAIL PROTECTED] 
> > > > before [EMAIL PROTECTED]@~Y
> > > > fmpz_poly.c:222: error: [EMAIL PROTECTED]@~Y undeclared (first use in 
> > > > this function)
> > > > fmpz_poly.c:222: error: expected [EMAIL PROTECTED];[EMAIL PROTECTED] 
> > > > before [EMAIL PROTECTED]@~Y
> > > > make: *** [fmpz_poly.o] Error 1
> > > > gcc -std=c99 
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include/
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include
> > > > -funroll-loops -fexpensive-optimizations  -fPIC -funroll-loops   -O3
> > > > -c mpn_extras-test.c -o mpn_extras-test.o
> > > > gcc -std=c99 
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include/
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include
> > > > -I/hearsthome/home/math1/was/solaris10/sage-2.8.13.rc2/local/include
> > > > -funroll-loops -fexpensive-optimizations  -fPIC -funroll-loops   -O3
> > > > -c fmpz_poly.c -o fmpz_poly.o
> > > > fmpz_poly.c: In function [EMAIL PROTECTED]@~Y:
> > > > fmpz_poly.c:169: error: [EMAIL PROTECTED]@~Y undeclared (first use in
> > > > this function)
> > > > fmpz_poly.c:169: error: (Each undeclared identifier is reported only 
> > > > once
> > > > fmpz_poly.c:169: error: for each function it appears in.)
> > > > fmpz_poly.c:169: error: expected [EMAIL PROTECTED];[EMAIL PROTECTED] 
> > > > before [EMAIL PROTECTED]@~Y
> > > > fmpz_poly.c:222: error: [EMAIL PROTECTED]@~Y undeclared (first use in 
> > > > this function)
> > > > fmpz_poly.c:222: error: expected [EMAIL PROTECTED];[EMAIL PROTECTED] 
> > > > before [EMAIL PROTECTED]@~Y
> > > > make: *** [fmpz_poly.o] Error 1
> > > > Error building flint shared library.
>
> > > > * OSX 10.4 PPC -- works fine, all tests pass.
>
> > --
> > William Stein
> > Associate Professor of Mathematics
> > University of Washingtonhttp://wstein.org
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to