Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Native/system BLAS on Android #83

Open
ibrahima opened this issue May 15, 2015 · 3 comments
Open

Native/system BLAS on Android #83

ibrahima opened this issue May 15, 2015 · 3 comments

Comments

@ibrahima
Copy link

Hi, I'm wondering how I might go about using netlib-java or its derivatives with native libraries on Android and if you had any tips. I see that you've ported it to Raspberry Pi so that seems promising for Android, but since you usually don't have a build environment on Android itself we have to cross compile, which makes things complicated. I've tried the braindead step of just grabbing ARM versions of libblas.so and liblapack.so from Ubuntu repos (I guess using ATLAS) and sticking them in /system/lib but this doesn't work. Do I need gfortran as well? Do you have any suggestions on how to debug the JNI native library loading process so I can see what it's doing? I'm trying to see if I can do something cool with breeze on Android and the F2J implementation works for now but obviously it's much slower than I'd want to actually use for a proper app.

Thanks!

@fommil
Copy link
Owner

fommil commented May 16, 2015

Android isn't real java so I honestly don't know. You might be best doing some performance tests first of DGEMM in Java and then from a C app just to get an idea of the potential benefits to see if it is worthwhile. RPi was worth it because java was really slow at the time but Google might have invested a lot in making their virtual machine really good.

@ibrahima
Copy link
Author

Well, I don't know how "real" Android's Java is but it does support JNI. I did manage to get openblas built for Android so I'll try and see how DGEMM performance looks for F2J vs the native implementation. My initial test of some random matrix code was like 1000x slower on Android vs PC so I figured there must be some performance to be gained by using a native implementation but I guess comparing Broadwell vs Snapdragon is never going to be a close comparison. I tried sticking openblas in the library directory symlinked to libblas.so.3 but it doesn't seem to load correctly without really telling me why (it loads fine when I force it to load via System.loadLibrary()). I might want to rebuild the JNI library but I get errors like the following when attempting to use maven to compile:

[ERROR] Plugin com.github.fommil.netlib:generator:1.2-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.github.fommil.netlib:generator:jar:1.2-SNAPSHOT: Failure to find com.github.fommil.netlib:generator:pom:1.2-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-plugins-snapshots has elapsed or updates are forced -> [Help 1]

How should I go about building netlib-java?

@fommil
Copy link
Owner

fommil commented Jun 22, 2015

It's documented in the pom files. Sorry, it's quite a painful process and honestly I'm only going to dive into it on a commercial basis because it's not something that I need.

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

No branches or pull requests

2 participants