5

I am working on Windows 10 and CMake 3.14.1.

I am trying to build OpenCV (Version 4.0.1) myself, since I need the contrib modules and the SFM module. I downloaded a prebuilt version of openBLAS 0.2.19. It has 3 directories, bin, include, and lib. The bin directory includes libopenblas.dll, include has the headers and in lib there are libopenblas.a and libopenblas.dll.a (and a cmake directory).

When I'm configuring openCV with CMake, of course I set openBLAS_INCLUDE_DIR to the include directory. But which file should I specify to openBLAS_LIB? libopenblas.dll, libopenblas.a or libopenblas.dll.a?

And later on when I'm building openCV (with Visual Studio 2017), where should I put the .dll so that it is visible to the building process?

Edit: Maybe I should add that OpenBLAS was compiled with minGW, that's why there are those weird .a and .dll.a files instead of .lib

jiggy
  • 262
  • 2
  • 12

1 Answers1

6

I can now at least partially answer my question. Those two answers have helped me:

https://stackoverflow.com/a/2139061/6793721

https://stackoverflow.com/a/6480464/6793721

So .a files are usually the Unix static libraries, for Windows we have .lib. Since minGW uses GCC, it produces .a libraries, but in a way that they are compatible with Visual Studio and MSVC. So I guess libopenblas.a is the full static library, and libopenblas.dll.a is the import library to be used with libopenblas.dll. Now when building openCV, in CMake I specified libopenblas.dll.a as the library and everything worked (configuring, building, installing). I did add the directory where the .dll is located to the PATH, but I'm not sure if that needs to be done or is the best way to do it.

jiggy
  • 262
  • 2
  • 12