Librosa: LLVMInitializeInstCombine undefined on import numba for CentOS 4

Created on 23 Nov 2018  路  3Comments  路  Source: librosa/librosa

centos4, python2.7.15
I've installed llvm6.0, and installed librosa with pip. But when I import librosa or numba, I got an error as follows

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/librosa/__init__.py", line 12, in <module>
    from . import core
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/librosa/core/__init__.py", line 109, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/librosa/core/time_frequency.py", line 10, in <module>
    from ..util.exceptions import ParameterError
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/librosa/util/__init__.py", line 69, in <module>
    from .matching import *  # pylint: disable=wildcard-import
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/librosa/util/matching.py", line 8, in <module>
    import numba
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/numba/__init__.py", line 11, in <module>
    from . import config, errors, runtests, types
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/numba/config.py", line 19, in <module>
    import llvmlite.binding as ll
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/llvmlite/binding/__init__.py", line 6, in <module>
    from .dylib import *
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/llvmlite/binding/dylib.py", line 4, in <module>
    from . import ffi
  File "/home/work/app/python2.7.15/lib/python2.7/site-packages/llvmlite/binding/ffi.py", line 128, in <module>
    raise e
OSError: /home/work/app/python2.7.15/lib/python2.7/site-packages/llvmlite/binding/libllvmlite.so: undefined symbol: LLVMInitializeInstCombine

don't tell me to update operating system, it's not gonna happen. help me pls.
I installed llvm following http://llvm.org/docs/GettingStarted.html, for options, I just installed Extra Clang Tools. I configured llvm using

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/work/app/llvm6/ ../llvm

here is some information you might consider useful:

$ nm /home/work/app/python2.7.15/lib/python2.7/site-packages/llvmlite/binding/libllvmlite.so | grep LLVMInitializeInstCombine
                 U LLVMInitializeInstCombine
00000000015a98e0 t _Z25LLVMInitializeInstCombineP22LLVMOpaquePassRegistry

$ ldd /home/work/app/python2.7.15/lib/python2.7/site-packages/llvmlite/binding/libllvmlite.so
    linux-vdso.so.1 (0x00007ffff0dff000)
    libz.so.1 => /opt/compiler/gcc-4.8.2/lib/libz.so.1 (0x00007f6ebbcb7000)
    librt.so.1 => /opt/compiler/gcc-4.8.2/lib/librt.so.1 (0x00007f6ebbaaf000)
    libdl.so.2 => /opt/compiler/gcc-4.8.2/lib/libdl.so.2 (0x00007f6ebb8ab000)
    libncurses.so.5 => /opt/compiler/gcc-4.8.2/lib/libncurses.so.5 (0x00007f6ebb657000)
    libpthread.so.0 => /opt/compiler/gcc-4.8.2/lib/libpthread.so.0 (0x00007f6ebb439000)
    libstdc++.so.6 => /opt/compiler/gcc-4.8.2/lib/libstdc++.so.6 (0x00007f6ebb136000)
    libm.so.6 => /opt/compiler/gcc-4.8.2/lib/libm.so.6 (0x00007f6ebae32000)
    libgcc_s.so.1 => /opt/compiler/gcc-4.8.2/lib/libgcc_s.so.1 (0x00007f6ebac1c000)
    libc.so.6 => /opt/compiler/gcc-4.8.2/lib/libc.so.6 (0x00007f6eba86f000)
    /opt/compiler/gcc-4.8.2/lib64/ld-linux-x86-64.so.2 (0x00007f6ebed4a000)
Upstreadependency bug wontfix

Most helpful comment

Numba depends on llvmlite which depends on LLVM. There was a bug in the 6.0.0 source release of LLVM which was patched in the conda package (llvmdev) with https://github.com/numba/llvmlite/blob/b36f161633240fb3e7dabb6e763fd5d122f7505c/conda-recipes/0001-Transforms-Add-missing-header-for-InstructionCombini.patch, using LLVM without this patch will result in the problem reported. Since then LLVM 7.0.0 has been released and this patch is not needed and more, however, other patches are required. llvmlite has instructions on how to build a suitable LLVM http://llvmlite.pydata.org/en/latest/admin-guide/install.html#compiling-llvm for use with Numba. However, both conda packages and wheels are tested and readily available and may be an easier way to get started.

All 3 comments

Please fill out the issue template, along with all software dependency versions so that we can properly diagnose your issue.

It does appear, however, that your problem is purely within numba, and not librosa per se, so you might have better luck asking over there.

Numba depends on llvmlite which depends on LLVM. There was a bug in the 6.0.0 source release of LLVM which was patched in the conda package (llvmdev) with https://github.com/numba/llvmlite/blob/b36f161633240fb3e7dabb6e763fd5d122f7505c/conda-recipes/0001-Transforms-Add-missing-header-for-InstructionCombini.patch, using LLVM without this patch will result in the problem reported. Since then LLVM 7.0.0 has been released and this patch is not needed and more, however, other patches are required. llvmlite has instructions on how to build a suitable LLVM http://llvmlite.pydata.org/en/latest/admin-guide/install.html#compiling-llvm for use with Numba. However, both conda packages and wheels are tested and readily available and may be an easier way to get started.

Since this is fixed upstream from us, I'm closing this out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sleglaive picture sleglaive  路  3Comments

Depansho picture Depansho  路  4Comments

ericdrobinson picture ericdrobinson  路  4Comments

mattc-eostar picture mattc-eostar  路  3Comments

alexandreCameron picture alexandreCameron  路  3Comments