How do you build OpenCV with LAPACK on Windows 10 via CMake?
Hello,
I've been having trouble getting CMake to cooperate when telling it to build with LAPACK on Windows 10.
I've tried downloading the prebuilt files from LAPACK for Windows.
I downloaded the files that correspond to version 3.7.0 that are supposedly for the Intel compilers, which I have.
However, I am unsure what files I am supposed to point CMake to. To the DLLs or the LIBs?
I followed some advice from here that says to install OpenBLAS, which I did via vcpkg. I pointed CMake to the appropriate file and location but I receive a complaint from CMake:
can't build lapack check code. this lapack version is not supported.
This happens with the prebuilt libraries as well as libraries built from scratch, which I did using the Intel C and Fortran compilers and instructions from the LAPACK for Windows website mentioned above (which is version 3.8.0).
Maybe the new OpenBLAS doesn't work with this version? What do I need; BLAS or OpenBLAS? What do I point to?
Any help would be appreciated.
Please remove screen copy. You can use mkl
Right, but how to set that up?
For LAPACK, I've pointed to mkl_lapack95_lp64.lib, and for BLAS mkl_blas95_lp64.lib, both located in 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.1.156\windows\mkl\lib\intel64_win'
For the LAPACK includes folder, I've pointed to 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.1.156\windows\mkl\include' were a bunch of headers reside.
CMake says:
A library with BLAS API found. A library with LAPACK API not found. Please specify library location.
In that includes folder, there is mkl_lapack.h, mkl_lapacke.h, mkl_cblas.h, etc but I don't think the included setup CMake files know how to recognized them. :(
Ok, followed the instructions I found here and here.
Everything auto populates for LAPACK when manually setting the files and locations for MKL, all except LAPACK_LIBRARIES. It is empty and there is no way to select files or folders. >:(
I'll keep digging...
OK I think I got it to work, and by work I mean all the configurations look right and I get reassuring output from CMake.
I followed the directions in my previous post only I didn't need to modify the OpenCVFindMKL.cmake file. Also I am not using CUDA.
Before running CMake, I set the following system variables and added them to my path:
Then I invoked CMake from the command prompt using:
I chose 'Visual Studio 15 2017 Win64' as my generator and I chose the Intel C/C++/Fortran compiler as my native compiler(s) but I don't think CMake listened to me.
I'll generate and build. hope it works.
I don't know intel C++ compiler but I think you must choose intel in cmake generator and not vs (vs is just an ide when you choose intel)
Intel's compilers don't show up as an option to choose as a generator. I am able to configure, generate and build using VS 15 and native compilers though. However, there is something wrong with my Java and Python wrappers, but I suppose that's a topic for another thread. I'm still building and will start another thread if need be. Thank you.
cmake and intel
Doesn't seem to work for me. The guy says to add the line:
in
CMakeLists.txt
but where exactly? I get an error stating that the compiler cannot be found. I assume mine is version 18.0 but I've tried 17.0 as well and no go. :/Even using -T argument
"Intel C++ Compiler XE 14.0"
at the generator selection dialog box won't work. :/Ok may be you can use method given here