Skip to content

Simplify LAPACK and LAPACKE integration in CMake - #6258

Open
Growl1234 wants to merge 7 commits into
OpenMathLib:developfrom
Growl1234:cmake
Open

Growl1234 wants to merge 7 commits into
OpenMathLib:developfrom
Growl1234:cmake

Conversation

@Growl1234

Copy link
Copy Markdown

This PR consolidates LAPACK source selection in the OpenBLAS build. It shares one routine list between the C and Fortran implementations and reuses the bundled Netlib lists for LAPACKE, with OpenBLAS-specific adjustments in the outer CMake rules.

  • Apply LAPACK compile definitions to the targets that use them and scope the ReLAPACK linker option to the shared library.
  • Keep the installed LAPACK and LAPACKE headers consistent with the configured integer ABI, including in cross-builds.
  • Register each LAPACK driver test once with CTest and use the matching GESVJ test source for each precision.

Map the Fortran routines to their C counterparts for C_LAPACK and omit
the Fortran-only modules. Include the existing C QZ routines and the
OpenBLAS headers used by the C random-number routines.
Read the Netlib lists in a local scope and account for the OpenBLAS
source differences in the outer build. Select optional wrappers by
precision and expose the existing matrix-generator option.
Keep the LAPACK, LAPACKE and ReLAPACK C definitions on their
targets. Preserve default symbol visibility for the public C
interfaces with the existing directory-wide compiler flags.
Pass the multiple-definition option to the target link step using
the compiler driver's linker-option syntax.
Define USE64BITINT in the cross-build configuration. Generate the
two installed LAPACKE headers that select the ILP64 ABI from the
bundled headers, and use the bundled mangling header for LP64.
Reuse the bundled driver targets and input runner from a small
OpenBLAS test directory. Select cases by driver availability and
use the matching GESVJ sources.
@Growl1234

Copy link
Copy Markdown
Author

Hi, is there any response?

@martin-frbg

Copy link
Copy Markdown
Collaborator

I'd like to postpone this until after the 0.3.35 release - it looks cleaner but doesn't appear to offer any immediate benefit while changing the build system for anyone already familiar with the current layout.

@Growl1234

Copy link
Copy Markdown
Author

Thanks. To share some context, the current CMake build has accumulated quite a bit of duplicated logic and ad hoc handling of compiler flags, dependencies, and build options. This makes it harder to maintain and keep its behavior consistent with the Makefile-based build.

Starting with this PR, I hope to gradually simplify and modernize the CMake build and improve its robustness. The eventual goal is to support the same functionality and range of build configurations as the Make-based build, so more users and downstream projects can confidently choose CMake to build OpenBLAS. I'm also doing some similar improvements for lapack and scalapack.

@martin-frbg

Copy link
Copy Markdown
Collaborator

Certainly, but to the maintainer there are also advantages to knowing the build system however baroque it has grown. And changing fundamental parts of it fairly close to a release that is already full of functional changes feels like a particularly bad idea. Besides, there is already a draft PR for realigning the CMake build options with the Makefile ones

@Growl1234

Copy link
Copy Markdown
Author

Yes, we can certainly leave this until after the upcoming release. The CMake cleanup will be a longer-term effort, especially given the scale of the OpenBLAS build system.

This branch has not been deployed

No deployments
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.

2 participants