patmarion / NumpyBuiltinExample

An example program that embeds Python and NumPy using static linking and frozen modules.
15 stars 2 forks source link

_ctypes #4

Open sahilsuneja1 opened 6 years ago

sahilsuneja1 commented 6 years ago

When I run helloFrozen test.py, it lists _ctypes as being read as .so. Is this to be expected?

sahilsuneja1 commented 6 years ago

Btw, pretty cool stuff, I ported it to work for Python-3.5 as well.

patmarion commented 6 years ago

Hi, thanks for your comment. I haven't worked on this project in several years, so I am not sure why that would happen. Ideally, no .so files should be loaded dynamically. It's possible that _ctypes needs to be added to this file for newer versions of python:

https://github.com/patmarion/NumpyBuiltinExample/blob/master/files/Setup.local

Thanks for porting it to Python-3.5. If your work is available on github, maybe you could post a link to it here? It's possible others will look for a python3 example and could benefit!

sahilsuneja1 commented 6 years ago

Thanks. I am using the same version of numpy and python as is included in this repo (the tars), but still get the same dynamic loading behaviour for ctypes. I got it to work by enabling _ctypes static build in Setup.local, and statically building libffi, and linking to it during the hello/helloFrozen build process. I'll add the link to Python-3.5 counterpart, once I put it github. Thanks again for this!