I built it against <b>Python 2.5.1.<br><br>compile:</b><br>gcc -c -I/usr/lib/python2.5/site-packages/numpy-1.0.4.0002-py2.5-linux-x86_64.egg/numpy/core/include -I/usr/bin/python/2.5.1/include/python2.5 -fPIC -fno-omit-frame-pointer -pthread -fexceptions -ansi -D_GNU_SOURCE -DMX_COMPAT_32 -g main.c<br>
<br>compile line for the other c-file is identical to main.c's<br><br><b>link:</b><br>gcc -g -pthread -shared main.o module.o -L/usr/bin/python/2.5.1/lib <b>-lpython2.5</b> -ldl -lm -lpthread -lutil -lmx -lmex -lmat -lm -lm -lstdc++<br>
<br><br><div class="gmail_quote">On Tue, Jan 13, 2009 at 12:00 AM, Michael Abshoff <span dir="ltr"><<a href="mailto:michael.abshoff@googlemail.com">michael.abshoff@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Igor Sylvester wrote:<br>
<br>
Hi Igor,<br>
<div><div></div><div class="Wj3C7c"><br>
> Has anyone had problems with dynamically loading PyExc_IOError when<br>
> embedding a cython module?<br>
> While calling init below:<br>
><br>
> *in main.c:<br>
> *void init {<br>
> Py_Initialize();<br>
> initmymodule();<br>
> do_somethind();<br>
> Py_Finalize();<br>
> }<br>
><br>
> *in module.c:*<br>
> cdef public void do_something():<br>
> import<br>
> exceptions<br>
><br>
> print exceptions.IOError # this prints <type 'exceptions.IOError'>,<br>
> so I don't know what to make of the error below<br>
> import numpy # exception is thrown here, and numpy library is in<br>
> pythonpath<br>
><br>
> Exception:<br>
> Exception exceptions.ImportError:<br>
> '/usr/lib/python2.5/lib-dynload/time.so: undefined symbol:<br>
> PyExc_IOError' in 'mymodule.myfunction' ignored<br>
><br>
> I'm not yet sure which library in numpy causes the exception but this<br>
> example is easy to reproduce.<br>
<br>
</div></div>How did you build the extension, i.e. did you link against python2[3|4|5] ?<br>
<br>
<br>
> Thanks.<br>
> Igor<br>
<br>
Cheers,<br>
<br>
Michael<br>
<br>
> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Cython-dev mailing list<br>
> <a href="mailto:Cython-dev@codespeak.net">Cython-dev@codespeak.net</a><br>
> <a href="http://codespeak.net/mailman/listinfo/cython-dev" target="_blank">http://codespeak.net/mailman/listinfo/cython-dev</a><br>
<br>
_______________________________________________<br>
Cython-dev mailing list<br>
<a href="mailto:Cython-dev@codespeak.net">Cython-dev@codespeak.net</a><br>
<a href="http://codespeak.net/mailman/listinfo/cython-dev" target="_blank">http://codespeak.net/mailman/listinfo/cython-dev</a><br>
</blockquote></div><br>