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
LLVM_CONFIG=/usr/bin/llvm-config-3.7 pip install llvmlite
First check that you have the latest pip
version:
pip install -U pip
pip install -U wheel
Then install the following pacakges:
dnf install zlib zlib-devel libstdc++-devel libstdc++ libstdc++-static llvm-3.7.0 llvm-devel-3.7.0 libedit libedit-devel
pip install enum34 funcsigs
Then download and unzip llvmlite from the GIT repository. Suppose that you are downloading to /usr/local/llvmlite
then:
git clone <address-for-llvmlite.git> /usr/local/llvmlite
cd /usr/local/llvmlite
Build source as described here:
LLVM_CONFIG=/usr/bin/llvm-config python setupy.py build
Refresh terminal session and install built llvmlite
reset
LLVM_CONFIG=/usr/bin/llvm-config python setup.py install
Finally download and install numba
by
pip install numba
llvmlite version 0.9 or newer (I installed 0.10)
As stated in llvmlite's GitHub Page:
As of version 0.9, llvmlite requires LLVM 3.7. It does not support earlier or later versions of LLVM.
My solution, similar to the ones in other answers (but regarding python3):
To meet the dependencies: (like libedit
and compression libraries)
sudo apt-get install zlib1g zlib1g-dev libedit2 libedit-dev
sudo pip3 install enum34 funcsigs
llvm-3.7 (Other answers included llvm package, which nowadays installs version 3.6, not working)
sudo apt-get install llvm-3.7 llvm-3.7-dev llvm-3.7-runtime llvm-3.7-tools
Trying to install llvmlite from pip:
sudo pip3 install llvmlite
(If it works, skip this) If it doesn't work, like in my case, build the last master branch from their repository:
git clone https://github.com/numba/llvmlite
cd llvmlite/
sudo ch -c "LLVM_CONFIG=/usr/bin/config-3.7 python3 setup.py build
sudo sh -c "LLVM_CONFIG=/usr/bin/llvm-config-3.7 python3 setup.py install"
Finally, install numba:
sudo pip3 install numba
fisrt check that pip has the correct version:
pip install --upgrade pip
pip install --upgrade wheel
pip >= 8.1
$ pip --version
pip 8.1.1 from
$ wheel version
wheel 0.29.0
apt-get install llvm stuff:
sudo apt-get install zlib1g zlib1g-dev libedit2 libedit-dev
sudo apt-get install llvm-3.7 llvm-3.7-dev llvm-dev
and then with pip (warning llvmlite work only with llvm 3.7):
pip install enum34 funcsigs
LLVM_CONFIG=/usr/bin/llvm-config-3.7 pip install llvmlite
LLVM_CONFIG=/usr/bin/llvm-config-3.7 pip install numba