[Numpy-discussion] numpy.sqrt behaving differently on MacOS Lion

Russell E. Owen rowen at uw.edu
Wed Jul 27 15:00:56 EDT 2011


In article 
<CABL7CQj4i6StF_QJNdVCh66fsfc5BjQ9ETpX3UkcZAxYYUwpng at mail.gmail.com>,
 Ralf Gommers <ralf.gommers at googlemail.com> wrote:

> On Wed, Jul 27, 2011 at 7:17 PM, Ilan Schnell <ischnell at enthought.com>wrote:
> 
> > MacOS Lion:
> > >>> numpy.sqrt([complex(numpy.nan, numpy.inf)])
> > array([ nan+infj])
> >
> > Other all system:
> > array([ inf+infj])
> >
> > This causes a few numpy tests to fail on Lion.  The numpy
> > was not compiled using the new LLVM based gcc, it is the
> > same numpy binary I used on other MacOS systems, which
> > was compiled using gcc-4.0.1.  However on Lion it is linked
> > to Lions LLVM based gcc runtime, which apparently has some
> > different behavior when it comes to such strange complex
> > values.
> >
> > These type of complex corner cases fail on several other platforms, there
> they are marked as skipped. I propose not to start changing this yet - the
> compiler change is causing problems with scipy (
> http://projects.scipy.org/scipy/ticket/1476) and it's not yet clear what the
> recommended build setup on Lion should be.
> 
> Regarding binaries, it may be better to distribute separate ones for each
> version of OS X from numpy 1.7 / 2.0 (we already do for python 2.7). In that
> case this particular failure will not occur.

Please don't distribute a different numpy binary for each version of 
MacOS X. That makes it very difficult to distribute bundled applications.

The current situation is very reasonable, in my opinion: numpy has two 
Mac binary distributions for Python 2.7: 32-bit 10.3-and-up and 64-bit 
10.6-and-up. These match the python.org python distributions. I can't 
see wanting any more than one per python.org Mac binary.

Note that the numpy Mac binaries are not listed next to each other on 
the numpy sourceforge download page, so some folks are installing the 
wrong one. If you add even more os-specific flavors the problem is 
likely to get worse.

-- Russell




More information about the NumPy-Discussion mailing list