llvmlite
llvmlite copied to clipboard
Feature request: run llvmlite on android
When running pip3 install numba
I get:
Requirement already satisfied: numpy<1.21,>=1.17 in /data/data/com.termux/files/usr/lib/python3.9/site-packages (from numba) (1.20.3) Requirement already satisfied: setuptools in /data/data/com.termux/files/usr/lib/python3.9/site-packages (from numba) (56.0.0) Using legacy 'setup.py install' for numba, since package 'wheel' is not installed. Using legacy 'setup.py install' for llvmlite, since package 'wheel' is not installed. Installing collected packages: llvmlite, numba Running setup.py install for llvmlite ... error ERROR: Command errored out with exit status 1: command: /data/data/com.termux/files/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-0oeyooa3/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/usr/include/python3.9/llvmlite cwd: /data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/ Complete output (14 lines): running install running build got version from file /data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/llvmlite/_version.py {'version': '0.37.0', 'full': 'd77dc1bcdb5af040c549f4d1ceeb4db7c8d08718'} running build_ext /data/data/com.termux/files/usr/bin/python3 /data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/ffi/build.py LLVM version... Traceback (most recent call last): File "/data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/ffi/build.py", line 220, in <module> main() File "/data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/ffi/build.py", line 210, in main main_posix('linux', '.so') File "/data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/ffi/build.py", line 134, in main_posix raise RuntimeError(msg) from None RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help. error: command '/data/data/com.termux/files/usr/bin/python3' failed with exit code 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /data/data/com.termux/files/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-68rfq9cy/llvmlite_0e6c1f574b22496692e567e14318404e/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-0oeyooa3/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/usr/include/python3.9/llvmlite Check the logs for full command output.
I am using python 3.9.6 and I can't solve this
@MajorRaccoon thank you for asking about this. What version of Pip are you using? Which operating system is this on? And what kind of hardware/chipset are you running?
@MajorRaccoon is this on an Android phone using termux
?
I spotted RuntimeError: Could not find a llvm-config binary.
in the error. Looks like pip
is trying to install llvmlite
from source because no wheels are available for the platform.
I spotted
RuntimeError: Could not find a llvm-config binary.
in the error. Looks likepip
is trying to installllvmlite
from source because no wheels are available for the platform.
Yes, I concur with that assessment. In such a case some kind of llvmdev
must be obtained first (compile or download) and also functioning compilers will be needed for the target platform that will be able to handle both llvmlite
and Numba
.
@MajorRaccoon is this on an Android phone using
termux
?
Yes it is. pip 21.2.4
@MajorRaccoon is this on an Android phone using
termux
?Yes it is. pip 21.2.4
Interesting. Well, AFAICR you are the first person to report having tried this. I am not sure what to recommend other than: keep trying, keep asking specific questions and let us know if you make it! Good luck!
xref: https://github.com/numba/numba/issues/4380 and https://github.com/numba/numba/issues/4444
I have updated the title of the issue to reflect more closely on the ask.
Could we use the llvmlite wheel packages for android developed by chaquopy ? https://chaquo.com/pypi-7.0/
Could we use the llvmlite wheel packages for android developed by chaquopy ? https://chaquo.com/pypi-7.0/
If there is a script and instructions on how to setup target hardware, this may very well be an option.
In short:
pkg install tur-repo
pkg install llvm-14
export LLVM_CONFIG=/data/data/com.termux/files/usr/opt/libllvm-14/bin/llvm-config
pip install llvmlite
Pasting it here, also as an aide-memoire, as I keep forgetting it when upgrading llvmlite...