Skip to content

Conversation

@RedInJector
Copy link
Contributor

 * moved OpenBLAS compilation logic to compile_OpenBLAS macro.
@conradsnicta
Copy link
Contributor

conradsnicta commented Apr 9, 2025

I'm not sure if compiling OpenBLAS is in-scope for mlpack. It's a separate problem, as OpenBLAS is an external library.

Adding the compilation step as part of mlpack installation would set up an unreasonable expectation for handling an external project. This adds to the maintenance burden, where this burden is unnecessary.

Precompiled OpenBLAS binaries can always be obtained from:

Armadillo also comes with precompiled OpenBLAS for Windoze:

PS. If really necessary, I think a better solution would be to simply include precompiled OpenBLAS as part of mlpack, just like Armadillo. There would be no brittleness with compilation and all the associated maintenance mess.

@rcurtin
Copy link
Member

rcurtin commented Apr 9, 2025

It's necessary for simplifying the cross-compilation process at least---hence the auto-downloader and auto-OpenBLAS-compiler (it's been there since I think 2021?). That also means that we can't include a precompiled version, since we don't know what architecture we need it for. I haven't had a chance to fully review this PR yet (should be able to tomorrow morning) but the changes looked good to me.

@RedInJector
Copy link
Contributor Author

Maybe we can simply link blas from armadillo then? And no compilation needed at all... On x64 at least.
Didn't really strike my head before.

Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @RedInJector! Just a couple very small comments from my side. This is definitely something that we should add as it will ease at least the cross-compilation process on Windows as well as some other situations.

To @conradsnicta's comment, @shrit originally wrote fetch_mlpack() as a way to automatically configure mlpack for a cross-compilation environment, where you would need a specifically-compiled BLAS version, and where bundling it wouldn't work.

In general I would suggest the use of the system's package manager, if possible (maybe I should have said this in #3920, sorry about that), since that is more well-suited for getting the correct dependencies for the correct architecture and so forth. On Windows this would be vcpkg I guess (they generally keep the mlpack package up to date). I wonder if a good solution here to minimize confusion but still keep fetch_mlpack() as an option that can be used outside the cross-compilation context is to:

removed unnecessary generator checks
Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RedInJector! Feel free to add your name to COPYRIGHT.txt and add a note to HISTORY.md (I'll update HISTORY.md before merge if you don't get to it). I am trying to debug the github actions that is supposed to post this automatically for first-time contributors, but if you want mlpack stickers to put on your laptop, send a mailing address to [email protected] and we'll get some in the mail for you.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second approval provided automatically after 24 hours. 👍

@rcurtin rcurtin merged commit 381dcce into mlpack:master Apr 14, 2025
4 of 5 checks passed
@rcurtin
Copy link
Member

rcurtin commented Apr 14, 2025

Thanks again @RedInJector!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants