[SciPy-dev] Undefined NAN in amos_wrappers.c errors on Solaris amd64
Michael Abshoff
michael.abshoff@googlemail....
Wed May 6 16:57:14 CDT 2009
Dave Peterson wrote:
Hi,
> Finding that many of the other .c files in scipy/special/cephes
> contained an extern NAN definition, I ended up inserting the following
> in amos_wrappers.c. The file now compiles and 'python setup.py build'
> finishes, but is this the "right" fix? I would have thought there was a
> common header where this should be declared?
>
> extern double INFINITY, NAN;
I don't believe this is the "right" fix. It will work, but that doesn't
mean it is the way it is supposed to be fixed. Unlike many other
operating systems the C99 bits of the math standard are guarded on
Solaris by C99 checks, i.e. if you add "-std=c99" to your compiler flags
it should work out of the box. Note that this might open up a potential
can of worms since all the sudden some other header bits aren't there
any more since they are conditionally used only when C99 is not defined.
Anyway, the flag setting might be too invasive for some people, but I
just wanted to point out that technically the fix is a hacky (but quite
common) workaround. As long as it works I don't care too much :)
>
> -- Dave
Cheers,
Michael
More information about the Scipy-dev
mailing list