Building opencv 3.1 on windows - where do I specify the LAPACK library location?

99封情书 提交于 2021-02-07 23:25:54

问题


For building opencv 3.1 I'm using cmake with Visual Studio 2013. I downloaded the dependencies as shown here: http://docs.opencv.org/3.1.0/d3/d52/tutorial_windows_install.html
While configuring cmake, the first thing it shows is:

FP16: Compiler support is available
A library with BLAS API not found. Please specify library location.
LAPACK requires BLAS
A library with LAPACK API not found. Please specify library location.

The problem is, that I don't know how to specify the location. For the "Eigen" library I set the library path myself (EIGEN_INCLUDE_PATH, which is pre defined) and cmake says:

Other third-party libraries:
    Use IPP:                     NO
    Use IPP Async:               NO
    Use Lapack:                  NO
    Use Eigen:                   YES (ver 3.2.10)
    Use Cuda:                    NO
    Use OpenCL:                  YES
    Use OpenVX:                  NO
    Use custom HAL:              NO

but there is no pre defined variable for LAPACK. I also tried to put the *.lib and header files in a subdirectory, which I downloaded from http://icl.cs.utk.edu/lapack-for-windows/, in the hope if cmake somehow finding the library.

I have to build opencv 3.1 myself, because in the distributed version, the extra modules are disabled. It builds without LAPACK, but my guess is, that I will loose a lot of performance.

Thank you very much for your help!


回答1:


For me, I used OpenBlas library:

Use CMake Gui to config opencv

  • Select Advanced
  • In the OpenBLAS group, config the include folder and library file for OpenBLAS
  • In the WITH group, select WITH_LAPACK
  • Now click the Configure button, CMake will automatically config Lapack info.
  • After all is ok, you can click on Generate button on CMake Gui to generate visual studio project files and start to build.



回答2:


I would add a comment but I do not have enough rep for it. In my case to build OpenCV 3.2 in Visual Studio 2013 with OpenBlas and LAPACK, in addition to Viets' answer, I had to change two lines in lapacke.h to use the standard library based on here

So, for OpenBLAS version 0.2.19-Win64-int32 in lapacke.h I changed

@line 74 float _Complex to std::complex<float> and

@line 90 double _Complex to std::complex<double>

without the need to build the OpenBLAS library again.

Hope it helps.



来源:https://stackoverflow.com/questions/40134261/building-opencv-3-1-on-windows-where-do-i-specify-the-lapack-library-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!