Package Details: mingw-w64-opencv 4.7.0-1

Git Clone URL: https://aur.archlinux.org/mingw-w64-opencv.git (read-only, click to copy)
Package Base: mingw-w64-opencv
Description: Open Source Computer Vision Library (mingw-w64)
Upstream URL: http://opencv.org/
Licenses: BSD
Submitter: xantares
Maintainer: drakkan
Last Packager: drakkan
Votes: 2
Popularity: 0.000000
First Submitted: 2015-09-14 18:31 (UTC)
Last Updated: 2023-01-19 18:11 (UTC)

Latest Comments

1 2 3 Next › Last »

drakkan commented on 2021-11-01 11:34 (UTC)

Thanks,

I added you as co-maintainer, no obligations, if you have time you can help

patlefort commented on 2021-10-29 03:01 (UTC)

I am able to compile it by replacing opencv-lapack-3.9.1.patch with this patch:

diff --git a/modules/calib3d/src/usac/dls_solver.cpp b/modules/calib3d/src/usac/dls_solver.cpp
index 0898734fb3..17820696a7 100644
--- a/modules/calib3d/src/usac/dls_solver.cpp
+++ b/modules/calib3d/src/usac/dls_solver.cpp
@@ -159,7 +159,7 @@ public:
         double wr[27], wi[27] = {0}; // 27 = mat_order
         std::vector<double> work(lwork), eig_vecs(729);
         char jobvl = 'N', jobvr = 'V'; // only left eigen vectors are computed
-        dgeev_(&jobvl, &jobvr, &mat_order, (double*)solution_polynomial.data, &lda, wr, wi, nullptr, &ldvl,
+        LAPACK_dgeev(&jobvl, &jobvr, &mat_order, (double*)solution_polynomial.data, &lda, wr, wi, nullptr, &ldvl,
                &eig_vecs[0], &ldvr, &work[0], &lwork, &info);
         if (info != 0) return 0;
 #endif
diff --git a/modules/calib3d/src/usac/essential_solver.cpp b/modules/calib3d/src/usac/essential_solver.cpp
index 0adca0966f..e84b380baa 100644
--- a/modules/calib3d/src/usac/essential_solver.cpp
+++ b/modules/calib3d/src/usac/essential_solver.cpp
@@ -161,7 +161,7 @@ public:
         int mat_order = 10, info, lda = 10, ldvl = 10, ldvr = 1, lwork = 100;
         double wr[10], wi[10] = {0}, eig_vecs[100], work[100]; // 10 = mat_order, 100 = lwork
         char jobvl = 'V', jobvr = 'N'; // only left eigen vectors are computed
-        dgeev_(&jobvl, &jobvr, &mat_order, action_mat_data, &lda, wr, wi, eig_vecs, &ldvl,
+        LAPACK_dgeev(&jobvl, &jobvr, &mat_order, action_mat_data, &lda, wr, wi, eig_vecs, &ldvl,
                 nullptr, &ldvr, work, &lwork, &info);
         if (info != 0) return 0;
 #endif
diff --git a/modules/core/src/hal_internal.cpp b/modules/core/src/hal_internal.cpp
index 483281d1f7..05239e98f4 100644
--- a/modules/core/src/hal_internal.cpp
+++ b/modules/core/src/hal_internal.cpp
@@ -163,9 +163,9 @@ lapack_Cholesky(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n
         if(n == 1 && b_step == sizeof(fptype))
         {
             if(typeid(fptype) == typeid(float))
-                sposv_(L, &m, &n, (float*)a, &lda, (float*)b, &m, &lapackStatus);
+                LAPACK_sposv(L, &m, &n, (float*)a, &lda, (float*)b, &m, &lapackStatus);
             else if(typeid(fptype) == typeid(double))
-                dposv_(L, &m, &n, (double*)a, &lda, (double*)b, &m, &lapackStatus);
+                LAPACK_dposv(L, &m, &n, (double*)a, &lda, (double*)b, &m, &lapackStatus);
         }
         else
         {
@@ -174,9 +174,9 @@ lapack_Cholesky(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n
             transpose(b, ldb, tmpB, m, m, n);

             if(typeid(fptype) == typeid(float))
-                sposv_(L, &m, &n, (float*)a, &lda, (float*)tmpB, &m, &lapackStatus);
+                LAPACK_sposv(L, &m, &n, (float*)a, &lda, (float*)tmpB, &m, &lapackStatus);
             else if(typeid(fptype) == typeid(double))
-                dposv_(L, &m, &n, (double*)a, &lda, (double*)tmpB, &m, &lapackStatus);
+                LAPACK_dposv(L, &m, &n, (double*)a, &lda, (double*)tmpB, &m, &lapackStatus);

             transpose(tmpB, m, b, ldb, n, m);
             delete[] tmpB;
@@ -185,9 +185,9 @@ lapack_Cholesky(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n
     else
     {
         if(typeid(fptype) == typeid(float))
-            spotrf_(L, &m, (float*)a, &lda, &lapackStatus);
+            LAPACK_spotrf(L, &m, (float*)a, &lda, &lapackStatus);
         else if(typeid(fptype) == typeid(double))
-            dpotrf_(L, &m, (double*)a, &lda, &lapackStatus);
+            LAPACK_dpotrf(L, &m, (double*)a, &lda, &lapackStatus);
     }

     if(lapackStatus == 0) *info = true;
@@ -227,17 +227,17 @@ lapack_SVD(fptype* a, size_t a_step, fptype *w, fptype* u, size_t u_step, fptype
     }

     if(typeid(fptype) == typeid(float))
-        sgesdd_(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)&work1, &lwork, iworkBuf, info);
+        LAPACK_sgesdd(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)&work1, &lwork, iworkBuf, info);
     else if(typeid(fptype) == typeid(double))
-        dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)&work1, &lwork, iworkBuf, info);
+        LAPACK_dgesdd(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)&work1, &lwork, iworkBuf, info);

     lwork = (int)round(work1); //optimal buffer size
     fptype* buffer = new fptype[lwork + 1];

     if(typeid(fptype) == typeid(float))
-        sgesdd_(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)buffer, &lwork, iworkBuf, info);
+        LAPACK_sgesdd(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)buffer, &lwork, iworkBuf, info);
     else if(typeid(fptype) == typeid(double))
-        dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)buffer, &lwork, iworkBuf, info);
+        LAPACK_dgesdd(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)buffer, &lwork, iworkBuf, info);

     if(!(flags & CV_HAL_SVD_NO_UV))
         transpose_square_inplace(vt, ldv, n);
@@ -288,18 +288,18 @@ lapack_QR(fptype* a, size_t a_step, int m, int n, int k, fptype* b, size_t b_ste
         if (k == 1 && b_step == sizeof(fptype))
         {
             if (typeid(fptype) == typeid(float))
-                sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)&work1, &lwork, info);
+                LAPACK_sgels(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)&work1, &lwork, info);
             else if (typeid(fptype) == typeid(double))
-                dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info);
+                LAPACK_dgels(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info);

             lwork = cvRound(work1); //optimal buffer size
             std::vector<fptype> workBufMemHolder(lwork + 1);
             fptype* buffer = &workBufMemHolder.front();

             if (typeid(fptype) == typeid(float))
-                sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)buffer, &lwork, info);
+                LAPACK_sgels(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)buffer, &lwork, info);
             else if (typeid(fptype) == typeid(double))
-                dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info);
+                LAPACK_dgels(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info);
         }
         else
         {
@@ -309,18 +309,18 @@ lapack_QR(fptype* a, size_t a_step, int m, int n, int k, fptype* b, size_t b_ste
             transpose(b, ldb, tmpB, m, m, k);

             if (typeid(fptype) == typeid(float))
-                sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)&work1, &lwork, info);
+                LAPACK_sgels(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)&work1, &lwork, info);
             else if (typeid(fptype) == typeid(double))
-                dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info);
+                LAPACK_dgels(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info);

             lwork = cvRound(work1); //optimal buffer size
             std::vector<fptype> workBufMemHolder(lwork + 1);
             fptype* buffer = &workBufMemHolder.front();

             if (typeid(fptype) == typeid(float))
