-
Notifications
You must be signed in to change notification settings - Fork 12
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
OSX Big Sur: Is it possible to use the Accelerate framework BLAS? #6
Comments
As a follow-up, after further investigation I believe this is a "bug" in the JDK. Netlib uses System.loadLibrary (or System.load) to load the dynamic library (for BLAS, etc.), which in turn does exactly what the Big Sur release notes say not to do (e.g. checks for the existence of the library file on the filesystem and fails if not found). I submitted a bug report via bugs.java.com but not sure how responsive they are to these reports. We'll see. I have verified that attempting to load the library via dlopen even if the library file is not visible on the filesystem works fine. |
I also attempted to use OpenBlas installed via Homebrew (had to set JAVA_LIBRARY_PATH=/usr/local/opt/openblas/lib) and that seems to bypass (at least a bit) the problem with System.loadLibrary (since the libblas.dylib exists in the filesystem), but still fails with a weird error:
I wasn't able to get farther than this... I tried moving
No idea what else to try. |
Hi @borice , it's a good idea to support Accelerate and generally The way I would tackle it is to add a Thank you again! |
The JDK bug report was accepted and has been assigned a tracking ID. |
Any chance this could get some attention? The JDK bug has been fixed. |
If you could expand just slightly on your description above on how to do this, @luhenry, then I could give it a try. |
@oscar-broman hi, sorry for the late reply! The approach would be similar to JNIBlas.java:
In order to add support for CBLAS, I expect the easiest way is in modifying the generated jni.c file. To change it, you want to modify generator.py to generate the right code for each BLAS calls. This file is very self-contained and a pretty crude template generator, but it does the limited job at hand here. Let me know if you have any other questions, I'll be very happy to answer them! |
I've gotten this to work without the need for What approach would you suggest? |
@oscar-broman we can absolutely have a runtime check based on the platform and load a different library based on that. So on |
There bundled libraries (e.g. I didn't actually make it work for the Accelerate framework, but rather compiled openblas and modified |
I have gotten blas and lapack working using the accelerate framework (using apple's fortran bindings), but I opted to not use dynamic linking. Instead I just compile link an alternative set of C sources with the accelerate framework. However, this required an update to the makefiles and pom itself. I'm keen to work out the best approach to merging this functionality into this repo, if there is a wider interest. |
It is of interest for sure! |
OSX Big Sur no longer ships with copies of the libraries on the filesystem so the option
dev.ludovic.netlib.blas.nativeLibPath
can't be used to point to veclib'slibBLAS.dylib
, etc.Is there currently a way (or a plan) to make netlib work on OSX Big Sur (and later)? Thank you.
The text was updated successfully, but these errors were encountered: