-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Cross-compilation. #158
Comments
@ethanhs Thanks for your report. LIBM is handled here: python-cmake-buildsystem/cmake/ConfigureChecks.cmake Lines 336 to 343 in ea9cc39
To help improving the python-cmake-buildsystem to work for Android, there is this project: https://github.com/kylemanna/docker-aosp It should help document and reproduce the steps leading to the error. |
@jcfr thanks for the quick response! I forgot libm was a thing, so perhaps it just isn't linking to Python period? Also, I'm not entirely sure how the repo you linked to relates to cross compiling for Android. I'm trying to compile using the cmake toolchain an android armeabi build of Python, not AOSP itself. |
Good point. Since you are using only the NDK, it is not related.
At that point, I don't know. Currently travelling (vacation) until middle of next week ... I don't have time to investigate further. Ideally, it would be nice to have set of steps allowing to reproduce the problem. |
Okay, I am building based off of these changes (I know this isn't very clean if I make a PR I will restart from a clean pull and follow the guidlines). Anyway, I then ran ~/python-cmake-android$ mkdir -p python-build && mkdir -p python-install
~/python-cmake-android$ cd python-build
~/python-cmake-android$ /home/ethanhs/Android/Sdk/cmake/3.6.3155560/bin/cmake .. -G"Android Gradle - Ninja" -DANDROID_ABI=armeabi -DANDROID_NDK=/home/ethanhs/Android/Sdk/ndk-bundle -DCMAKE_INSTALL_PREFIX=../python_install -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/home/ethanhs/Android/Sdk/cmake/3.6.3155560/bin/ninja -DCMAKE_TOOLCHAIN_FILE=/home/ethanhs/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=21 -DCMAKE_CXX_FLAGS=-std=c++11 -DPYTHON_VERSION=3.5.2 -DENABLE_CODECS_JP=OFF -DENABLE_CODECS_KR=OFF -DENABLE_CODECS_TW=OFF -DENABLE_MULTIBYTECODEC=OFF -DENABLE_CODECS_CN=OFF -DENABLE_CODECS_HK=OFF -DENABLE_CODECS_ISO2022=OFF Then I ran ~/python-cmake-android$ /home/ethanhs/Android/Sdk/cmake/3.6.3155560/bin/ninja -v Note the cmake paths and sdk paths etc just point to defaults for Android Studio install. |
I am very interested in getting this to work as a method to compile for android. Currently, with only a few minor patches, it seems to be almost there, however the extensions seem not to be linking to libpython.
Based on the log below, it would appear that
-lm
in the command means that Python's library name is not being handled correctly when cross compiling. I can't really find where the script handles this. Any assistance would be appreciated.LOG:
The text was updated successfully, but these errors were encountered: