Link to OpenBLAS on Linux#806
Merged
Merged
Conversation
Link `EigenSystem` against OpenBLAS on Linux to mirror the Accelerate/vecLib backend on Apple (PR solvcon#768). Changes include: - CMake: optional `find_library(openblas)` defines `MM_HAS_VENDOR_LAPACK`; the `APPLE` branch defines the same. - Add a new file `cpp/modmesh/linalg/lapack_compat.hpp` to abstract the compatibility layer for BLAS/LAPACK. - Source and binding guards switch from `__APPLE__` to `MM_HAS_VENDOR_LAPACK`. - Unit-testing skips on `mm.EigenSystem is None` instead of `sys.platform != "darwin"`. - CI: add `libopenblas-dev` to the Linux apt-get list. For issue solvcon#804.
yungyuc
commented
May 23, 2026
| sudo apt-get -qy install kitware-archive-keyring | ||
| sudo apt-get -qy install \ | ||
| sudo curl git build-essential make cmake libc6-dev gcc g++ \ | ||
| libopenblas-dev \ |
Member
Author
There was a problem hiding this comment.
Use OpenBLAS on Linux for now.
| { | ||
|
|
||
| #ifdef __APPLE__ | ||
| #ifdef MM_HAS_VENDOR_LAPACK |
Member
Author
There was a problem hiding this comment.
Use a clearer fencing. Move platform abstration in the macro.
| #ifdef __APPLE__ | ||
| using lapack_int_t = __LAPACK_int; | ||
| #else | ||
| using lapack_int_t = int; |
| // NOLINTNEXTLINE(misc-header-include-cycle) | ||
| #include <Accelerate/Accelerate.h> | ||
| #else // __APPLE__ | ||
| extern "C" void dgeev_( |
Member
Author
There was a problem hiding this comment.
For non-Apple platform, use the distinct declaration for now. It should be enhanced to use upstream header in the future, when we use more LAPACK subroutines in the future (e.g., for issue #790).
|
|
||
| @unittest.skipUnless(sys.platform == "darwin", | ||
| "mm.EigenSystem requires Apple vecLib") | ||
| @unittest.skipIf(mm.EigenSystem is None, |
Member
Author
There was a problem hiding this comment.
Use the existence of EigenSystem to detect instead of platform.
Member
Author
|
@ThreeMonth03 @KHLee529 @tigercosmos @chestercheng please help take a look. |
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link
EigenSystemagainst OpenBLAS on Linux to mirror the Accelerate/vecLib backend on Apple (PR #768). Changes include:find_library(openblas)definesMM_HAS_VENDOR_LAPACK; theAPPLEbranch defines the same.cpp/modmesh/linalg/lapack_compat.hppto abstract the compatibility layer for BLAS/LAPACK.__APPLE__toMM_HAS_VENDOR_LAPACK.mm.EigenSystem is Noneinstead ofsys.platform != "darwin".libopenblas-devto the Linux apt-get list.For issue #804.