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

Openblas installation points to generic BLAS/LAPACK #1394

Closed
vermashresth opened this issue Dec 13, 2017 · 6 comments
Closed

Openblas installation points to generic BLAS/LAPACK #1394

vermashresth opened this issue Dec 13, 2017 · 6 comments

Comments

@vermashresth
Copy link

Hi,
I installed `libopenblas-dev' using apt-get on my Ubuntu 16.04 system. At the end of installation, the update-alternatives sets the following

update-alternatives: using /usr/lib/openblas-base/libblas.so to provide /usr/lib/libblas.so (libblas.so) in auto mode update-alternatives: using /usr/lib/openblas-base/liblapack.so to provide /usr/lib/liblapack.so (liblapack.so) in auto mode

But the libraries it is poitning to, doesn't contain any OpenBLAS specific functions such as openblas_get_num_threads as it gives not found in cmake.

I also verified this by doing
readelf -Ws /usr/lib/liblapack.so >> res.txt
grep "openblas" res.txt
And the output was none, same for libblas.so

the file '/usr/lib/libopenblas.so" however contains all the openblas specific functions.

Any reason why is it so?

@martin-frbg
Copy link
Collaborator

You will probably need to ask the Ubuntu folks who packaged openblas. The standard build of OpenBLAS will contain all functions (including BLAS and LAPACK) in a single libopenblas.so file that may have to be symlinked to the libblas, liblapack names for compatibility with other programs if you want to switch implementations at will. There is some background discussion in issue #296

@martin-frbg
Copy link
Collaborator

See also https://github.com/xianyi/OpenBLAS/wiki/Faq#debianlts - what comes with Ubuntu 16.04 is probably a bit old (0.2.18 from early last year I guess)

@brada4
Copy link
Contributor

brada4 commented Dec 13, 2017

libblas.so that gcc -lblas reads is netlib reference blas to keep peoples code portable.
you can update that alternative to point to openblas, but probably you need to do -lopenblas instead.

me being author of particular FAQ paragraph - I intentionally left that part out to keep it working like debian packagers intended.

I dont know why you get libblas.so symlinked anywhere, when I wrote faq it was just libblas.so.3 and liblapack.so.3, i.e dynamic loaded not linker libs.

@isuruf
Copy link
Contributor

isuruf commented Dec 23, 2017

What debian does is it creates a libblas.so.3 which links against libopenblas.so, but exports only the symbols from the blas API. So, when you do -lblas you are linking against a library which in turn links against libopenblas. If you want openblas symbols, use -lopenblas

@brada4
Copy link
Contributor

brada4 commented Dec 25, 2017

@vermashresth can you close the issue? We dont maintain that package and 'ubuntu-support-status' on my 16.04 says vendor does not either.

@vermashresth
Copy link
Author

@brada4 Sure, sorry for late reply. It does seem to be an issue from package side because it worked fine on Ubuntu 14.04 and @isuruf 's answer works too. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants