Collapse multiple submodules to one Cython extension
This setup.py:
This setup.py:
I want to call a C library from a Python application. I don’t want to wrap the whole API, only the functions and datatypes that are relevant to my case. As I see it, I have three choices:
Following this answer to “Can I force a numpy ndarray to take ownership of its memory?” I attempted to use the Python C API function PyArray_ENABLEFLAGS through Cython’s NumPy wrapper and found it is not exposed.
I’m trying to compile a python extension with cython in win 7 64-bit using mingw (64-bit).
I’m working with Python 2.6 (Active Python 2.6.6) and with the adequate distutils.cfg file (setting mingw as the compiler)
The Cython documentation on typed memory views list three ways of assigning to a typed memory view:
I know what Cythons purpose is. It’s to write compilable C extensions in a Python-like language in order to produce speedups in your code. What I would like to know (and can’t seem to find using my google-fu) is if Cython can somehow compile into an executable format since it already seems to break python code down into C.
I’m trying to use dot products, matrix inversion and other basic linear algebra operations that are available in numpy from Cython. Functions like numpy.linalg.inv (inversion), numpy.dot (dot product), X.t (transpose of matrix/array). There’s a large overhead to calling numpy.* from Cython functions and the rest of the function is written in Cython, so I’d like to avoid this.
I want to wrap a test project containing C++ and OpenMP code with Cython, and build it with distutils via a setup.py file. The content of my file looks like this:
I can’t get otherwise-available modules seen by a compiled python script. How do I need to change the below process in order to accept either venv-based or global modules?
I’m trying to speed up the answer here using Cython. I try to compile the code (after doing the cygwinccompiler.py hack explained here), but get a fatal error: numpy/arrayobject.h: No such file or directory...compilation terminated error. Can anyone tell me if it’s a problem with my code, or some esoteric subtlety with Cython?