-
-
Couldn't load subscription status.
- Fork 486
openblas: refactor with cmake #8445
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
Conversation
Summary of ChangesHello @choyy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is an excellent refactoring of the OpenBLAS package, moving from a complex Makefile-based build to a unified CMake-based approach. This greatly simplifies the package script, improves maintainability, and expands build options for users. My review includes a couple of suggestions to enhance the robustness of the new configuration options by programmatically handling their inter-dependencies. This will help prevent invalid build configurations and improve the overall user experience.
|
remove old versions, it will break some user projects. |
Successful at all versions: others failed at certain version. Though I suggest keeping it like this for now. |
|
|
||
| if is_plat("windows") then | ||
| if is_arch("x64", "x86_64") then | ||
| add_urls("https://github.com/OpenMathLib/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version)-x64.zip") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you keep the previous version and just add the new version, it will not trigger all version checks. In addition, why remove the win binary package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the binary and source-build? How to choose when add package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use binary for win
| end | ||
| end | ||
| make.build(package, configs) | ||
| make.make(package, table.join("install", "PREFIX=" .. package:installdir():gsub("\\", "/"), configs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lower versions should not support cmake, so we need to choose the build tool based on the package version.
Only when all ci passes can it be merged |
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the OpenBLAS package to use CMake for source builds, particularly for versions 0.3.30 and newer. It introduces a comprehensive set of new configuration options to control the CMake build and adds several pre-build checks to improve the user experience. The changes are generally good, but I've identified a critical issue in an on_install selector that will break all source builds. I've also noted a couple of medium-severity issues regarding future maintenance and a potentially breaking change in default configurations. Please address the critical issue to ensure the package remains buildable.
packages/o/openblas/xmake.lua
Outdated
| local fortran = find_tool("gfortran") | ||
| if fortran then | ||
| table.insert(configs, "FC=" .. fortran.program) | ||
| on_install("windows|!x64 and windows|!x86", function (package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The selector for this on_install block, "windows|!x64 and windows|!x86", is invalid and will prevent source builds on any platform. It appears the intention is to handle all source builds not covered by the pre-built Windows binary installation.
To fix this, you should use a generic on_install block. This will act as a fallback for any platform/architecture combination that doesn't match the more specific on_install("windows|x64", "windows|x86", ...) block, which is the correct pattern for this scenario.
on_install(function (package)
| add_configs("openmp", {description = "Compile with OpenMP enabled.", default = false, type = "boolean"}) | ||
| add_configs("fortran", {description = "Compile with fortran enabled.", default = false, type = "boolean"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default values for the openmp and fortran configurations have been changed from being enabled by default on most platforms (not is_plat("macosx")) to being disabled by default (false). This is a potentially breaking change for users who were relying on the previous behavior for versions older than 0.3.30. While this might be intentional to align with OpenBLAS's own default configuration, it's a significant change that might surprise users.
| os.cp(path.join("bin", "libopenblas.dll"), package:installdir("bin")) | ||
| os.cp("include", package:installdir()) | ||
| if package:version():ge("0.3.28") then | ||
| if package:version():eq("0.3.28") then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using package:version():eq("0.3.28") is less future-proof than ge("0.3.28"). If a future version of the pre-built OpenBLAS for Windows (e.g., 0.3.31) follows the same file layout as 0.3.28 (with libopenblas.lib at the root of the archive), this condition will fail, and the installation will break. Using ge would be more robust, assuming this new layout is the standard going forward for pre-built binaries.
if package:version():ge("0.3.28") then
No description provided.