yan12125 / python3-android

Python 3 cross-compilation tools for Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding pyenv instructions and use it in .travis.yml (was: why this needs python 3.7?)

springishere opened this issue · comments

I am using ubuntu 16.04 and it comes with python 3.5, however make failed.
I see that python 3.7 is only in alpha, can I just use 3.6 instead?

That's a limitation of CPython. If you want to cross build Python x.y (ex: for Android), you need a working Python x.y for the building machine first. This repo targets Python 3.7 on Android, so you need Python 3.7.

There's a great alternative https://github.com/GRRedWings/python3-android, which creates a stable version of Python on Android, and it builds the necessary corresponding Python for the building machine automatically.

So, if I have python3.5 installed on my ubuntu PC, I can use the cpython?
I tried to modify your code to compile but had some issues (PosixPath).
I wonder if I can just follow your source to do step by step in console, or if there's step by step instruction (versus using a script/makefile).

Regarding the alternative, I did check out and compile without problem, however once I push the python binary to target I get error:
"./python3": error: only position independent executables (PIE) are supported.

The whole package does not have -pie in it, so I wonder if it's really tested or not. On the contrary, your package has this flag, but I am not able to use it due to I only have 3.5 on my ubuntu. I also installed 3.6 but have problem using that due to multiarray problem from numpy. I am not against going to 3.7 if numpy can be ported as well.

This repository once contained a recipe to build python 3.7 for the building machine, yet it's removed due to difficulty in maintenance. I may be able to add it back.

Currently, you can try this:

git clone https://github.com/python/cpython
cd cpython
./configure --prefix=$HOME/python-3.7
make
make install
export PATH="$HOME/python3.7/bin:$PATH"

Thanks! I have the python 3.5 working on my ARM target (a samsung phone), I managed to fix the pie issue (added another patch file to add this ld option).
My problem now is the numpy, all deep learning python scripts use this so I need to get this working.
So if numpy can be port under 3.5 then I am fine with it.

Done in 2f70d39. Maintaining host build of Python 3.7 is really a too big work. Let's recommend users useful package managers with python3.7 packages.