qwert wayne
qwert wayne

Reputation: 186

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

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!

Upvotes: 3

Views: 5548

Answers (2)

GeorgeK
GeorgeK

Reputation: 33

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.

Upvotes: 0

Viet
Viet

Reputation: 21

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.

Upvotes: 2

Related Questions