Skip to content

Building against OpenBLAS complains about missing lapacke.h #9953

@FlorianFranzen

Description

@FlorianFranzen
System information (version)
  • OpenCV => 3.3.1
  • Operating System / Platform => Ubuntu 16.04. (xenial)
Detailed description

It is not possible to build openCV against libOpenBLAS unless one also installs an additional LAPACK implementation that includes the lapacke.h header, e.g. liblapacke-dev on Ubuntu.

To me that does not look like the intended behavior and it might be explained by the fact, that OpenBLAS on Ubuntu only include cblas.h and f77blas.h as an header.

On the other hand OpenCVFindOpenBLAS.cmake does not check for lapacke.h, so it might just be the case that ocv_lapack_check() is too strict when it comes to OpenBLAS.

@alalek You seem to have some experience with this. Any thoughts on this?

Steps to reproduce

If I only install libopenblas-dev, I get the following cmake output once ocv_lapack_check() inside OpenCVFindLAPACK.cmake is called:

-- LAPACK(OpenBLAS): LAPACK_LIBRARIES: /usr/lib/libopenblas.so
CMake Warning at cmake/OpenCVFindLAPACK.cmake:29 (message):
  LAPACK(OpenBLAS): CBLAS/LAPACK headers are not found in '/usr/include'
Call Stack (most recent call first):
  cmake/OpenCVFindLAPACK.cmake:155 (ocv_lapack_check)
  CMakeLists.txt:596 (include)

If I now install any LAPACK implementation that includes a lapacke.h, e.g.: liblapacke-dev, everything passes and OpenBLAS will be used:

-- LAPACK(OpenBLAS): LAPACK_LIBRARIES: /usr/lib/libopenblas.so
-- LAPACK(OpenBLAS): Support is enabled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions