Does Numba or Cython work with kivy?

293 views
Skip to first unread message

李颖雄

unread,
Jul 6, 2016, 10:13:02 AM7/6/16
to Kivy users support
Hi, I am pretty new to kivy and I am trying to build an App which involves solving large linear systems with sparse matrix. At the moment SciPy does not work on smartphone with kivy, so I wrote my own pure-python-solver. It is of course much slower than SciPy, I managed to accelerate it with Numba. Does anyone have experience using Numba with kivy?

If Numba doesn't work, I think I can also use Cython, is it complicated to use Cython with kivy?

Thank you in advance.

Alexander Taylor

unread,
Jul 6, 2016, 11:03:03 AM7/6/16
to Kivy users support
Using Cython is easy. Kivy itself uses Cython heavily.

Using Numba might be possible, but I wouldn't be surprised if it's either very hard or impractical, and I don't know how the technical platform and architecture differences affect whether numba can run. Unless it turns out to be simple or actively supported by Numba, I wouldn't aim for this option on Android.

Kent Borg

unread,
Jul 6, 2016, 12:26:27 PM7/6/16
to kivy-...@googlegroups.com
On 07/06/2016 11:03 AM, Alexander Taylor wrote:
> Using Cython is easy.

So easy, that I can't find any documentation that says how. I am sure it
is a one-liner, if it were a couple pages I would find it.

How do I put my own Cython files in a Kivy project?

Thanks,

-kb

Bill Janssen

unread,
Jul 6, 2016, 9:01:45 PM7/6/16
to Kivy users support
How you use it depends on what you want to do.  With buildozer, you'd write a recipe to call Cython on your package and install it.  There are existing Buildozer recipes you can copy. Maybe https://github.com/kivy/python-for-android/tree/master/pythonforandroid/recipes/numpy would be an appropriate recipe to look at.
Reply all
Reply to author
Forward
0 new messages