[SciPy-user] Building 64-bit binaries, OS 10.5.6

Dan Yamins dyamins@gmail....
Sun Apr 19 15:17:08 CDT 2009


(Sorry if this was posted multiple times...)

I'm trying to build scipy 64bit binaries.  I'm on OS10.5.6, and using
python2.6 built as 64bit universal from macports.

When I run:
    python2.6 setup.py install

the build doesn't fail along the way.

However, when I then go into python and try something, e.g. "from scipy
import linalg",  I get the error:

Python 2.6.2 (r262:71600, Apr 18 2009, 15:53:12)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy import linalg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/linalg/__init__.py",
line 8, in <module>
    from basic import *
line 17, in <module>
    from lapack import get_lapack_funcs
line 17, in <module>
    from scipy.linalg import flapack
2): no suitable image found.  Did find:

no matching architecture in universal wrapper

Evidently flapack.so has not been build as a 64bit.    Why is this, and how
do I solve it?


-----Below are some more details from my own investigation of the problem,
for those interested in helping:

If I run


this yields the output:

Mach-O universal binary with 2 architectures
(for architecture ppc7400):    Mach-O bundle ppc
(for architecture i386):    Mach-O bundle i386

So obviously it really isn't built right.

Now, I think I see when this is happening.  If I look back at the output
during the building of scipy, I see commands like:

usr/local/bin/gfortran -Wall -arch ppc -arch i686 -Wall -undefined
dynamic_lookup -bundle
-Lbuild/temp.macosx-10.5-universal-2.6 -lgfortran -o
build/lib.macosx-10.5-universal-2.6/scipy/linalg/_flinalg.so -Wl,-framework

e.g. the fortran compiler is not being given the flag -arch x86_64  (though
reading the output shows that the C compiler IS.)

Morevoer, if I do:
   python2.6 setup.py config_fc --help-fcompiler

then the output is:

  archiver        = ['/usr/local/bin/gfortran', '-cr']
  compile_switch  = '-c'
  compiler_f77    = ['/usr/local/bin/gfortran', '-Wall', '-ffixed-form', '-
                    fno-second-underscore', '-arch', 'ppc', '-arch', 'i686',
                    -fPIC', '-O3', '-funroll-loops']
  compiler_f90    = ['/usr/local/bin/gfortran', '-Wall', '-fno-second-
                    underscore', '-arch', 'ppc', '-arch', 'i686', '-fPIC',
                    O3', '-funroll-loops']
  compiler_fix    = ['/usr/local/bin/gfortran', '-Wall', '-ffixed-form', '-
                    fno-second-underscore', '-Wall',
                    '-arch', 'ppc', '-arch', 'i686', '-fPIC', '-O3',

So I have three questions:

A) is this lack of proper flag to the fortran compiler the reason my flapack
is not being build properly?
B) If so, how do I change the compiler options to the fortran compiler when
I run setup.py?
C) If not, what is the reason, and what do I do about it?

Thanks for reading this long thing ,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20090419/296a344d/attachment.html 

More information about the SciPy-user mailing list