python3-android
python3-android copied to clipboard
Non pure-python libraries?
would like to know what's the step to port numpy as well?
This may be worth a try:
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_aarch64-linux-android PYTHONHOME=$HOME/Projects/python3-android/build/target/python/usr python3.7 setup.py build_ext
Change architecture names and paths to fit your needs.
For more information, see https://bugs.python.org/issue28833
thanks! I wonder why the other packages (like the ncurses, openssl, readline, etc.) are not so complicated as the numpy, are they not "third-party extension modules"? Sorry I am new to this, looks like cross compiling numpy is kind of complicated.
Tried this: _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_aarch64-linux-android PYTHONHOME=~/python.armv8/python3-android.GRRedWings/build/15c-22-aarch64-linux-android-clang python3.5 setup.py build_ext
Got error:
File "setup.py", line 386, in
I can build python and other modules (like readline) without problem. The PYTHONHOME is set to the output of cross compiled python output, right?
wondering if I need to cross compile the setuptools?
Gosh, you hit another Python-related bug (#3): pip & setuptools doesn't work well with cross-builds. I may be able to fix them in this repo.
The PYTHONHOME is set to the output of cross compiled python output, right?
Yep. Most likely you'll get an error like "unable to import 'encodings'" when PYTHONHOME is wrong.
Another reason for this error may be that _PYTHON_SYSCONFIGDATA_NAME requires 3.6 or above.
I wonder why the other packages (like the ncurses, openssl, readline, etc.) are not so complicated as the numpy, are they not "third-party extension modules"?
You got it. Third-party extensions depend on Python's build system distutils, which does not support cross-builds well. On the other hand, ncurses, openssl, readline are excellent in supporting cross-builds.
Looks like things get more complicated. I wonder if you can take a look at numpy? If you can get this working on 3.7 (e.g. this git) that would be great...
I installed setuptools package on my ubuntu (16.04) host, added PYTHONPATH=/usr/lib/python3/dist-packages:$PYTHONPATH, so whole command is this: _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_aarch64-linux-android PYTHONHOME=~/python.armv8/python3-android.GRRedWings/build/15c-22-aarch64-linux-android-clang PYTHONPATH=/usr/lib/python3/dist-packages:$PYTHONPATH python3.5 setup.py build_ext
I got this error:
Running from numpy source directory.
Traceback (most recent call last):
File "setup.py", line 386, in
All the _ctypes.so that I found in the whole system are under python2.7, for example: ~/python.armv8/python3-android.GRRedWings/sdk/android-ndk-r15c/prebuilt/linux-x86_64/lib/python2.7/lib-dynload/_ctypes.so ~/python.armv8/python3-android.GRRedWings/build-tools/15c-22-aarch64-linux-android-clang/lib/python2.7/lib-dynload/_ctypes.so
Well, setuptools and pip shouldn't import ctypes (or any built-in extension modules) unconditionally... https://bugs.python.org/issue31652
This looks like a long term project. I don't think I can finish it in a few weeks.
All the _ctypes.so that I found in the whole system are under python2.7, for example:
Actually it tried to load the ARM version of _ctypes and failed.
I was expecting days, not weeks, looks like I underestimated the numpy :(
That's not numpy's problem, but the whole Python's. Its cross-builds support is never in a good shape.
As a side note, building modules for Android is also discussed in https://bugs.python.org/issue28833.
i had already seen this issue but didn't tried it i will try it