-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Linking installed OpenBLAS libraries in FreeBSD #3006
Comments
Additional Information Looking at the source code
|
Looks as if it "knows" to load other libraries that OpenBLAS depends on when jblas is installed on Windows or Linux, but does not |
Thanks so much @martin-frbg Your comment is very helpful but now I can't figure out what libname (string) should I use as argument in the NativeBlasLibraryLoader.class Using
In modifying the NativeBlasLibraryLoader.class with the additional conditions
I can't figure out what
|
Yes, I would try it like that - if it does not work, you can always try adding the version number (libquadmath-0 and libgfortran-5) as in the entries for the other operating systems. Possibly you will also need loadLibrary lines for the libgcc_s and/or libgomp, libthr as well. |
Obvious that Linux compatibility layer will not cross-breed FreeBSD ELF with Linux ELF. If you target compat (like having Linux Oracle JDK), you need Linux OpenBLAS and supporting library packages (CentoS 7 version can be acquired from Fedora EPEL https://fedoraproject.org/wiki/EPEL) |
Did not see the JDK version mentioned so was assuming OpenJDK which I believe is available as a native build for *BSD |
Yes @martin-frbg its FreeBSD's OpenJDK8
Also, to add further context I am not a native Java programmer I was trying to using the jblas library from Clojure. It was working fine until I noticed the error while calling the matrix multiplication function Here's further evidence of the installed OpenJDK
|
It would be beneficial to clean out linux compat tree. You are loading jblas.so from
|
Perhaps running |
|
Yes it will be helpful to know what libraries that are "needed" but I could not figure it out so I used the crude method of trying to load the libraries (mentioned above) as
I continue to get the error. Having spent considerable time just so I can use matrix multiplication (i.e I even tried creating my own openblas interface but I got stuck at calling the native functions. I went in thinking the native functions are in For instance
Once OpenBlas is installed how do I access the native functions via the JVM?Your manual describes the
Rather than (re)compile the source, How can I access |
The developer manual describes how the call is handled within OpenBLAS, which should be irrelevant to calling it from your code. The user manual has examples for calling the C interface (cblas_dgemm) or the Fortran interface (dgemm_) that used to be |
I just learned that the question I posed above is a problem of Foreign Function Interface: in java this is done with API's like JNI or JNR-FFI. However, if I were to use the native methods of OpenBLAS in Clojure (via java) with the project setup as
and then run
What do you think of placing
|
No, please do not copy individual source files from OpenBLAS, this is not going to work. Use the regular API - your Mygemm wrapper should call the cblas_dgemm function that is in libopenblas. |
Gotcha! I just want to get my numerical simulations to work. I am just fishing for the most optimal solution :-) It sounds like pointing to the
ought to provide access to all the the BLAS and LAPACK functions (for instance, cblas_dgemm). |
Could you run |
Since jblas is installed as a dependency in Clojures' So I don't know if if it's even possible to run The dependencies defined inside the
|
You need to use |
I see ...
And probably do (in place of the strike through lines above) something like
But what about this
Doesn't this mean that my installed OpenBLAS library path - presumably |
I think the problem should be resolved over time around there: |
Thanks for cross linking this thread, more information on here. So first of all, jblas has only been tested on Linux, Windows and Mac, so I am not surprised it doesn't work with freebsd. Second of all, you can also try it with configure --dynamic-libs. This does not try to link in static files but expects files to sit in the operating system. If you have an openblas installation that works, this should also work. Getting to --static-libs, that is, copying all the necessary libraries into the jar would then be the next step. Above you asked what the libname is, but that is OS dependent, so I also don't know how it works with freebsd. Sorry I cannot be of more help! |
Thank you for taking over, we were getting nuts already that nothing works, kudos for instant fix at other thread. |
OS:
FreeBSD 12.1-RELEASE r354233 GENERIC amd64
OpenBLAS:
0.3.10,1
jblas: 1.2.5
Using
mmul
function in jblas returnsI presume it is because jblas is unable to link with the installed OpenBLAS libraries (
pkg info -lx openblas
)Could somebody help me how I should link the installed OpenBLAS library?
The text was updated successfully, but these errors were encountered: