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: cblas_sgemm #38

Closed
rithvikvibhu opened this Issue Aug 8, 2016 · 9 comments

Comments

Projects
None yet
4 participants
@rithvikvibhu

rithvikvibhu commented Aug 8, 2016

I'm trying to install snowboy on Ubuntu 16.04 LTS and get this when I run demo.py. This happens with both python3 and 2.

~/Downloads/ubuntu1404-x86_64-1.0.4$ sudo python3 demo.py resources/Marvin.pmdl 
Traceback (most recent call last):
  File "demo.py", line 1, in <module>
    import snowboydecoder
  File "/home/rithvik/Downloads/ubuntu1404-x86_64-1.0.4/snowboydecoder.py", line 5, in <module>
    import snowboydetect
  File "/home/rithvik/Downloads/ubuntu1404-x86_64-1.0.4/snowboydetect.py", line 28, in <module>
    _snowboydetect = swig_import_helper()
  File "/home/rithvik/Downloads/ubuntu1404-x86_64-1.0.4/snowboydetect.py", line 24, in swig_import_helper
    _mod = imp.load_module('_snowboydetect', fp, pathname, description)
  File "/usr/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /home/rithvik/Downloads/ubuntu1404-x86_64-1.0.4/_snowboydetect.so: undefined symbol: cblas_sgemm

Any ideas?
EDIT: ubuntu1404-x86_64-1.0.4 is just the extracted tar for Ubuntu.

@rithvikvibhu

This comment has been minimized.

rithvikvibhu commented Aug 8, 2016

ldd -r _snowboydetect.so got me this

    linux-vdso.so.1 =>  (0x00007ffd50f68000)
    libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007fefe7104000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fefe6ee7000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fefe6ce2000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fefe6adf000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fefe67d6000)
    libf77blas.so.3 => /usr/lib/libf77blas.so.3 (0x00007fefe65b5000)
    libcblas.so.3 => /usr/lib/x86_64-linux-gnu/libcblas.so.3 (0x00007fefe6358000)
    liblapack_atlas.so.3 => /usr/lib/liblapack_atlas.so.3 (0x00007fefe60fc000)
    libatlas.so.3 => /usr/lib/libatlas.so.3 (0x00007fefe5b62000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fefe57e1000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fefe55cb000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fefe5201000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fefe4fe6000)
    /lib64/ld-linux-x86-64.so.2 (0x00005581ca856000)
    libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007fefe4cbf000)
    libf2c.so.2 => /usr/lib/x86_64-linux-gnu/libf2c.so.2 (0x00007fefe4aa1000)
    libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007fefe4862000)
undefined symbol: cblas_zswap   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_sgemm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_sgemv   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zgemm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_cdotu_sub   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dznrm2  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_ddot    (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zdotu_sub   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_sdot    (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_cgerc   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_scnrm2  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_ctrmm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_sscal   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_strmm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zcopy   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dsyrk   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_cherk   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zherk   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dswap   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_scopy   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zscal   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zdotc_sub   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_cscal   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_xerbla  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_ztrsm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_ctrsm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_cdotc_sub   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_idamax  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_snrm2   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dger    (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_ssyrk   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dgemv   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_cgemm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_sswap   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_isamax  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dcopy   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_strsm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_izamax  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_sger    (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_ztrmm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zdscal  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dtrmm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zgerc   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_csscal  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dnrm2   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_icamax  (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_zgemv   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_cgemv   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dscal   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dgemm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_dtrsm   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_ccopy   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_cswap   (/usr/lib/liblapack_atlas.so.3)
undefined symbol: cblas_snrm2   (./_snowboydetect.so)
undefined symbol: cblas_sdot    (./_snowboydetect.so)
undefined symbol: cblas_sgemm   (./_snowboydetect.so)
undefined symbol: cblas_sgemv   (./_snowboydetect.so)
undefined symbol: cblas_sscal   (./_snowboydetect.so)
undefined symbol: cblas_sger    (./_snowboydetect.so)
undefined symbol: cblas_saxpy   (./_snowboydetect.so)
@chenguoguo

This comment has been minimized.

Collaborator

chenguoguo commented Aug 8, 2016

Try to install ATLAS by the command sudo apt-get install libatlas-base-dev

@chenguoguo chenguoguo closed this Aug 8, 2016

@smititelu

This comment has been minimized.

smititelu commented Aug 24, 2017

Hi! I have the the same issue that isn't solved just by installing that package. @chenguoguo any other ideas ?!

Error:

root@raspberrypi:~/snowboy# python examples/Python/demo.py resources/snowboy.umdl 
Traceback (most recent call last):
  File "examples/Python/demo.py", line 1, in <module>
    import snowboydecoder
  File "/root/snowboy/examples/Python/snowboydecoder.py", line 5, in <module>
    import snowboydetect
  File "/root/snowboy/examples/Python/snowboydetect.py", line 21, in <module>
    _snowboydetect = swig_import_helper()
  File "/root/snowboy/examples/Python/snowboydetect.py", line 20, in swig_import_helper
    return importlib.import_module('_snowboydetect')
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: /usr/lib/liblapack_atlas.so.3: undefined symbol: cblas_zswap

Packages:

pi@raspberrypi:~ $ sudo dpkg -l | grep atlas
ii  libatlas-base-dev                     3.10.3-1+rpi1                      armhf        Automatically Tuned Linear Algebra Software, generic static
ii  libatlas-dev                          3.10.3-1+rpi1                      armhf        Automatically Tuned Linear Algebra Software, C header files
ii  libatlas3-base                        3.10.3-1+rpi1                      armhf        Automatically Tuned Linear Algebra Software, generic shared

pi@raspberrypi:~ $ sudo dpkg -l | grep cblas
ii  libcblas-dev                          3.2.1+dfsg-1                       armhf        Basic Linear Algebra Subroutines 3, static library
ii  libcblas3                             3.2.1+dfsg-1                       armhf        Basic Linear Algebra Reference implementations, shared library

System:

root@raspberrypi:~/snowboy# uname -a
Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux

root@raspberrypi:~/snowboy# cat /etc/issue
Raspbian GNU/Linux 9 \n \l
@chenguoguo

This comment has been minimized.

Collaborator

chenguoguo commented Aug 25, 2017

That's very weird. I've never seen this happen. How did you install ATLAS? By running the command above?

@smititelu

This comment has been minimized.

smititelu commented Aug 26, 2017

Yes, I have installed atlas by running the command above. Installing swig as in issue #17 helped!!!

Now I'm having the sample rate issue as in issue #14.

@chenguoguo

This comment has been minimized.

Collaborator

chenguoguo commented Aug 27, 2017

You can write some code to down sample or up sample it. You can to make sure that your sampling rate is 16k when you feed the audio to snowboy

@smititelu

This comment has been minimized.

smititelu commented Aug 28, 2017

Is there a way I can configure alsa to downsample and feed the audio at 16k, always?

@chenguoguo

This comment has been minimized.

Collaborator

chenguoguo commented Aug 28, 2017

You could follow some of the matlab code: https://stackoverflow.com/questions/4542829/how-would-i-down-sample-a-wav-file-then-reconstruct-it-using-nyquist-in-matl

You will have to write your own code though, because the matlab code uses some functions that only exist in matlab.

@wojiaojiao

This comment has been minimized.

wojiaojiao commented Aug 30, 2018

you can try:
pip install numpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment