[SciPy-User] [cython-users] bug report + feature request (was: scipy cblas return value)

Dima Pasechnik dimpase at gmail.com
Fri Sep 27 04:59:37 EDT 2013


On 2013-09-26, William Stein <wstein at gmail.com> wrote:
> On Thu, Sep 26, 2013 at 11:35 AM, Arnaud Bergeron <abergeron at gmail.com> wrote:
>> 2013/9/26 William Stein <wstein at gmail.com>
>>>
>>> On Thu, Sep 26, 2013 at 10:04 AM, Arnaud Bergeron <abergeron at gmail.com>
>>> wrote:
>>> > Or scipy is badly compiled.  Since OS X does not ship with a fortran
>>> > compiler it is especially hard to compile and link it properly with a
>>> > blas.
>>> > If you use slightly incompatible compilers there is absolutely no
>>> > compile
>>> > error you just get broken results out of the blas functions.
>>> >
>>> > On that note the only prebuilt scipy that is not broken is the one that
>>> > comes with Enthough Canopy.
>>>
>>> Are you saying that the prebuilt scipy we ship with Sage is broken?
>>> I'm curious, since I can file a bug report, and I thought we had
>>> things sorted out by now, after putting a heck of a lot of work into
>>> this platform over the last 6 years...  Here's our Mac binaries:
>>>
>>>
>>> http://boxen.math.washington.edu/home/sagemath/sage-mirror/osx/intel/index.html
>>
>>
>> Sage isn't just a python distribution :)  It's also not listed on the scipy
>> install page.
>
> OK, good point :-)
>
>>
>> But still, the scipy binaries that come with it are broken (at least for the
>> 10.6 package I tried).  If you try the command above it returns -0.0 rather
>> than the correct 0.09999999403953552.
>
> Ugh.  Many thanks for the bug report.

could be due to using binary for wrong arch. With OSX 10.6 there were
lots of issues whether it's a 32-bit or 64-bit... 
At least on my 32-bit OSX 10.6 system self-compiled Sage 5.12.beta4
works as expected:
$ uname -a
Darwin nash 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT
2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

sage: scipy.linalg.blas.sdot(np.array([10.],dtype=np.float32),np.array([0.01],dtype=np.float32))
0.09999999403953552
sage: version()
'Sage Version 5.12.beta4, Release Date: 2013-08-30'

>
>>
>>
>>>
>>> Here's the source, which I think automatically gets things right
>>> (regarding building scipy), assuming one follows the instructions...
>>>
>>>
>>> http://boxen.math.washington.edu/home/sagemath/sage-mirror/src/index.html
>>>
>>>  --William
>>>
>>>
>>> >  The Anaconda one is broken.  I haven't tried
>>> > the standalone packages, though.
>>> >
>>> >
>>> > 2013/9/26 Sturla Molden <sturla at molden.no>
>>> >>
>>> >>
>>> >> On Sep 26, 2013, at 3:09 PM, Radim Řehůřek <me at radimrehurek.com> wrote:
>>> >>
>>> >> > I guess I was too verbose, let me rephrase:
>>> >> >
>>> >> > 1. BUG REPORT
>>> >> > `scipy.linalg.blas.sdot` gives wrong results on mac:
>>> >> >
>>> >> > >>> scipy.linalg.blas.sdot(np.array([ 10.], dtype=np.float32),
>>> >> > >>> np.array([ 0.01], dtype=np.float32))
>>> >> > -0.0
>>> >> >
>>> >>
>>> >> Let me submit in evidence to the contrary:
>>> >>
>>> >> In [20]:
>>> >>
>>> >> scipy.linalg.blas.sdot(np.array([10.],dtype=np.float32),np.array([0.01],dtype=np.float32))
>>> >> Out[20]: 0.09999999403953552
>>> >>
>>> >> In [21]: sys.platform
>>> >> Out[21]: 'darwin'
>>> >>
>>> >> It is your BLAS library that makes the error, not SciPy.
>>> >>
>>> >>
>>> >> Sturla
>>> >>
>>> >> --
>>> >>
>>> >> ---
>>> >> You received this message because you are subscribed to the Google
>>> >> Groups
>>> >> "cython-users" group.
>>> >> To unsubscribe from this group and stop receiving emails from it, send
>>> >> an
>>> >> email to cython-users+unsubscribe at googlegroups.com.
>>> >> For more options, visit https://groups.google.com/groups/opt_out.
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > La brigade SnW veut vous recruter - http://www.brigadesnw.ca
>>> >
>>> > --
>>> >
>>> > ---
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "cython-users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> > an
>>> > email to cython-users+unsubscribe at googlegroups.com.
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>> --
>>> William Stein
>>> Professor of Mathematics
>>> University of Washington
>>> http://wstein.org
>>>
>>> --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google Groups
>>> "cython-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to cython-users+unsubscribe at googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "cython-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cython-users+unsubscribe at googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> -- 
> William Stein
> Professor of Mathematics
> University of Washington
> http://wstein.org
>




More information about the SciPy-User mailing list