Restore missing prototypes for deprecated LAPACK functions#367
Conversation
Some LAPACK functions prototypes were inadvertedly dropped in 3.9.0. As a consequence, LAPACKE has several unresolved symbols. Closes Reference-LAPACK#365
|
Thanks @svillemot |
Codecov Report
@@ Coverage Diff @@
## master #367 +/- ##
=======================================
Coverage 81.86% 81.86%
=======================================
Files 1863 1863
Lines 181008 181008
=======================================
Hits 148174 148174
Misses 32834 32834Continue to review full report at Codecov.
|
|
may you mark them deprecated either by moving them into a separate header |
| lapack_int* info ); | ||
|
|
||
| #define LAPACK_sggsvd LAPACK_GLOBAL(sggsvd,SGGSVD) | ||
| lapack_int LAPACKE_sggsvd( int matrix_layout, char jobu, char jobv, char jobq, |
There was a problem hiding this comment.
Shoudn't this be LAPACK_sggsvd instead of LAPACKE_sggsvd?
There was a problem hiding this comment.
there are two decl:
-Fortran callable from C
-The C plaster or the memory copies and transposes everywhere frontend.
There was a problem hiding this comment.
I don't know the codebase well, but I presume the plaster is e.g. lapacke_sggsvd_work that does the transposing etc. while the actual C-to-Fortran wrapper is lapacke_sggsvd.
However, by that same argument, the group of [cdsz]geqpf-functions above should also be declared with LAPACKE_... but aren't (even though the have the same structure). From an outside POV, it would make sense that lapack.h refers to LAPACK-functions, not LAPACKE?
There was a problem hiding this comment.
Yes surely (except the first paragraph which is plain wrong); however; it's a compatibility restore; was this way before; the best way would be to declare
#define LAPACK_DEPRECATED
LAPACK_DEPRECATED
#define LAPACK_dggsvd LAPACK_GLOBAL(dggsvd,DGGSVD)
lapack_int LAPACKE_dggsvd (int matrix_layout, char jobu, char jobv, char jobq, lapack_int m, lapack_int n, lapack_int p, lapack_int *k, lapack_int *l, double *a, lapack_int lda, double *b, lapack_int ldb, double *alpha, double *beta, double *u, lapack_int ldu, double *v, lapack_int ldv, double *q, lapack_int ldq, lapack_int *iwork);
for reference -> https://github.com/Reference-LAPACK/lapack/blob/master/LAPACKE/src/lapacke_sggsvd.c#L36
then calling its worker which finally calls the true Fortran-C binding (global intrinsic); was the original spaghetti design; not me-self; just iterating facts and being rational.
…ons [cdsz]ggsv[dp] These functions were inadvertently removed before 3.9.0 and readded by Reference-LAPACK#367. However, some of the LAPACK-functions in lapack.h were declared as LAPACKE-functions (which also have a different signature than their LAPACK-counterparts), which leads (at least) to the compiler emitting a [-Wimplicit-function-declaration] warning and not knowing which function to choose: [...]/LAPACKE/src/lapacke_cggsvp_work.c: In function 'LAPACKE_cggsvp_work': [...]/LAPACKE/include/lapack.h:3761:37: warning: implicit declaration of function 'cggsvp_'; did you mean 'cggsvp3_'? [-Wimplicit-function-declaration] #define LAPACK_cggsvp LAPACK_GLOBAL(cggsvp,CGGSVP) ^ [...]/LAPACKE/include/lapacke_mangling.h:12:39: note: in definition of macro 'LAPACK_GLOBAL' #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ ^~~~~~ [...]/LAPACKE/src/lapacke_cggsvp_work.c:52:9: note: in expansion of macro 'LAPACK_cggsvp' LAPACK_cggsvp( &jobu, &jobv, &jobq, &m, &p, &n, a, &lda, b, &ldb, &tola, ^~~~~~~~~~~~~ Here, we align the declarations in lapack.h with their callsites in the various LAPACKE_[cdsz]ggsv[dp]_work functions again. For more discussion see conda-forge/lapack-feedstock#32 Suggested-By: Isuru Fernando <isuruf@gmail.com>
Restore missing prototypes for deprecated LAPACK functions
Some LAPACK functions prototypes were inadvertedly dropped in 3.9.0. As a
consequence, LAPACKE has several unresolved symbols.
Closes #365