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

undefined symbol: gotoblas issue #1033

Closed
oztc opened this issue Dec 16, 2016 · 7 comments
Closed

undefined symbol: gotoblas issue #1033

oztc opened this issue Dec 16, 2016 · 7 comments

Comments

@oztc
Copy link

oztc commented Dec 16, 2016

my environments:

  1. python
    Python 2.7.12+ (default, Nov 22 2016, 00:48:54)
    [GCC 6.2.1 20161119] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
  1. os

uname -a
Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux

  1. the following log:

import numpy as np
File "/usr/lib/python2.7/dist-packages/numpy/init.py", line 153, in
from . import add_newdocs
File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/dist-packages/numpy/lib/init.py", line 18, in
from .polynomial import *
File "/usr/lib/python2.7/dist-packages/numpy/lib/polynomial.py", line 19, in
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib/python2.7/dist-packages/numpy/linalg/init.py", line 50, in
from .linalg import *
File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 29, in
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: /usr/lib/libblas.so.3: undefined symbol: gotoblas

@brada4
Copy link
Contributor

brada4 commented Dec 16, 2016

can you post 'pip freeze' and 'help (modules)' (attach .txt if more than dozen lines)
How did you compile/install OpenBLAS and numpy?
What does 'update-alternatives --list libblas.so.3' say?

@oztc
Copy link
Author

oztc commented Dec 20, 2016

  1. pip freeze
    Traceback (most recent call last):
    File "/usr/local/bin/pip", line 5, in
    from pkg_resources import load_entry_point
    ImportError: No module named pkg_resources

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

@martin-frbg
Copy link
Collaborator

Try doing "sudo update-alternatives --set libblas.so.3 /usr/lib/openblas-base/libblas.so.3" to switch from the (unoptimized netlib reference ?) blas version currently installed as default on your system to the OpenBLAS that your numpy build expects.

@oztc
Copy link
Author

oztc commented Dec 20, 2016

ok, it is not a openblas bug, when i use anaconda python, now it can work.

thank you for your support.

@martin-frbg
Copy link
Collaborator

Then the anaconda version was probably built against the non-optimized blas - you can read about the options in https://github.com/scipy/scipy.org/blob/master/www/scipylib/building/linux.rst#debian--ubuntu
(I do hope that most if not all of the bugs that made them advise against using OpenBLAS two years ago
have been addressed in the meantime - in my experience, OpenBLAS is substantially faster than Atlas and the reference implementation with its lack of hardware-specific optimization is naturally the slowest.)

@oztc
Copy link
Author

oztc commented Dec 20, 2016

your advise and your link are very helpful, I will try it.

@brada4
Copy link
Contributor

brada4 commented Dec 21, 2016

Can you close the issue?
You have ubuntu python in the text you posted. Ubuntu numpy (installed via APT) will respect update-alternatives.
Continuum anaconda (not in posted text) calls openblas 'nomkl' as opposed to default 'mkl', it is described in their numpy documents how to switch back and forth.

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

3 participants