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

Accelerate BLAS Preset for macOS #436

Closed
ibinti opened this issue Jun 28, 2017 · 11 comments
Closed

Accelerate BLAS Preset for macOS #436

ibinti opened this issue Jun 28, 2017 · 11 comments

Comments

@ibinti
Copy link

ibinti commented Jun 28, 2017

I wonder if javacpp can bind macOS Frameworks. If so, please consider adding BLAS in Accelerate Framework.

@ibinti ibinti changed the title Accelerate BLAS Presets for macOS Accelerate BLAS Preset for macOS Jun 28, 2017
@ibinti
Copy link
Author

ibinti commented Jun 28, 2017

It should be doable as the macOS frameworks are basically a bundle of header files and respective dynamic libraries. And Accelerate BLAS are written in C, not Objective-C/C++ or swift.
On my macOS 10.12.5, the headers and *.dylib are located in /System/Library/Frameworks/Accelerate.framework/versions/A/Frameworks/vecLib.framework/Versions/A

@ibinti
Copy link
Author

ibinti commented Jun 28, 2017

javacpp jni library should be written as framework in order to be more useful (at least to me).

@saudet
Copy link
Member

saudet commented Jun 28, 2017 via email

@ibinti
Copy link
Author

ibinti commented Jul 14, 2017

@saudet I am going to try it myself. Could you give me some more directions if possible?

@saudet
Copy link
Member

saudet commented Jul 14, 2017 via email

@ibinti
Copy link
Author

ibinti commented Jul 16, 2017

BLAS and LAPACK presets seem working.
I checked BLAS function cblas_dgemm and the multiplication result is correct.
There is no issue finding jni library if I put javacpp-presets jars in the lib.
But if I try to use from mavenLocal, then it complains like:

java.lang.UnsatisfiedLinkError: no jniblas in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1122)
        at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:976)
        at org.bytedeco.javacpp.Loader.load(Loader.java:777)
        at org.bytedeco.javacpp.Loader.load(Loader.java:684)
        at org.bytedeco.javacpp.accelerate.<clinit>(accelerate.java:10)
        at ExampleDGEMMrowmajor.main(ExampleDGEMMrowmajor.java:118)

What could be the reason?

@saudet
Copy link
Member

saudet commented Jul 16, 2017

Well then it's obviously not in the class path.

@ibinti
Copy link
Author

ibinti commented Jul 16, 2017

Both accelerateblas-1.0.0-1.3.3-SNAPSHOT.jar and accelerateblas-1.0.0-1.3.3-SNAPSHOT-macosx-x86_64.jar are in the local maven repo. But strangely, preset jar does not find its accompanying jni jar.

@saudet
Copy link
Member

saudet commented Jul 16, 2017

Are you sure it's not SIP preventing you from loading things?

@ibinti
Copy link
Author

ibinti commented Jul 16, 2017

It was indeed not in the class path, after all.
I simply missed the classifier macosx-x86_64 in my gradle dependencies.
Now I think this issue can be closed.

@saudet
Copy link
Member

saudet commented Feb 2, 2018

Marking as duplicate of #444.

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

No branches or pull requests

2 participants