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

Symbol lookup error: /usr/lib/libblas.so.3: undefined symbol: gotoblas #1114

Closed
adonese opened this issue Mar 5, 2017 · 20 comments
Closed

Comments

@adonese
Copy link

adonese commented Mar 5, 2017

I've tried the solution of issue #1033, but that didn't work. I'm using Ubuntu 16.04, I've installed OpenBLAS using apt-get.

sudo update-alternatives --set libblas.so.3 /usr/lib/openblas-base/libblas.so.3

My libblas.so.3 alternatives are,

sudo update-alternatives --list libblas.so.3
/usr/lib/atlas-base/atlas/libblas.so.3
/usr/lib/libblas/libblas.so.3
/usr/lib/openblas-base/libblas.so.3

I've also tried to install OpenBLAS from the source, it compiled well, but the problem still existed.

I get this error: <application_name>: symbol lookup error: /usr/lib/libblas.so.3: undefined symbol: gotoblas, whenever I try to run any program that uses OpenBLAS

@brada4
Copy link
Contributor

brada4 commented Mar 5, 2017

Did you restore system openblas base and relinked all your programs to -lblas after your trip into source build ? What does ldd say if ran against your program?
Dooes something simple like python> import numpy.* exhibit same errors?

@martin-frbg
Copy link
Collaborator

Perhaps the steps outlined in JuliaLang/julia#11913 will help ? (I never encountered this, but I now suspect that the symbol "openblas" may only be present in builds with DYNAMIC_ARCH=1 set)

@adonese
Copy link
Author

adonese commented Mar 5, 2017

I did from numpy import * and it doesn't raise any error.

@brada4 I'm a bit beginner here. Would you mind to show simple steps procedures?

@martin-frbg I will try those of Julia, thanks!

@adonese
Copy link
Author

adonese commented Mar 5, 2017

Thank you so much!

I had libopenblas.so.0 in /usr/local/lib. That causes the error. I assume that I should remove the version of OpenBLAS I built from the source, since I had one from Ubuntu PPA.

@adonese adonese closed this as completed Mar 5, 2017
@adonese
Copy link
Author

adonese commented Mar 5, 2017

I was trying to install qgis. For some reason, qgis installs its own version of openblas at usr/local/lib. I had to remove libopenblas.so.0 from that location. When I installed qgis, I got the same error again. So, I removed libopenblas.so.0 from /usr/local/lib again, and did apt-get install -f. And it solves the problem. I just want to that conflict because of me, or from qgis?

@brada4
Copy link
Contributor

brada4 commented Mar 5, 2017

Ubuntu provided openblas is in your alternatives list
If you built your own then it is /opt/OpenBLAS/libopenblas.so.0
apt-file can help you locate source of that file, but it did not come from either of 2 sources mentioned.

@martin-frbg
Copy link
Collaborator

I have now confirmed that it is (only) the multi-cputype builds of the library that contain the symbol "gotoblas", so I guess it should be possible to use your own build of OpenBLAS with the other code if you just build OpenBLAS with "make DYNAMIC_ARCH=1". (DYNAMIC_ARCH will make the library file bigger of course, but it should not hurt otherwise)

@martin-frbg
Copy link
Collaborator

Updated the FAQ (in the Wiki) accordingly.

@ph-preux
Copy link

Hi,
this morning I "apt-get install julia" on my Ubuntu 16.04.
It automatically installed libopenblass-base and now, when I call R, I have the exact same message as yours.
Before this update, R was working, and I was using blas through the atlas package.

Now, I've "apt-get remove libopenblas-base" and R, I mean blas, is back.

@brada4
Copy link
Contributor

brada4 commented Mar 28, 2017

I cannot get to your R issue with Ubuntu R or CRAN R. What special setup you have?

@ph-preux
Copy link

I've installed R with Ubuntu packages. Regarding blas, I get it through libatlas-dev and libatlas3-base Ubuntu packages.

@ysh329
Copy link

ysh329 commented May 8, 2017

Same issue as yours, it's okay after removing /usr/local/lib/libopenblas.so.* files, which I built previously from source.
Thanks a lot!

@brada4
Copy link
Contributor

brada4 commented May 8, 2017

There is sane procedure in FAQ for your own build of OpenBLAS:
https://github.com/xianyi/OpenBLAS/wiki/faq#debianlts

@ysh329
Copy link

ysh329 commented May 8, 2017

@brada4 Thanks! 😆

@rayanelleuch
Copy link

rayanelleuch commented Jan 11, 2018

I got the same problem too by the following import line.

import cv2
from skimage.color import label2rgb  # error occur here

But I realised that get this problem only if I import opencv before
just inter changing lines was enough. (Not sure why)
Solution:

from skimage.color import label2rgb
import cv2

Hope it can helps someone.

@brada4
Copy link
Contributor

brada4 commented Jan 11, 2018

Probably each module is linked against different blas implementation.
It is cleaner if only blas library during build/pip install is either reference blas or openblas planted as default -lblas.
Binary packages/wheels usually have static blas linked in that conflicts with other implementations loaded in same process

@sahilbandar
Copy link

Hi,
this morning I "apt-get install julia" on my Ubuntu 16.04.
It automatically installed libopenblass-base and now, when I call R, I have the exact same message as yours.
Before this update, R was working, and I was using blas through the atlas package.

Now, I've "apt-get remove libopenblas-base" and R, I mean blas, is back.

This one worked out for me..

@brada4
Copy link
Contributor

brada4 commented Sep 26, 2018

Openblas package lapack has high alternative priority, if you ever fixed blas to other than openblas it gets incompatible blas. Reference lapack (liblapack-dev) will work with any blas lib.
Probably typical error messages could help consumability of faq.

@xbsd
Copy link

xbsd commented Dec 9, 2019

I was trying to install qgis. For some reason, qgis installs its own version of openblas at usr/local/lib. I had to remove libopenblas.so.0 from that location. When I installed qgis, I got the same error again. So, I removed libopenblas.so.0 from /usr/local/lib again, and did apt-get install -f. And it solves the problem. I just want to that conflict because of me, or from qgis?

This is a saviour. Thanks so much !! :)

@brada4
Copy link
Contributor

brada4 commented Dec 9, 2019

You can replace "private installs" with symlink to /usr/lib/libblas.so.3, then process with update-alternatives --config libblas.so.3 , then expect all apps to use your chosen implementation.
It is just once per install...

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

8 participants