scipy on snow leopard

Hello,

I first tried to install scipy using the stable build on snow leopard.
I am using the python that came with it. It complains about can't
install when cross compiling.
Then I installed numpy svn and scipy svn, both compile fine but when
importing scipy,linalg I get :
site-packages/scipy/linalg/flapack.so: mach-o, but wrong architecture
or when importing interpolate:
site-packages/scipy/special/_cephes.so: mach-o, but wrong architecture

Please help
     Wolfgang
Robert Kern | 1 Sep 09:24
Picon
Gravatar

Re: scipy on snow leopard

On Tue, Sep 1, 2009 at 02:19, Wolfgang
Kerzendorf<wkerzendorf <at> googlemail.com> wrote:
> Hello,
>
> I first tried to install scipy using the stable build on snow leopard.
> I am using the python that came with it. It complains about can't
> install when cross compiling.
> Then I installed numpy svn and scipy svn, both compile fine but when
> importing scipy,linalg I get :
> site-packages/scipy/linalg/flapack.so: mach-o, but wrong architecture
> or when importing interpolate:
> site-packages/scipy/special/_cephes.so: mach-o, but wrong architecture

Please provide the full output of the error messages and the full
build log (it's probably too big to attach to the list; you may need
to post it somewhere and show us the URL).

What Fortran compiler are you using and what version? Please state
exactly what website you downloaded it from.

Please show us the output of

  $ file site-packages/scipy/linalg/flapack.so

Probably, the required architecture flags have changed for the build
of Python on Snow Leopard and numpy.distutils needs to be updated.

--

-- 
Robert Kern

(Continue reading)

Re: scipy on snow leopard

Dear Robert,

Here is all the information I can gather:

I tried several gfortrans here is the one that i'm using now:

GNU Fortran (GCC) 4.5.0 20090604 (experimental) [trunk revision 148180]
Copyright (C) 2009 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

----

Here is the full error message:

In [1]: import scipy.interpolate
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call  
last)

/Users/wkerzend/≤ipython console> in <module>()

/Library/Python/2.6/site-packages/scipy/interpolate/__init__.py in  
<module>()
       5 from info import __doc__
       6
----> 7 from interpolate import *
(Continue reading)

Re: scipy on snow leopard

Another thing that I forgot:

Heres the file information on _cephes.so:
file /Library/Python/2.6/site-packages/scipy/special/_cephes.so
/Library/Python/2.6/site-packages/scipy/special/_cephes.so: Mach-O  
bundle i386
bye
    Wolfgang
On 01/09/2009, at 9:24 , Robert Kern wrote:

> On Tue, Sep 1, 2009 at 02:19, Wolfgang
> Kerzendorf<wkerzendorf <at> googlemail.com> wrote:
>> Hello,
>>
>> I first tried to install scipy using the stable build on snow  
>> leopard.
>> I am using the python that came with it. It complains about can't
>> install when cross compiling.
>> Then I installed numpy svn and scipy svn, both compile fine but when
>> importing scipy,linalg I get :
>> site-packages/scipy/linalg/flapack.so: mach-o, but wrong architecture
>> or when importing interpolate:
>> site-packages/scipy/special/_cephes.so: mach-o, but wrong  
>> architecture
>
> Please provide the full output of the error messages and the full
> build log (it's probably too big to attach to the list; you may need
> to post it somewhere and show us the URL).
>
> What Fortran compiler are you using and what version? Please state
(Continue reading)

Ivo Maljevic | 1 Sep 18:37
Picon

SciPy+NumPy on 4 major linux distributions

I think this subject was brought up before in the form of a question about which distro works better with scientific tools, so I wanted to see which linux distribution
does a better job at packaging scipy/numpy without being subjective (my preferred distro overall is Ubuntu).

I've tested 4 major distributions: openSUSE 11.1, Ubuntu 9.04, Mandriva 2009.1 and Fedora 11.
It seems like none of them does a perfect job, but, still, the clear winner is Fedora 11.

Here is why:

1. It is the only distro that has all the dependencies worked out, so you can run numpy.test() and scipy.test() without having to install python-nose
2. NumPy passes all the tests without a single error, and SciPy has only one error (see at the bottom)