-                sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)buffer, &lwork, info);
+                LAPACK_sgels(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)buffer, &lwork, info);
             else if (typeid(fptype) == typeid(double))
-                dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info);
+                LAPACK_dgels(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info);

             transpose(tmpB, m, b, ldb, k, m);
         }

drakkan commented on 2021-09-01 15:02 (UTC)

Hi, there are some build issues with 4.5.3. I will update the PKGBUILD once I am able to fix them. Thanks for your patience

drakkan commented on 2019-10-16 11:37 (UTC)

@FoPref, OpenCV use cmake to find lapack during build, and it does not work, so lapack libs are manually setted

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mingw-w64-opencv#n61

this is needed for linux native build too

https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/opencv#n57

FoPref commented on 2019-09-11 13:51 (UTC)

Hello Drakkan, thank you for looking into these things. Unfortunately the patch does not work for me, as it leads to a binary that wants to link to opencv*411.dll files on runtime. I wonder why.

Modifying the lapack pkgconf file did not help as well. Does OpenCV during build use the PKGCONF to find lapack?

drakkan commented on 2019-07-28 09:21 (UTC)

@FoPref, I just retested pkgconfig shared and static build with 4.1.1 (some changes were needed to my build script) and cmake shared build. For cmake static build can you please test this patch?

From 0220c010c220654f18db2143bc2825940786af87 Mon Sep 17 00:00:00 2001
From: Nicola Murino <nicola.murino@gmail.com>
Date: Sat, 27 Jul 2019 20:05:10 +0200
Subject: [PATCH] OpenCVModule.cmake: add RUNTIME_OUTPUT_NAME and
 ARCHIVE_OUTPUT_NAME

---
 cmake/OpenCVModule.cmake | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
index 799592b..7fba7ba 100644
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -956,7 +956,9 @@ macro(_ocv_create_module)
   endif()

   set_target_properties(${the_module} PROPERTIES
-    OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}"
+    OUTPUT_NAME "${the_module}"
+    RUNTIME_OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}"
+    ARCHIVE_OUTPUT_NAME "${the_module}"
     DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
     COMPILE_PDB_NAME "${the_module}${OPENCV_DLLVERSION}"
     COMPILE_PDB_NAME_DEBUG "${the_module}${OPENCV_DLLVERSION}${OPENCV_DEBUG_POSTFIX}"
-- 
2.22.0

this way the static libs will not have version suffix. The patch breaks pkg-build based static build, anyway I can try to find a common fix if it works for cmake, thanks

drakkan commented on 2019-07-17 10:15 (UTC)

@FoPref

in my test project static build using pkg-config works fine.

Do you modified the lapack pc file as suggested below?

https://aur.archlinux.org/packages/mingw-w64-lapack/#comment-644860

Can you please share a simple test project to use as reproducer? Maybe my test project for static building does not cover all cases :) thanks!

FoPref commented on 2019-07-17 09:38 (UTC)

I know the latest package version is just a version dump, however it looks like with 4.0.1 everything builds fine, whereas with 4.1.0 cblas is missing from the static libs.

drakkan commented on 2019-02-08 14:17 (UTC)

@FoPref, thanks for reporting.

I use pkg-config and so I fixed static build for pkg-config case as you can see inside the PKGBUILD (line 83). This really seems an upstream issue: both pc files and cmake files are broken in some way for shared and static build (please see fixes inside PKGBUILD).

I'll try to fix static cmake build as soon as I have some spare time

FoPref commented on 2019-02-08 14:10 (UTC) (edited on 2019-02-08 14:12 (UTC) by FoPref)

Another problem with the file seems to be that it does not provide the right library names for static builds. The lib names provided in ${OpenCV_LIBRARIES} are, e.g., opencv_core, or opencv_imgproc. The correct names would have the version number appended (opencv_imgproc401 etc).

Note that at the same time, pkg-config does provide the correct names, e.g. -lopencv_imgproc401, and a static build is successful.