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

DM-40066: Rename lapack_stub symbols to avoid clashes with third-party libraries. #9

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/homo.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void psf_homo(psfstruct *psf, char *filename, double *homopsf_params,
#endif
#elif defined(HAVE_CLAPACK) || defined(HAVE_LAPACK_STUB)
integer one = 1, info = 0, num = nfree;
dposv_("L", &num, &one, amat, &num, bmat, &num, &info);
dposv_internal("L", &num, &one, amat, &num, bmat, &num, &info);
if (info != 0)
#else
if (clapack_dposv(CblasRowMajor,CblasUpper,nfree,1,amat,nfree,bmat,nfree)!=0)
Expand Down
6 changes: 3 additions & 3 deletions src/lapack_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This code reproduces two of the functions of lapack with an implementation
using gsl. This allows the use of these functions without the need to link to
any fortran code. For compatibility, all of the same arguments are taken, but
some of the arguments may not be used. For instance dposv_ takes an argument U
some of the arguments may not be used. For instance dposv_internal takes an argument U
or L but will actually return the full solution, not simply the upper or
lower part.
*/
Expand All @@ -11,7 +11,7 @@
#include <gsl/gsl_errno.h>
#include <gsl/gsl_blas.h>

void dposv_(char *UPLO, long *N, long *NRHS, double *A, long *LDA, double *B, long *LDB, long *info)
void dposv_internal(char *UPLO, long *N, long *NRHS, double *A, long *LDA, double *B, long *LDB, long *info)
{
/*
Note:
Expand Down Expand Up @@ -89,7 +89,7 @@ void dposv_(char *UPLO, long *N, long *NRHS, double *A, long *LDA, double *B, lo
}


void dtrtri_(char *UPLO, char *DIAG, long *N, double *A, long *LDA, long *info)
void dtrtri_internal(char *UPLO, char *DIAG, long *N, double *A, long *LDA, long *info)
{
/*
Note:
Expand Down
4 changes: 2 additions & 2 deletions src/lapack_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
avoid a dependancy on anything fortran. the source can be found in src/clapack.c
*/

void dposv_(char *, long *, long *, double *, long *, double *, long *, long *);
void dposv_internal(char *, long *, long *, double *, long *, double *, long *, long *);

void dtrtri_(char *, char *, long *, double *, long *, long *);
void dtrtri_internal(char *, char *, long *, double *, long *, long *);
4 changes: 2 additions & 2 deletions src/psf.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ void psf_makeresi(psfstruct *psf, setstruct *set, int centflag,
#endif
#elif defined(HAVE_CLAPACK) || defined(HAVE_LAPACK_STUB)
integer one = 1, three = 3, info = 0;
dposv_("L", &three, &one, amat, &three, bmat, &three, &info);
dposv_internal("L", &three, &one, amat, &three, bmat, &three, &info);
if (info != 0)
#else
if (clapack_dposv(CblasRowMajor,CblasUpper,3,1,amat,3,bmat,3) != 0)
Expand Down Expand Up @@ -1133,7 +1133,7 @@ int psf_refine(psfstruct *psf, setstruct *set)
#endif
#elif defined(HAVE_CLAPACK) || defined(HAVE_LAPACK_STUB)
integer one = 1, info = 0, num = nunknown;
dposv_("L", &num, &one, alphamat, &num, betamat, &num, &info);
dposv_internal("L", &num, &one, alphamat, &num, betamat, &num, &info);
if (info != 0)
#else
if (clapack_dposv(CblasRowMajor,CblasUpper,nunknown,1,alphamat,nunknown,
Expand Down
4 changes: 2 additions & 2 deletions src/wcs/poly.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ int poly_solve(double *a, double *b, int n)
return clapack_dposv(CblasRowMajor, CblasUpper, n, 1, a, n, b, n);
#elif defined(HAVE_CLAPACK) || defined(HAVE_LAPACK_STUB)
integer one = 1, info = 0, num = n;
dposv_("L", &num, &one, a, &num, b, &num, &info);
dposv_internal("L", &num, &one, a, &num, b, &num, &info);
return info;
#else
return cholsolve(a,b,n);
Expand Down Expand Up @@ -742,7 +742,7 @@ void poly_initortho(polystruct *poly, double *data, int ndata)
poly->orthomat, ncoeff);
#elif defined(HAVE_CLAPACK) || defined(HAVE_CLAPACK_STUB)
integer info = 0, num = ncoeff;
dtrtri_("L", "N", &num, poly->orthomat, &num, &info);
dtrtri_internal("L", "N", &num, poly->orthomat, &num, &info);
#else
qerror("*Internal Error*: no routine available", " for triangular inverse");
#endif
Expand Down