[Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

Arthur Bousquet arthbous at indiana.edu
Fri Sep 25 15:08:47 EDT 2009


Ok, so I re-compiled python (without framework), numpy,... So I can compile
my lib (libsw) now, bu I can't called it from python. I got this error :

Arths-MacBook-Pro:run_1 arthbous$ ./run.sh
Traceback (most recent call last):
  File "../main.py", line 23, in <module>
    import libsw as lsw
ImportError: dlopen(/Users/arthbous/Documents/SW/sw-v2.3/libsw.so, 2): no
suitable image found.  Did find:
    /Users/arthbous/Documents/SW/sw-v2.3/libsw.so: mach-o, but wrong
architecture

It seems to compile for the wrong architecture. Do you know about this ?

Thank you.

- Arthur

On Fri, Sep 25, 2009 at 2:53 PM, Robert Kern <robert.kern at gmail.com> wrote:

> On Fri, Sep 25, 2009 at 13:43, Arthur Bousquet <arthbous at indiana.edu>
> wrote:
> > Thank you a lot for your help. So I deleted as you said, but then I do
> with
> > --enable-framework for python, at the make there is an error :
> >
> > ln -fsn 2.6 Python.framework/Versions/Current
> > ln -fsn Versions/Current/Python Python.framework/Python
> > ln -fsn Versions/Current/Headers Python.framework/Headers
> > ln -fsn Versions/Current/Resources Python.framework/Resources
> > gcc  -u _PyMac_Error Python.framework/Versions/2.6/Python -o python.exe \
> >             Modules/python.o \
> >              -ldl
> > ld: warning: in Python.framework/Versions/2.6/Python, file is not of
> > required architecture
> > Undefined symbols:
> >   "_PyMac_Error", referenced from:
> >   "_Py_Main", referenced from:
> >       _main in python.o
> > ld: symbol(s) not found
> > collect2: ld returned 1 exit status
> > make: *** [python.exe] Error 1
> >
> > Do you know why I have this ?
>
> You may need some patches from Apple in order to compile Python for
> the (now-default) x86_64 CPU architecture. There may be configure
> flags to only use x86, though. You will have to check the --help and
> read the documentation. I'm afraid that is about all I know on the
> subject; I have not upgraded to Snow Leopard, yet, or attempted to
> build Python on it.
>
> > And also does "export
> > MACOSX_DEPLOYMENT_TARGET=10.6" is necessary ?
>
> Quite possibly.
>
> --
> 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
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090925/e0ae2388/attachment.html>


More information about the NumPy-Discussion mailing list