Skip to content
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

Fixing wrong use of ar when building numpy #414

Closed
wants to merge 2 commits into from

Conversation

dl1ksv
Copy link
Contributor

@dl1ksv dl1ksv commented Jul 10, 2015

numpy does not build ( see issue 409 ).

#409

Though the correct version of ar is found

Found executable /usr/bin/gfortran
Found executable /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
Found executable /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
Found executable /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib

the build process uses ar instead of arm-linux-androideabi-ar.

I fixed this by using $AR which is set by distribute.sh

In addition I found that lapack_lite.so and some other libs require linking against libm.so when running on android-21.

I fixed this, too.

@inclement
Copy link
Member

This patch seems good in principle, but I had some issues with it. It's possible that they're related to how I tried it though (with the new p4a toolchain):

  • I don't think the patch files were quite the right format, though I'm not sure how this works - I had to add the a/ b/ thing in the diff names and change the filenames they referred to.
  • Setting the ar executable to $AR didn't work for me, I had to set it directly, even accessing the env var with python didn't work
  • The numpy build still doesn't work for me (on my main system - it works in a VM with nothing else installed) - maybe it's another similar issue.

I'll keep testing, or this seems good to merge if someone else can confirm it works.

Can you or anyone else confirm that this patch definitely works as it stands?

@dl1ksv
Copy link
Contributor Author

dl1ksv commented Jul 14, 2015

If you are in the numpy build directory , you can apply the patches witth
patch -p0
like this is done in the modified numpy/recipes.sh

I'm working on recipes for gnuradio which requires numpy.
In this context I tested the patched version of numpy and it works.

@inclement
Copy link
Member

I got it working (including further fixes) using the patch set at https://github.com/kivy/python-for-android/tree/revamp/pythonforandroid/recipes/numpy/patches, which includes the one from this issue (but a modified patch file) plus another to stop numpy trying to pull in system libraries.

I still haven't tested this specific PR, but it looks good to me if someone else (or me when I get time) can run the build to check.

@dl1ksv
Copy link
Contributor Author

dl1ksv commented Jul 15, 2015

It cleanly compiles with this patch set.

@inclement
Copy link
Member

I didn't merge this only because I'm not sure about hardcoding 'arm-linux-androideabi-ar' - can anyone on OS X comment on whether this is the correct binary name there?

@kaanaksit
Copy link

This one worked like a charm! Thanks @dl1ksv !

@inclement
Copy link
Member

I've merged this into the old_toolchain branch. Thanks for the fixes, and sorry for the delay with it - I'm still worried about this not working on osx, but since nobody ever commented about it let's just fix it for everyone on linux at least (and maybe it works on osx anyway).

@Vivaldo-Roque
Copy link

Vivaldo-Roque commented Mar 5, 2019

Sorry I'm newbie how do I apply this patch to work with opencv?

@AndreMiras
Copy link
Member

You ask on support channel https://github.com/kivy/python-for-android#support

@Vivaldo-Roque
Copy link

No, but I'm going to ask now. thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants