Skip to content

Add GET_{BLAS,LAPACK}_LIBNAME - #1481

Open
mohawk2 wants to merge 4 commits into
Reference-LAPACK:masterfrom
mohawk2:get-libname
Open

mohawk2 wants to merge 4 commits into
Reference-LAPACK:masterfrom
mohawk2:get-libname

Conversation

@mohawk2

@mohawk2 mohawk2 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

As discussed on #1446, this is a separate PR to add the ability for BLAS and LAPACK implementations to identify themselves in a human-consumable way, with string-returning routines. It builds on the branch from that PR, and will be left as draft until that is merged to avoid confusion.

From the Fortran side, it implements:

  • GET_BLAS_LIBNAME
  • GET_LAPACK_LIBNAME

In C:

  • cblas_get_libname
  • LAPACKE_get_libname

Those wishing to see only the parts unique to this PR can use this link: https://github.com/mohawk2/lapack/compare/iblaver...get-libname?expand=1

Checklist

  • The documentation has been updated.
  • If the PR solves a specific issue, it is set to be closed on merge - N/A

@mohawk2
mohawk2 marked this pull request as draft November 7, 2026 23:14
@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.69231% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.63%. Comparing base (ef55c9b) to head (97d760c).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
CBLAS/src/cblas_get_libname.c 30.76% 6 Missing and 3 partials ⚠️
LAPACKE/src/lapacke_get_libname.c 18.18% 6 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1481   +/-   ##
=======================================
  Coverage   70.63%   70.63%           
=======================================
  Files        6243     6247    +4     
  Lines      501290   501369   +79     
  Branches    23516    23522    +6     
=======================================
+ Hits       354100   354164   +64     
- Misses     146327   146336    +9     
- Partials      863      869    +6     
Components Coverage Δ
BLAS 99.73% <100.00%> (+<0.01%) ⬆️
CBLAS 96.79% <30.76%> (-0.16%) ⬇️
LAPACK 83.73% <100.00%> (+<0.01%) ⬆️
LAPACKE 4.19% <18.18%> (+<0.01%) ⬆️
TMGLIB 55.69% <ø> (ø)
BLAS testing 88.80% <100.00%> (+0.01%) ⬆️
CBLAS testing 89.65% <100.00%> (+<0.01%) ⬆️
LAPACK testing 82.40% <100.00%> (+<0.01%) ⬆️
LAPACKE testing ∅ <ø> (∅)
Files with missing lines Coverage Δ
BLAS/SRC/get_blas_libname.f90 100.00% <100.00%> (ø)
BLAS/TESTING/cblat1.f 92.85% <100.00%> (+0.03%) ⬆️
BLAS/TESTING/cblat2.f 85.51% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/cblat3.f 90.99% <100.00%> (+<0.01%) ⬆️
BLAS/TESTING/dblat1.f 93.41% <100.00%> (+0.02%) ⬆️
BLAS/TESTING/dblat2.f 85.41% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/dblat3.f 89.47% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/sblat1.f 94.26% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/sblat2.f 85.41% <100.00%> (+0.01%) ⬆️
BLAS/TESTING/sblat3.f 89.47% <100.00%> (+0.01%) ⬆️
... and 19 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef55c9b...97d760c. Read the comment docs.

@mohawk2 mohawk2 mentioned this pull request Nov 8, 2026
2 tasks done
@mohawk2
mohawk2 force-pushed the get-libname branch 2 times, most recently from 1bab251 to b9b102a Compare November 8, 2026 03:12
@mohawk2
mohawk2 force-pushed the get-libname branch 2 times, most recently from 02f03ab to 662dea0 Compare November 19, 2026 14:30
@mohawk2
mohawk2 marked this pull request as ready for review November 19, 2026 14:31
@mohawk2

mohawk2 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@ACSimon33 @langou Marked as ready for review, and rebased against latest master if you have capacity to take a look :-)

@mohawk2

mohawk2 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@ACSimon33 @langou Rebased after various recent merges.

@martin-frbg

Copy link
Copy Markdown
Collaborator

I wonder if the documentation part of this function could/should specify how entries in this free-form name string are delimited ? As to my narrow frog-eyed view this is basically a reimplementation of openblas_get_config(), I'd like to see a single space as a legal delimiter of a simple enumeration, but ease of parsing in different languages might make an argument for something else like semicolon, fancy braces or key=value pairs ?

@mohawk2

mohawk2 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

@martin-frbg My current vision is that this is absolutely independent of any config settings, and is just intended to provide human information; hence I'm calling it "libname". I'm not sure how generally useful such a config-getting function would be; is it a "thing" for any other BLAS(-like)?

@ACSimon33

Copy link
Copy Markdown
Collaborator

To me a config getter would actually be more useful, I think. When I'm linking with MKL for example, I'm usually aware that it is MKL so just getting the library name would gain me nothing. But if it would contain more information about how it was built (is it serial, parallel, does it use vector instructions, which compiler was used, etc.), that are informations that are not that obvious from the outside.

@mohawk2

mohawk2 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

How about if I specify it's a sequence of space-separated words, with the first "word" being the name of the library (e.g. "Reference-LAPACK", and any further "words" would be individual config items?

@ACSimon33

Copy link
Copy Markdown
Collaborator

Yes, it makes sense to me to have the library name first. One issue might be if the library name itself contains spaces. MKL for example, has mkl_get_version_string which returns:

Intel(R) oneAPI Math Kernel Library Version 2026.2-Product Build 20260915 for Intel(R) 64 architecture applications

AOCL's FLA_Get_AOCL_Version returns:

AOCL-LAPACK 6.0.0       Build 20261026, supports LAPACK 3.12.1 w/o Index-64 interfaces

I can understand that they might want to use the full name, so just requiring the name at the start of the string might be better. |

We also might want to define an upper limit for the length of the string (something like 512 or 1024 chars). Then linking the test suite with other libs doesn't run over CHARACTER*30 LIBNAME.

@mohawk2

mohawk2 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@ACSimon33 I'm starting to think it's best to have a separate GET_*_LIB_NAME and GET_*_LIB_CONFIG (which adds a _ and I'm very OK with that). The first would just be human-readable, and the second would be defined as space-separated "words".

My feeling about a maximum length is not to restrict it for either, but to add a second output full_length parameter, so the user could call it again with a suitable-length buffer if there were truncation, and in any case would actually know for sure.

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.

3 participants