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

Enable non-standard OpenBLAS extensions v2 #1572

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

blueberry
Copy link
Contributor

The second try of the #1571
The macos build passed, so I'm opening the PR so you can see whether it now works with the changes you suggested (mapCommon).

I've tried to build everything on my machine, but the openblas build fails (independently of this change) due to some LLVM error that is probably related to some mismatch in I-don-t-know-which combination of native compilers, so I couldn't reach the Java gen stage and see how the final opencl_java class looks like. That's why I'm opening this PR. (btw I've tried the docker way too, as per JavaCPP guide, but then some internal docker stuff didn't work. I couldn't solve it right now).

@blueberry
Copy link
Contributor Author

FYI the following fail was due to a download (networking) fail, not related to the relevant code itself.

openblas / macosx-x86_64 (pull_request)

@saudet
Copy link
Member

saudet commented Jan 27, 2025

I think I got it working. Could you check that the functions you want are all there?

@blueberry
Copy link
Contributor Author

As soon as it appears in the snapshot repo (or is there a way to check right now?)

@saudet
Copy link
Member

saudet commented Jan 27, 2025

@blueberry
Copy link
Contributor Author

I checked for a few of them and they are present. I'll test how they work when they appear in the snapshot repo, but I don't see why they wouldn't!.

Thanks!

@saudet
Copy link
Member

saudet commented Jan 27, 2025

Nope, it doesn't look like it's going to work that easily...

@blueberry
Copy link
Contributor Author

blueberry commented Jan 27, 2025

Why? (the failing build is due to a download issue, if you are referring to that)

@blueberry
Copy link
Contributor Author

blueberry commented Jan 27, 2025

I see what you mean now.
However, it seems that only a small-ish subset of functions is not declared and is causing trouble.

As a first, step, maybe it would be good if we just skipped these functions.

As a second step, it seems that the cause is some misconfiguration between what should be prefixed with LAPACK_ vs LAPACKE_

Fox example, LAPACK_sgerfsx can be found in Opelblas source, just as LAPACKE_sgerfsx, in connection with the header lapacke_utils.h, which is not included in JavaCPP OpenBLAS build. Maybe including this would be enough?

@blueberry
Copy link
Contributor Author

My latest version passes the build phase, I just don't know where to look for the generated Java class to check whether everything is really there.

@saudet
Copy link
Member

saudet commented Jan 29, 2025

I've updated the files, but you could set CI_DEPLOY_USERNAME and CI_DEPLOY_PASSWORD to get the files deployed to your Sonatype OSSRH account:
https://github.com/bytedeco/javacpp-presets/blob/master/.github/workflows/openblas.yml

@blueberry
Copy link
Contributor Author

Nope, the functions are not there. Maybe we should just duplicate the code, instead of inheriting, or we should have a plain base class with common methods, and then inherit independent classes openblas_nolapack and openblas_full from it?...
I don't have a clue what's going on in the internals to be able to fix this in an elegant way.

@saudet
Copy link
Member

saudet commented Jan 29, 2025

You can do whatever you want, but if your hack is hard to maintain, and you are not there to maintain it, I will simply disable it when it breaks on the next release.

@blueberry
Copy link
Contributor Author

I will maintain it, and I will try to improve it when I learn more JavaCPP (which I plan to do in a few months). But it even won't be a hack, it will just be a bit repetitive.

@blueberry
Copy link
Contributor Author

Of course, if you can offer some hints about what could be a cause of these methods not being in the generated code, that would help me a lot.

@saudet
Copy link
Member

saudet commented Jan 29, 2025

If it's repetitive code, then just use methods and variables, etc. I will not merge anything that we can obviously simplify in the first place

@saudet
Copy link
Member

saudet commented Jan 29, 2025

Start here: https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes

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

Successfully merging this pull request may close these issues.

2 participants