[Numpy-discussion] scipy 0.7.1rc2 released

David Cournapeau cournape@gmail....
Mon Jun 8 06:54:59 CDT 2009


On Mon, Jun 8, 2009 at 8:45 PM, Matthieu
Brucher<matthieu.brucher@gmail.com> wrote:
> 2009/6/8 David Cournapeau <david@ar.media.kyoto-u.ac.jp>:
>> Matthieu Brucher wrote:
>>> I'm trying to compile it with ICC 10.1.018, and it fails :|
>>>
>>> icc: scipy/special/cephes/const.c
>>> scipy/special/cephes/const.c(94): error: floating-point operation
>>> result is out of range
>>>   double INFINITY = 1.0/0.0;  /* 99e999; */
>>>                        ^
>>>
>>> scipy/special/cephes/const.c(99): error: floating-point operation
>>> result is out of range
>>>   double NAN = 1.0/0.0 - 1.0/0.0;
>>>                   ^
>>>
>>> scipy/special/cephes/const.c(99): error: floating-point operation
>>> result is out of range
>>>   double NAN = 1.0/0.0 - 1.0/0.0;
>>>                             ^
>>>
>>> compilation aborted for scipy/special/cephes/const.c (code 2)
>>> scipy/special/cephes/const.c(94): error: floating-point operation
>>> result is out of range
>>>   double INFINITY = 1.0/0.0;  /* 99e999; */
>>>                        ^
>>>
>>> scipy/special/cephes/const.c(99): error: floating-point operation
>>> result is out of range
>>>   double NAN = 1.0/0.0 - 1.0/0.0;
>>>                   ^
>>>
>>> scipy/special/cephes/const.c(99): error: floating-point operation
>>> result is out of range
>>>   double NAN = 1.0/0.0 - 1.0/0.0;
>>>
>>> At least, it seems to pick up the Fortran compiler correctly (which
>>> 0.7.0 didn't seem to do ;))
>>>
>>
>> This code makes me cry... I know Visual Studio won't like it either.
>> Cephes is a constant source of problems . As I mentioned a couple of
>> months ago, I think the only solution is to rewrite most of
>> scipy.special, at least the parts using cephes, using for example boost
>> algorithms and unit tests. But I have not started anything concrete -
>> Pauli did most of the work on scipy.special recently (Kudos to Pauli for
>> consistently improving scipy.special, BTW)
>>
>> cheers,
>
> It could be simply enhanced by refactoring only mconf.h with proper
> compiler flags, and fix yn.c to remove the NAN detection (as it should
> be in the mconf.h).

NAN and co definition should be dealt with the portable definitions we
have now in numpy - I just have to find a way to reuse the
corresponding code outside numpy (distutils currently does not handle
proper installation of libraries built through build_clib), it is on
my TODO list for scipy 0.8.

Unfortunately, this is only the tip of the iceberg. A lot of code in
cephes uses #ifdef on platform specificities, and let's not forget it
is pre-ANSI C code (K&R declarations), with a lot of hidden bugs.\

cheers,

David


More information about the Numpy-discussion mailing list