Getting python Numba working on Ubuntu 14.10 or Fedora 21 with python 2.7

前端 未结 10 1907
甜味超标
甜味超标 2020-12-15 04:07

Recently, I have had a frustrating time to get python Numba working on Ubuntu or Fedora Linux. The main problem has been with the compilation of llvmlite. What do I need to

相关标签:
10条回答
  • 2020-12-15 04:43

    Initially I didn't get it working with the comments here and then I found out: 1. meanwhile llvm 3.6 instead of 3.5 is needed and 2. for me the LLVM_CONFIG env variable doesn't work. So I installed numba like this:

    sudo apt-get install zlib1g zlib1g-dev libedit-dev llvm-3.6 llvm-3.6-dev llvm-3.6-runtime llvm-3.6-tools
    sudo pip install enum34 funcsigs
    sudo mv /usr/bin/llvm-config /usr/bin/llvm-config_bak
    sudo ln -s /usr/bin/llvm-config-3.6 /usr/bin/llvm-config
    sudo pip install llvmlite
    sudo pip install numba
    sudo mv /usr/bin/llvm-config_bak /usr/bin/llvm-config
    

    (Tried on Ubuntu 14.04.)

    0 讨论(0)
  • 2020-12-15 04:44

    In case anyone else recently had this problem, according to their github page...

    "llvmlite works with Python 2.7 and Python 3.4 or greater. As of version 0.17.0, llvmlite requires LLVM 4.0. It does not support earlier or later versions of LLVM.

    They have a compatibility table of what works with what. All recent packages can be gotten from their webpage.

    0 讨论(0)
  • 2020-12-15 04:45

    The versions I got working at the end were numba-0.17.0 (also 0.18.2) and llvmlite-0.2.2 (also 0.4.0). Here are the relevant dependencies and configuration options on Ubuntu and Fedora.

    For Ubuntu 14.04 *Trusty)

    sudo apt-get install zlib1g zlib1g-dev libedit libedit-dev llvm-3.8 llvm-3.8-dev llvm-dev
    sudo pip install enum34 funcsigs
    LLVM_CONFIG=/usr/bin/llvm-config-3.8 pip install llvmlite --user
    LLVM_CONFIG=/usr/bin/llvm-config-3.8 pip install numba --user
    

    For Ubuntu 14.10

    sudo apt-get install zlib1g zlib1g-dev libedit libedit-dev llvm-3.5 llvm-3.5-dev llvm-dev
    pip install enum34 funcsigs
    LLVM_CONFIG=/usr/bin/llvm-config-3.5 pip install llvmlite
    LLVM_CONFIG=/usr/bin/llvm-config-3.5 pip install numba
    

    For Ubuntu 15.04

    sudo apt-get install zlib1g zlib1g-dev libedit2 libedit-dev llvm-3.6 llvm-3.6-dev llvm-dev
    pip install enum34 funcsigs
    LLVM_CONFIG=/usr/bin/llvm-config-3.6 pip install llvmlite
    LLVM_CONFIG=/usr/bin/llvm-config-3.6 pip install numba
    

    For Fedora 21

    yum install zlib zlib-devel libstdc++-devel libstdc++ libstdc++-static llvm-3.5.0 llvm-devel-3.5.0 libedit libedit-devel
    pip install enum34 funcsigs
    LLVM_CONFIG=/usr/bin/llvm-config pip install llvmlite
    LLVM_CONFIG=/usr/bin/llvm-config pip install numba
    

    Note: this was originally posted by the OP in the question—moved here to keep this fit for SO.

    0 讨论(0)
  • 2020-12-15 04:46

    For Ubuntu 14.04 I managed to install with this:

    export LDFLAGS="-std=gnu++11 -fPIC"
    
    LLVM_CONFIG=/usr/bin/llvm-config-7 pip install llvmlite
    
    LLVM_CONFIG=/usr/bin/llvm-config-7 pip install numba
    
    0 讨论(0)
  • 2020-12-15 04:47

    For Ubuntu 16.04

    sudo pip3 install llvmlite
    

    explicitly requests llvm version 3.9.

    But in the official packages, there is (currently) only llvm up to version 3.8. The solution is to install it like this

    Then you can run LLVM_CONFIG=/usr/bin/llvm-config-3.9 sudo pip3 install llvmlite

    0 讨论(0)
  • 2020-12-15 04:48

    There was a change in llvmlite. Since version llvmlite-0.6.0 llvm-3.6 is required. The correct installation is now:

    sudo apt-get install zlib1g zlib1g-dev libedit2 libedit-dev llvm-3.6 llvm-3.6-dev llvm-dev
    pip install enum34 funcsigs
    LLVM_CONFIG=/usr/bin/llvm-config-3.6 pip install llvmlite
    LLVM_CONFIG=/usr/bin/llvm-config-3.6 pip install numba
    
    0 讨论(0)
提交回复
热议问题