简体   繁体   中英

How to use Android NDK to compile Numpy as .so?

Because the Numpy isn't a static library(it contains .py files, .pyc files, .so files, etc), so if I want to import it to my python code which is used in an Android phone(using CLE), I should recompile the library as a .so file. I have found that if I want to use NDK to compile it, I should have an Application.mk and an Android.mk files. But I don't know how to create these files.

How can I compile the Numpy library or anyone could give me a useful website.

Thanks a lot.

I should have an Application.mk and an Android.mk files.

This is the older way of Android JNI programming, the current recommended style is to use CMake for NDK development.

If you just want a working example and do modification based on it, then you can find one from here: https://github.com/russell-shizhen/JniExample

I should recompile the library as a .so file

In order to recompile, you need its source code for sure. Without source code, you can only try to link those existing static libs to form your own .so lib.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM