pyodide/packages/scipy/patches/fix-implicit-cast-args-from...

24 lines
2.5 KiB
Diff

We are hijacking dfft.f to inject missing functions from future versions of LAPACK.
This patch is applied to the generated dfft.c after f2c is applied to dfft.f.
This must be done in between when f2c is applied to dfft.f and when dfft.c is compiled.
This is arranged in _f2c_fixes.py.
f2c does not correctly handle implicit casts of function arguments. If the implicit casts
are between integer types then we can handle that automatically in _f2c_fixes.py. This
patch fixes implicit casts from char* to int, which we need to deal with manually.
--- a/scipy/linalg/src/id_dist/src/dfft.c
+++ b/scipy/linalg/src/id_dist/src/dfft.c
@@ -12998,3 +12977,10 @@ f"> */
} /* ztpqrt_ */
+
+typedef struct { float real, imag; } npy_complex64;
+typedef struct { double real, imag; } npy_complex128;
+int sorcsd_(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, char *signs, int *m, int *p, int *q, float *x11, int *ldx11, float *x12, int *ldx12, float *x21, int *ldx21, float *x22, int *ldx22, float *theta, float *u1, int *ldu1, float *u2, int *ldu2, float *v1t, int *ldv1t, float *v2t, int *ldv2t, float *work, int *lwork, int *iwork, int *info){ return 0; }
+int dorcsd_(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, char *signs, int *m, int *p, int *q, double *x11, int *ldx11, double *x12, int *ldx12, double *x21, int *ldx21, double *x22, int *ldx22, double *theta, double *u1, int *ldu1, double *u2, int *ldu2, double *v1t, int *ldv1t, double *v2t, int *ldv2t, double *work, int *lwork, int *iwork, int *info){ return 0; }
+int zuncsd_(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, char *signs, int *m, int *p, int *q, npy_complex128 *x11, int *ldx11, npy_complex128 *x12, int *ldx12, npy_complex128 *x21, int *ldx21, npy_complex128 *x22, int *ldx22, double *theta, npy_complex128 *u1, int *ldu1, npy_complex128 *u2, int *ldu2, npy_complex128 *v1t, int *ldv1t, npy_complex128 *v2t, int *ldv2t, npy_complex128 *work, int *lwork, double *rwork, int *lrwork, int *iwork, int *info){ return 0; }
+int cuncsd_(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, char *signs, int *m, int *p, int *q, npy_complex64 *x11, int *ldx11, npy_complex64 *x12, int *ldx12, npy_complex64 *x21, int *ldx21, npy_complex64 *x22, int *ldx22, float *theta, npy_complex64 *u1, int *ldu1, npy_complex64 *u2, int *ldu2, npy_complex64 *v1t, int *ldv1t, npy_complex64 *v2t, int *ldv2t, npy_complex64 *work, int *lwork, float *rwork, int *lrwork, int *iwork, int *info){ return 0; }