lightweight wrapper around basic LLVM functionality
Project description
A Lightweight LLVM Python Binding for Writing JIT Compilers
llvmlite is a project originally tailored for Numba’s needs, using the following approach:
A small C wrapper around the parts of the LLVM C++ API we need that are not already exposed by the LLVM C API.
A ctypes Python wrapper around the C API.
A pure Python implementation of the subset of the LLVM IR builder that we need for Numba.
Why llvmlite
The old llvmpy binding exposes a lot of LLVM APIs but the mapping of C++-style memory management to Python is error prone. Numba and many JIT compilers do not need a full LLVM API. Only the IR builder, optimizer, and JIT compiler APIs are necessary.
Key Benefits
The IR builder is pure Python code and decoupled from LLVM’s frequently-changing C++ APIs.
Materializing a LLVM module calls LLVM’s IR parser which provides better error messages than step-by-step IR building through the C++ API (no more segfaults or process aborts).
Most of llvmlite uses the LLVM C API which is small but very stable (low maintenance when changing LLVM version).
The binding is not a Python C-extension, but a plain DLL accessed using ctypes (no need to wrestle with Python’s compiler requirements and C++ 11 compatibility).
The Python binding layer has sane memory management.
llvmlite is quite faster than llvmpy’s thanks to a much simpler architeture (the Numba test suite is twice faster than it was).
llvmpy Compatibility Layer
The llvmlite.llvmpy namespace provides a minimal llvmpy compatibility layer.
Compatibility
llvmlite works with Python 3.7 and greater.
As of version 0.37.0, llvmlite requires LLVM 11.x.x on all architectures
Historical compatibility table:
llvmlite versions |
compatible LLVM versions |
---|---|
0.37.0 - … |
11.x.x |
0.34.0 - 0.36.0 |
10.0.x (9.0.x for aarch64 only) |
0.33.0 |
9.0.x |
0.29.0 - 0.32.0 |
7.0.x, 7.1.x, 8.0.x |
0.27.0 - 0.28.0 |
7.0.x |
0.23.0 - 0.26.0 |
6.0.x |
0.21.0 - 0.22.0 |
5.0.x |
0.17.0 - 0.20.0 |
4.0.x |
0.16.0 - 0.17.0 |
3.9.x |
0.13.0 - 0.15.0 |
3.8.x |
0.9.0 - 0.12.1 |
3.7.x |
0.6.0 - 0.8.0 |
3.6.x |
0.1.0 - 0.5.1 |
3.5.x |
Documentation
You’ll find the documentation at http://llvmlite.pydata.org
Pre-built binaries
We recommend you use the binaries provided by the Numba team for the Conda package manager. You can find them in Numba’s anaconda.org channel. For example:
$ conda install --channel=numba llvmlite
(or, simply, the official llvmlite package provided in the Anaconda distribution)
Other build methods
If you don’t want to use our pre-built packages, you can compile and install llvmlite yourself. The documentation will teach you how: http://llvmlite.pydata.org/en/latest/install/index.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for llvmlite-0.37.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7449acca596f45e9e12b20c0b72d184f83025341cc2d44d7ccf5fe31356dcd08 |
|
MD5 | e2d46131a28e8c80c4631f1499090328 |
|
BLAKE2b-256 | 46878b4711db8b691e30cfe6d6d07fed54f4de8afc7b31ac5f600bfdf18a50e7 |
Hashes for llvmlite-0.37.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 995c1a2c8b6a11a7f2c66e52576de6a28292d37842d383aae5be7b965b56d10f |
|
MD5 | 5df6c1441ab4e5cae0f325a2acb22370 |
|
BLAKE2b-256 | 6b57c6b2cad63fee3cfa88b178506b13aaaff076bf0bec09d6f5e7fd8ff85456 |
Hashes for llvmlite-0.37.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4616e17914fcc7c5bfb7d1014acbd4fca478949820e86218a29d9473d0aa221b |
|
MD5 | 4871221544f09008b6c9a72493b2ca21 |
|
BLAKE2b-256 | fe51af0842a901b6871d232634dc5c2368f60f73194053479575760f0f4ac117 |
Hashes for llvmlite-0.37.0-cp39-cp39-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6466d6369051e5c083b15cf285c00595ddb7f828be1ebecb1dfb97f3fab0bff |
|
MD5 | cd9a47be57bfcef6e2a94d9929dce4fa |
|
BLAKE2b-256 | 7c0fcd92d2a38e83dcf0296082afb2fb9465218e1a21b3614cc8e287725ccefc |
Hashes for llvmlite-0.37.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c1e91fd4ba2764161e9a05b6fff46a52d26170186bad99629777e8c7246f0ef |
|
MD5 | 1b25bce10edb18a5233985d67508cc02 |
|
BLAKE2b-256 | 50f3582ca78f683a4e1bebc0cc4409d483360ca5831cb546653c44bac114babd |
Hashes for llvmlite-0.37.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c92a209439fd0b8a41f6e2aba1d3afa260357028a29ed7db8c602c4d67c21540 |
|
MD5 | 289dcb1fd5823ab9c04e29cec2afa8cb |
|
BLAKE2b-256 | c510c38947649c49272cac2237e84611d80e367da1cc95e8d6cacd5d02880029 |
Hashes for llvmlite-0.37.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 794191922ac6414c55d66058eaba8b88a630c6e9f2cf0db7e8e661e74d71fa14 |
|
MD5 | dcb9f577d8a697ae8d701928dd68f666 |
|
BLAKE2b-256 | fcdd98763775ba5bbb834455bffbd4ffe04954d5489d29ad1b32fa95b4dbde80 |
Hashes for llvmlite-0.37.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30431fe9a9b7b1c3585b71149cc11dc79b9d62dc86d3db15c3dcca33d274b5be |
|
MD5 | 857737bfb624df073e8e1c44bd981682 |
|
BLAKE2b-256 | a38b285fe1b62b0e458fa8c15d81c65296b312eb72c891aeb42e925c128bc363 |
Hashes for llvmlite-0.37.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df1d1b162a426480b37d6c4adeddff49e2fb9f71b307c7facac67bdce4767746 |
|
MD5 | 71ba69fe845a73d7f093a0d5e9d6e36f |
|
BLAKE2b-256 | 312defcea36e628856c63455d256efc5240d856302c84c91957cd1397bd7ebb8 |
Hashes for llvmlite-0.37.0-cp38-cp38-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57c1dae337863b497c141d40736041d4acb7769226b44fe05959fce3c3570d5d |
|
MD5 | f0496b65caeecd7351c5fffc9c48fc84 |
|
BLAKE2b-256 | 9f9ffdb015d87a4457b72de699987e6614291cf49394fba91ddd58f209369388 |
Hashes for llvmlite-0.37.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab00b7996e5ef795f59d95d3125850f3af28d19e43bdc08473947cb8045ce098 |
|
MD5 | d06c53a51993ab8131466b7d926a5164 |
|
BLAKE2b-256 | 6d496c60d6c1413bffdbf384092320f1fb4dab431c28b446fbe4721cccae0480 |
Hashes for llvmlite-0.37.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d31a3bd69894b31bbc68df00e0b37b0980a0cf025f9dbea9cdd37988230c33a3 |
|
MD5 | 24eb83abf0e7c70f457956651da7359b |
|
BLAKE2b-256 | 82e99f655eb2d542c0c6068c4650fe8e697dab65013f1c71ded53e673e35be9a |
Hashes for llvmlite-0.37.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15b8ac7a489e31b7d5c482193edaa44374e3c18e409bea494224e31eb60e38e5 |
|
MD5 | 916d4f92ed46a59ea4808e5b676ababa |
|
BLAKE2b-256 | 840395c0cf30733316704d3bbe9b104a54269feaaebe6127c364a570bc15fcae |
Hashes for llvmlite-0.37.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14030a1c0f9aee0185db069163240c51d4e8a3eec0daf02468e057281dee612b |
|
MD5 | 986b17e002698804aa2172843f8c862d |
|
BLAKE2b-256 | 180552b3974a154ad46f96c443c4e63402eac6a6ac9c5d6d1cd4d815384e54a7 |
Hashes for llvmlite-0.37.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9e84d683943c2f636b08db9b2d182d4b40b83e1a3e31e100af3bb9ed8d94bcd |
|
MD5 | 120d7c3eaf5ca43243cc58f43a21f5cd |
|
BLAKE2b-256 | db6fabe6b4dffcb82f02b763da96f017119b381e7c413f160adbd43b23d8770f |
Hashes for llvmlite-0.37.0-cp37-cp37m-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 447b01c25d18921c4179f2eccba218d7c82b65cfe3952b0d018d569945427bf9 |
|
MD5 | 58d46bc119d706d7fd1012ed7a0ddcf9 |
|
BLAKE2b-256 | 42496fca23ad3793ff7437b56cc7ae91a43fbf2669d89a3ca250a27a20e1b480 |
Hashes for llvmlite-0.37.0-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74b6c3d2eb8cef32a09e8fd7637d0d37628c74f4deedf9361e0c0ebecc239208 |
|
MD5 | b29c74393b667936dd33a9318dc9265d |
|
BLAKE2b-256 | de5fbb9ae33a28e3d455f09557884e9f320e7b0b98d85a3d38c1fcc2b84c09cc |
Hashes for llvmlite-0.37.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf7d623d33d24df51adc4e9e9f5734df752330661793d1662425ad2e926cb2d4 |
|
MD5 | c020a43e76df7a9e937013b36617feb1 |
|
BLAKE2b-256 | 87e4d63c2360e8e14437a5002822d9e53ab6f2043cc6ae9ea4a6689fbd726fda |