<div dir="ltr"><div><div><div><div><div>Looks like you are already head of my reply: My first guess was to wonder if the Python library is linked in. Are you compiling a shared python library as well? Or linking a static Python library into the NumPy library?<br><br></div>No clue about your current problem.<br><br></div>If you want to static link NumPy, it is quite easy .... you are already almost there if you are creating a shared library. The trick is to intercept the shared libarary build process and create a static library in its place as NumPy does not build static libraries. I've attached the file to do this. To use it, I set this environment variable in my makefile when compiling NumPy.<br><br></div>LDSHARED=shared_to_static<br><br></div>Good luck!<br><br></div>David<br><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 11:17 PM, Robert Kent <span dir="ltr"><<a href="mailto:rob@gulon.co.uk" target="_blank">rob@gulon.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi David,<br>
<br>
Great minds think alike, I just actually took a step further by
codesigning the module! Now I get a new error!<span class=""><br>
<br>
<tt>File ":/imp.py", line 243, in load_module</tt><tt><br>
</tt></span><tt>ImportError:
dlopen(/var/mobile/Containers/Bundle/Application/E6DF5582-0426-4D83-815B-4862ABDACCB9/SpruceApp.app/<a href="http://numpy.core.multiarray.so" target="_blank">numpy.core.multiarray.so</a>,
2): Symbol not found: _PyBool_Type</tt><tt><br>
</tt><tt>15B-4862ABDACCB9/SpruceApp.app/<a href="http://numpy.core.multiarray.so" target="_blank">numpy.core.multiarray.so</a></tt><tt><br>
</tt><tt> Expected in: flat namespace</tt><tt><br>
</tt><tt> in
/var/mobile/Containers/Bundle/Application/E6DF5582-0426-4D83-815B-4862ABDACCB9/SpruceApp.app/<a href="http://numpy.core.multiarray.so" target="_blank">numpy.core.multiarray.so</a></tt><tt><br>
</tt><tt>Process 492 exited with status = 1 (0x00000001)</tt><br>
<br>
This looks like I failed to link something...<br>
<br>
Anyway, I tried the static method and failed miserably, as in I
managed to compile NumPy and make a libnumpy.a which I then linked
against the application (via the LIBS variable in the .pro file),
but python couldn't find (or didin't try to load/know about) the
module. I would really appreciate a write up of this as I think this
may very well be the answer for me too, thank you.<br>
<br>
I'm doing this with NumPy 1.9.3 as well, also manually patched.<br>
<br>
Thanks you very much indeed,<br>
<br>
Rob<div><div class="h5"><br>
<br>
<div>On 04/05/2016 17:11, David Morris
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>Rob,<br>
<br>
</div>
While iOS does support dynamic modules as of version 8,
that support is extremely limited compared to most
platforms. I have not experimented with it yet, however
my understanding that dynamic modules must be compiled as
a framework (not just a shared library) and must be
properly signed, just like an app.<br>
<br>
</div>
For myself, I just compile NumPy as a static library
compiled directly into the executable. I can write up a
description of how I did this if you are interested ....<br>
<br>
</div>
Out of curiosity, are you using the latest version of NumPy?
(1.11) What did it take to get it compiled for iOS? I am
running version 1.9.3, but had to patch a few files. I
haven't looked into more recent versions yet, but suspect
patching is necessary still ... ?<br>
<br>
</div>
David<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, May 4, 2016 at 10:56 PM, Robert
Kent <span dir="ltr"><<a href="mailto:rob@gulon.co.uk" target="_blank">rob@gulon.co.uk</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So, here I
go again!<br>
<br>
Having successfully built my app and NumPy and (bits of)
SciPy for Android, I am now trying it on iOS... And having
my usual struggle with understanding how to build/load
extension modules. I have managed to compile NumPy for iOS
and have the necessary .so files. I add them to the bundle
and then run the app and I get the following traceback:<br>
<br>
File ":/imp.py", line 243, in load_module<br>
ImportError:
dlopen(/var/mobile/Containers/Bundle/Application/9AA43814-71DA-4544-993B-B783D83CB5B1/TestApp.app/<a href="http://numpy.core.multiarray.so" rel="noreferrer" target="_blank">numpy.core.multiarray.so</a>, 2): no
suitable image found. Did find:<br>
5B1/TestApp.app/<a href="http://numpy.core.multiarray.so" rel="noreferrer" target="_blank">numpy.core.multiarray.so</a>: mmap() error
1 at address=0x0471E000, size=0x000DC000 segment=__TEXT in
Segment::map() mapping
/var/mobile/Containers/Bundle/Application/9AA43814-71DA-4544-993B-B783D83CB5B1/TestApp.<br>
Process 475 exited with status = 1 (0x00000001)<br>
<br>
I have no idea what this is telling me! It obviously finds
image, tries to load it and fails.<br>
<br>
Has anyone had any success is building and loading extension
modules with pyqtdeploy for iOS or any ideas on where to go
from here. I'm guessing I've compiled something incorrectly
but I have no idea what/how.<br>
<br>
All help gratefully received,<br>
<br>
Rob<br>
_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div>