openSUSE and Mandriva not only do not pass these tests, but end up with memory corruption and crash python. Ubuntu also fails tese tests,
but there is no memory corruption. (BTW, I opened a bug on openSUSE's site)

Mandriva differes from the others because it packages scimath, which includes additional enthought functions, which is a good thing, if only it didn't
corrupt memory with a simple:

>>>from scipy.special import chebyt
>>>chebyt(12)(-0.5)

call. openSUSE's scipy also crashes on this simple test.

All distributions have scipy version 0.7.*, but Ubuntu's NumPy is a bit older.

Cheers,
Ivo

NumPy test on Fedora 11:

Ran 2030 tests in 64.996s

OK (KNOWNFAIL=1)
<nose.result.TextTestResult run=2030 errors=0 failures=0>

SciPy test on Fedora 11:
======================================================================
ERROR: test_implicit (test_odr.TestODR)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/scipy/odr/tests/test_odr.py", line 88, in test_implicit
    out = implicit_odr.run()
  File "/usr/lib/python2.6/site-packages/scipy/odr/odrpack.py", line 1055, in run
    self.output = Output(apply(odr, args, kwds))
TypeError: y must be a sequence or integer (if model is implicit)

----------------------------------------------------------------------
Ran 3394 tests in 212.467s

FAILED (KNOWNFAIL=2, SKIP=17, errors=1)
<nose.result.TextTestResult run=3394 errors=1 failures=0>


_______________________________________________
SciPy-User mailing list
SciPy-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
Chris Colbert | 1 Sep 18:55
Picon
Gravatar

Re: SciPy+NumPy on 4 major linux distributions

What I would like to see is a distribution build numpy and scipy with
threaded atlas support.

As it stands currently, Ubuntu "has atlas support", but its not
threaded, and the packages are broken...

Until that happens, I'll be rolling my own numpy and scipy from source.

Cheers,

Chris

On Tue, Sep 1, 2009 at 12:37 PM, Ivo Maljevic<ivo.maljevic <at> gmail.com> wrote:
> I think this subject was brought up before in the form of a question about
> which distro works better with scientific tools, so I wanted to see which
> linux distribution
> does a better job at packaging scipy/numpy without being subjective (my
> preferred distro overall is Ubuntu).
>
> I've tested 4 major distributions: openSUSE 11.1, Ubuntu 9.04, Mandriva
> 2009.1 and Fedora 11.
> It seems like none of them does a perfect job, but, still, the clear winner
> is Fedora 11.
>
> Here is why:
>
> 1. It is the only distro that has all the dependencies worked out, so you
> can run numpy.test() and scipy.test() without having to install python-nose
> 2. NumPy passes all the tests without a single error, and SciPy has only one
> error (see at the bottom)
>
> openSUSE and Mandriva not only do not pass these tests, but end up with
> memory corruption and crash python. Ubuntu also fails tese tests,
> but there is no memory corruption. (BTW, I opened a bug on openSUSE's site)
>
> Mandriva differes from the others because it packages scimath, which
> includes additional enthought functions, which is a good thing, if only it
> didn't
> corrupt memory with a simple:
>
>>>>from scipy.special import chebyt
>>>>chebyt(12)(-0.5)
>
> call. openSUSE's scipy also crashes on this simple test.
>
> All distributions have scipy version 0.7.*, but Ubuntu's NumPy is a bit
> older.
>
> Cheers,
> Ivo
>
> NumPy test on Fedora 11:
>
> Ran 2030 tests in 64.996s
>
> OK (KNOWNFAIL=1)
> <nose.result.TextTestResult run=2030 errors=0 failures=0>
>
> SciPy test on Fedora 11:
> ======================================================================
> ERROR: test_implicit (test_odr.TestODR)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/python2.6/site-packages/scipy/odr/tests/test_odr.py", line
> 88, in test_implicit
>     out = implicit_odr.run()
>   File "/usr/lib/python2.6/site-packages/scipy/odr/odrpack.py", line 1055,
> in run
>     self.output = Output(apply(odr, args, kwds))
> TypeError: y must be a sequence or integer (if model is implicit)
>
> ----------------------------------------------------------------------
> Ran 3394 tests in 212.467s
>
> FAILED (KNOWNFAIL=2, SKIP=17, errors=1)
> <nose.result.TextTestResult run=3394 errors=1 failures=0>
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User <at> scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
Robert Kern | 1 Sep 20:11
Picon
Gravatar

Re: scipy on snow leopard

On Tue, Sep 1, 2009 at 03:25, Wolfgang
Kerzendorf<wkerzendorf <at> googlemail.com> wrote:
> Dear Robert,
>
> Here is all the information I can gather:
>
> I tried several gfortrans here is the one that i'm using now:
>
> GNU Fortran (GCC) 4.5.0 20090604 (experimental) [trunk revision 148180]
> Copyright (C) 2009 Free Software Foundation, Inc.
>
> GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
> You may redistribute copies of GNU Fortran
> under the terms of the GNU General Public License.
> For more information about these matters, see the file named COPYING

And where exactly did you get it from? Does it have x86_64 support?

> Here is the full error message:
>
> In [1]: import scipy.interpolate
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call
> last)
>
> /Users/wkerzend/≤ipython console> in <module>()
>
> /Library/Python/2.6/site-packages/scipy/interpolate/__init__.py in
> <module>()
>       5 from info import __doc__
>       6
> ----> 7 from interpolate import *
>       8 from fitpack import *
>       9
>
> /Library/Python/2.6/site-packages/scipy/interpolate/interpolate.py in
> <module>()
>      11                   dot, poly1d, asarray, intp
>      12 import numpy as np
> ---> 13 import scipy.special as spec
>      14 import math
>      15
>
> /Library/Python/2.6/site-packages/scipy/special/__init__.py in <module>
> ()
>       6 #from special_version import special_version as __version__
>
>       7
> ----> 8 from basic import *
>       9 import specfun
>      10 import orthogonal
>
> /Library/Python/2.6/site-packages/scipy/special/basic.py in <module>()
>       6
>       7 from numpy import *
> ----> 8 from _cephes import *
>       9 import types
>      10 import specfun
>
> ImportError: dlopen(/Library/Python/2.6/site-packages/scipy/special/
> _cephes.so, 2): no suitable image found.  Did find:
>        /Library/Python/2.6/site-packages/scipy/special/_cephes.so: mach-o,
> but wrong architecture
>
> -------------------------
>
> Another thing that I did is change the gnu.py in Numpy because it was
> suggested, but that didnt work:
> I changed line 261 from ["ppc","i686","x86_64"] to ["x86_64", "i686"]
> ------
> I have the build log in a pastebin @ http://pastebin.com/d67ac1a9e

It looks like we are not passing any architecture flags to gfortran.
The default architecture appears to be i386 for gfortran but is x86_64
for the rest of Python. Your interpreter is starting up in 64-bit mode
and expecting all of its shared libraries to be 64-bit, too, but the
Fortran ones aren't.

Please show us the output of the following the following:

$ gfortran -arch x86_64 -v

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
SciPy-User mailing list
SciPy-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user

Re: scipy on snow leopard

I played around with the problem today and I still didnt get it to  
work. I have http://hpc.sourceforge.net/ gfortran installed now and I  
get the following output with your command:

gfortran -arch x86_64 -v
Using built-in specs.
Target: i386-apple-darwin9.7.0
Configured with: ./configure --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.4.1 20090623 (prerelease) (GCC)

hope that helps
    WOlfgang
On 01/09/2009, at 20:11 , Robert Kern wrote:

> gfortran -arch x86_64 -v
Robert Kern | 1 Sep 23:28
Picon
Gravatar

Re: scipy on snow leopard

On Tue, Sep 1, 2009 at 16:13, Wolfgang
Kerzendorf<wkerzendorf <at> googlemail.com> wrote:
> I played around with the problem today and I still didnt get it to
> work. I have http://hpc.sourceforge.net/ gfortran installed now and I
> get the following output with your command:
>
> gfortran -arch x86_64 -v
> Using built-in specs.
> Target: i386-apple-darwin9.7.0

We're looking for "Target: i686-...." on this line. Try changing line
21 in gnu.py from this:

    "x86_64": r"^Target: (i686-.*)$",

to this:

    "x86_64": r"^Target: (i[36]86-.*)$",

I highly recommend using the gfortran builds from
http://r.research.att.com/tools/, though. The hpc.sf.net ones are very
difficult to work with. They are frequently buggy, built strangely,
and they do not have version numbers attached to the tarballs, so it
makes debugging installation problems with them incredibly difficult.

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

Re: scipy on snow leopard

I used the compiler you suggested and changed the lines in gnu.py, but  
I still get:

mithrandir:special wkerzend$ file _cephes.so
_cephes.so: Mach-O bundle i386

thats in the build dir.

On 01/09/2009, at 23:28 , Robert Kern wrote:

> On Tue, Sep 1, 2009 at 16:13, Wolfgang
> Kerzendorf<wkerzendorf <at> googlemail.com> wrote:
>> I played around with the problem today and I still didnt get it to
>> work. I have http://hpc.sourceforge.net/ gfortran installed now and I
>> get the following output with your command:
>>
>> gfortran -arch x86_64 -v
>> Using built-in specs.
>> Target: i386-apple-darwin9.7.0
>
> We're looking for "Target: i686-...." on this line. Try changing line
> 21 in gnu.py from this:
>
>    "x86_64": r"^Target: (i686-.*)$",
>
> to this:
>
>    "x86_64": r"^Target: (i[36]86-.*)$",
>
> I highly recommend using the gfortran builds from
> http://r.research.att.com/tools/, though. The hpc.sf.net ones are very
> difficult to work with. They are frequently buggy, built strangely,
> and they do not have version numbers attached to the tarballs, so it
> makes debugging installation problems with them incredibly difficult.
>
> -- 
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> SciPy-User mailing list
> SciPy-User <at> scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

Gmane