Skip to content
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

wrong protototype for LAPACK_lsame? #545

Closed
2 tasks
stefanozampini opened this issue May 3, 2021 · 3 comments · Fixed by #699
Closed
2 tasks

wrong protototype for LAPACK_lsame? #545

stefanozampini opened this issue May 3, 2021 · 3 comments · Fixed by #699

Comments

@stefanozampini
Copy link

Description
both MKL and BLIS define lsame as
lsame( const char* ca, const char* cb...)
while this code uses
same( char* ca, char* cb..

diff --git a/LAPACKE/include/lapack.h b/LAPACKE/include/lapack.h
index a70352acd..efc7068e7 100644
--- a/LAPACKE/include/lapack.h
+++ b/LAPACKE/include/lapack.h
@@ -115,7 +115,7 @@ typedef lapack_logical (*LAPACK_Z_SELECT2)
     ( const lapack_complex_double*, const lapack_complex_double* );
 
 #define LAPACK_lsame LAPACK_GLOBAL(lsame,LSAME)
-lapack_logical LAPACK_lsame( char* ca,  char* cb,
+lapack_logical LAPACK_lsame( const char* ca,  const char* cb,
                               lapack_int lca, lapack_int lcb );

Checklist

  • I've included a minimal example to reproduce the issue
  • I'd be willing to make a PR to solve this issue
@weslleyspereira
Copy link
Collaborator

Hi @stefanozampini. I believe lsame( const char* ca, const char* cb...) is the most appropriate interface. Would you like to propose a PR with the changes?

I looked at OpenBLAS for curiosity. They use lsame( char* ca, char* cb...) - https://github.com/xianyi/OpenBLAS/blob/develop/kernel/generic/lsame.c

@ivan-pi
Copy link
Contributor

ivan-pi commented Aug 8, 2022

For the record, problems encountered by BLIS due to differing const attributes and duplicate inclusion of the prototype are documented here: flame/blis#145 (see posts closte to flame/blis#145 (comment)).

@martin-frbg
Copy link
Collaborator

Makes sense to me - the non-const lsame in OpenBLAS mentioned by weslleyspereira above is unchanged from the 2009 GotoBLAS2 and was certainly chosen to match the netlib LAPACK at that time.

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

Successfully merging a pull request may close this issue.

4 participants