Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction in OpenCV's default CMAKE search Path for OpenBLAS Library on Ubuntu-64bit Machines [Solution] #12957

Closed
abhiTronix opened this issue Oct 26, 2018 · 2 comments

Comments

@abhiTronix
Copy link

System information (version)
  • OpenCV => 4.0.0 - pre(Latest - master)
  • Operating System / Platform => Ubuntu 18.04 64 Bit
  • Compiler => GCC 7.3.0 (Default)
Detailed description

Hello there,

I found a simple & straightforward solution to the problems of OpenBLAS Library not being identified properly on Ubuntu machine (64-bit) in CMAKE configuring step, also may work on other Linux Distros :)

Completely Solves: #9953

Installation:

OpenBLAS can installed from respected default repository with the following command:

sudo apt install libopenblas-dev, libopenblas-base

Whereas LAPACK Library is little trickier to install, as OpenBLAS doesn't provide Lapacke header file(i cannot find the lapacke.h header fie ), Therefore I ought to install LAPACK Library instead, which works absolutely fine:

sudo apt install liblapacke-dev

sudo ln -s /usr/include/lapacke.h /usr/include/x86_64-linux-gnu # corrected path for the library 

Setting Correct Path:

So, The only thing left is setting Correct Default Search Path for Include and Libs Directory of OpenBLAS Library which is as below :

  • Open_BLAS_INCLUDE_SEARCH_PATHS path: /usr/include/x86_64-linux-gnu
  • Open_BLAS_LIB_SEARCH_PATHS path: /usr/lib/x86_64-linux-gnu

Appending these respective additional Paths in OpenCVFindOpenBLAS.cmake :

SET(Open_BLAS_INCLUDE_SEARCH_PATHS

and
SET(Open_BLAS_LIB_SEARCH_PATHS

Completely solves the issue without altering any additional file in OpenCV. Kindly Add these additional paths to the above-mentioned file :)

Results:

Before appending path:

-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY) 
.
.
-- LAPACK(LAPACK/Generic): LAPACK_LIBRARIES: /usr/lib/x86_64-linux-gnu/libopenblas.so;/usr/lib/x86_64-linux-gnu/libopenblas.so
-- LAPACK(LAPACK/Generic): Support is enabled.

After appending path:

-- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so
-- Found OpenBLAS include: /usr/include/x86_64-linux-gnu
-- LAPACK(OpenBLAS): LAPACK_LIBRARIES: /usr/lib/x86_64-linux-gnu/libopenblas.so
-- LAPACK(OpenBLAS): Support is enabled.

After Correction, OpenBLAS library configured correctly with OpenCV on my system, Cheers.

@alalek
Copy link
Member

alalek commented Oct 26, 2018

Such workarounds should be added as a comment into original issue.

@abhiTronix
Copy link
Author

@alalek Actually the solution is Altering OpenCVFindOpenBLAS.cmake in the source and adding additional paths. That's why I opened it as an issue. Can you please add them and crosscheck the results?

@abhiTronix abhiTronix changed the title Correction in OpenCV's default CMAKE search Path for OpenBLAS Library on Ubuntu-64bit Machines Correction in OpenCV's default CMAKE search Path for OpenBLAS Library on Ubuntu-64bit Machines [Solution] Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants