1 diff --git a/modules/core/src/hal_internal.cpp b/modules/core/src/hal_internal.cpp
2 index 483281d1f7..05239e98f4 100644
3 --- a/modules/core/src/hal_internal.cpp
4 +++ b/modules/core/src/hal_internal.cpp
5 @@ -163,9 +163,9 @@ lapack_Cholesky(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n
6 if(n == 1 && b_step == sizeof(fptype))
8 if(typeid(fptype) == typeid(float))
9 - sposv_(L, &m, &n, (float*)a, &lda, (float*)b, &m, &lapackStatus);
10 + LAPACK_sposv(L, &m, &n, (float*)a, &lda, (float*)b, &m, &lapackStatus);
11 else if(typeid(fptype) == typeid(double))
12 - dposv_(L, &m, &n, (double*)a, &lda, (double*)b, &m, &lapackStatus);
13 + LAPACK_dposv(L, &m, &n, (double*)a, &lda, (double*)b, &m, &lapackStatus);
17 @@ -174,9 +174,9 @@ lapack_Cholesky(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n
18 transpose(b, ldb, tmpB, m, m, n);
20 if(typeid(fptype) == typeid(float))
21 - sposv_(L, &m, &n, (float*)a, &lda, (float*)tmpB, &m, &lapackStatus);
22 + LAPACK_sposv(L, &m, &n, (float*)a, &lda, (float*)tmpB, &m, &lapackStatus);
23 else if(typeid(fptype) == typeid(double))
24 - dposv_(L, &m, &n, (double*)a, &lda, (double*)tmpB, &m, &lapackStatus);
25 + LAPACK_dposv(L, &m, &n, (double*)a, &lda, (double*)tmpB, &m, &lapackStatus);
27 transpose(tmpB, m, b, ldb, n, m);
29 @@ -185,9 +185,9 @@ lapack_Cholesky(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n
32 if(typeid(fptype) == typeid(float))
33 - spotrf_(L, &m, (float*)a, &lda, &lapackStatus);
34 + LAPACK_spotrf(L, &m, (float*)a, &lda, &lapackStatus);
35 else if(typeid(fptype) == typeid(double))
36 - dpotrf_(L, &m, (double*)a, &lda, &lapackStatus);
37 + LAPACK_dpotrf(L, &m, (double*)a, &lda, &lapackStatus);
40 if(lapackStatus == 0) *info = true;
41 @@ -227,17 +227,17 @@ lapack_SVD(fptype* a, size_t a_step, fptype *w, fptype* u, size_t u_step, fptype
44 if(typeid(fptype) == typeid(float))
45 - sgesdd_(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)&work1, &lwork, iworkBuf, info);
46 + LAPACK_sgesdd(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)&work1, &lwork, iworkBuf, info);
47 else if(typeid(fptype) == typeid(double))
48 - dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)&work1, &lwork, iworkBuf, info);
49 + LAPACK_dgesdd(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)&work1, &lwork, iworkBuf, info);
51 lwork = (int)round(work1); //optimal buffer size
52 fptype* buffer = new fptype[lwork + 1];
54 if(typeid(fptype) == typeid(float))
55 - sgesdd_(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)buffer, &lwork, iworkBuf, info);
56 + LAPACK_sgesdd(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)buffer, &lwork, iworkBuf, info);
57 else if(typeid(fptype) == typeid(double))
58 - dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)buffer, &lwork, iworkBuf, info);
59 + LAPACK_dgesdd(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)buffer, &lwork, iworkBuf, info);
61 if(!(flags & CV_HAL_SVD_NO_UV))
62 transpose_square_inplace(vt, ldv, n);
63 @@ -288,18 +288,18 @@ lapack_QR(fptype* a, size_t a_step, int m, int n, int k, fptype* b, size_t b_ste
64 if (k == 1 && b_step == sizeof(fptype))
66 if (typeid(fptype) == typeid(float))
67 - sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)&work1, &lwork, info);
68 + LAPACK_sgels(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)&work1, &lwork, info);
69 else if (typeid(fptype) == typeid(double))
70 - dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info);
71 + LAPACK_dgels(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info);
73 lwork = cvRound(work1); //optimal buffer size
74 std::vector<fptype> workBufMemHolder(lwork + 1);
75 fptype* buffer = &workBufMemHolder.front();
77 if (typeid(fptype) == typeid(float))
78 - sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)buffer, &lwork, info);
79 + LAPACK_sgels(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)buffer, &lwork, info);
80 else if (typeid(fptype) == typeid(double))
81 - dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info);
82 + LAPACK_dgels(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info);
86 @@ -309,18 +309,18 @@ lapack_QR(fptype* a, size_t a_step, int m, int n, int k, fptype* b, size_t b_ste
87 transpose(b, ldb, tmpB, m, m, k);
89 if (typeid(fptype) == typeid(float))
90 - sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)&work1, &lwork, info);
91 + LAPACK_sgels(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)&work1, &lwork, info);
92 else if (typeid(fptype) == typeid(double))
93 - dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info);
94 + LAPACK_dgels(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info);
96 lwork = cvRound(work1); //optimal buffer size
97 std::vector<fptype> workBufMemHolder(lwork + 1);
98 fptype* buffer = &workBufMemHolder.front();
100 if (typeid(fptype) == typeid(float))
101 - sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)buffer, &lwork, info);
102 + LAPACK_sgels(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)buffer, &lwork, info);
103 else if (typeid(fptype) == typeid(double))
104 - dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info);
105 + LAPACK_dgels(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info);
107 transpose(tmpB, m, b, ldb, k, m);