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 faster than llvmpy thanks to a much simpler architecture (the Numba test suite is twice faster than it was).
Compatibility
llvmlite has been tested with Python 3.9 – 3.12 and is likely to work with greater versions.
As of version 0.41.0, llvmlite requires LLVM 14.x.x on all architectures
Historical compatibility table:
llvmlite versions |
compatible LLVM versions |
---|---|
0.41.0 - … |
14.x.x |
0.40.0 - 0.40.1 |
11.x.x and 14.x.x (12.x.x and 13.x.x untested but may work) |
0.37.0 - 0.39.1 |
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.42.0rc1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df4068e11ff9c46072df7ace550765efe25deaad8fa75e7429cea57ad8b2d815 |
|
MD5 | 038d4f39cf4b40e1abb184c26f586dba |
|
BLAKE2b-256 | 6ddbcef7742d26e26312a48069e3cdfcd869f6b998bae537ce347ea8b2d209db |
Hashes for llvmlite-0.42.0rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f59485b2d9db140350366e1566fbfbd378ce34e0c013cb72d432bb8af1a6c889 |
|
MD5 | 02077970da062c62288287d444a766c1 |
|
BLAKE2b-256 | 36b04d273e3332c08966ad1289d0623d2970e46c62a65c1c52a7998b73e3e710 |
Hashes for llvmlite-0.42.0rc1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fbed1ef1463a7339d917efd144045b6b8e05af840a970d375c8ec42ae383e8d |
|
MD5 | fd167cfe7172caa4c4004544f29a5e96 |
|
BLAKE2b-256 | 2af4270fc62fe028f0dbea48a94272f904c12580c4d86ad92d2cb2e61f1b385a |
Hashes for llvmlite-0.42.0rc1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfa847d8f0ef9665e3e20270b3ef136cdbcef49d085208ff303a98c2674aef62 |
|
MD5 | 4b91fc5d187dfc76419afca40991eec1 |
|
BLAKE2b-256 | 75fa072887ed477f653328bab86ce828d1fd4c521003ba445c40b82c30b4a73b |
Hashes for llvmlite-0.42.0rc1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9920c847d828593626023a5789ad269751667ab006be6e6643a084db35b332a2 |
|
MD5 | f73f6c3b3752ff7763b07497da00c4a9 |
|
BLAKE2b-256 | e4f1d53d6ac40768675dc5132075f40cbb4da8f5badf4552003b68925d05d9df |
Hashes for llvmlite-0.42.0rc1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 399e98514c54860c46ff722f08b9b0803aa68540d94149f1ac7efe5429068691 |
|
MD5 | e03843cb8d5def882e64cf4051cf9a9e |
|
BLAKE2b-256 | 8bb99ddc5937969710907ab50deab2277392a5654753b8612964946ccbb8f107 |
Hashes for llvmlite-0.42.0rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a52b4b53842a39e118c1ff536350da9b3869f2dff076cfae1bb76ab702c59188 |
|
MD5 | 9c3c5029084965da7f6945510d45a4d0 |
|
BLAKE2b-256 | 446135a70ed6f05887b31dc62f3a9fc4366f550ad5dd8b1eb7e4cea373167ca4 |
Hashes for llvmlite-0.42.0rc1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c10c55be06f2cd7f36c5e69aef05cc4463bc30d998eea49ef39579370301244 |
|
MD5 | 6c4eb85dabc0be3b5624fdbb6899346a |
|
BLAKE2b-256 | f2f10c028abdc54d50d8ac6a95c7d564296eda2368c17c7e7ef6f484012ce306 |
Hashes for llvmlite-0.42.0rc1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ef844e95c5b57d5c569ec5cfc7b440924878134f1a801b3f43e79a91a13cef0 |
|
MD5 | a1dc98b7ba1a72c62fe69a89e608bf1c |
|
BLAKE2b-256 | e8c0b6f96de6cbb4351e32417c06b372b9729773437cab25a17fda1432c52965 |
Hashes for llvmlite-0.42.0rc1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c318e8145bef02a8ddc34418041f655b3b49fbaf66b996b4a1afca66fe58941b |
|
MD5 | 8c0c6299424ae430ca486a2e9112d733 |
|
BLAKE2b-256 | 23d1d8eec60a64f041d79acc0c7f2c92946e3a5d78269fdb88f7bfcd340208f4 |
Hashes for llvmlite-0.42.0rc1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 959f005565092ef4dd6f5bc5fe32ce1aaf97a02b45f34e39df6e2d200779935f |
|
MD5 | 76ce8ba5aeafc4d150cd1d10add953d4 |
|
BLAKE2b-256 | 2470323d73ef187f465d9cee9eebf1c9d4a3631c3aa4899c174f247e0f35ea54 |
Hashes for llvmlite-0.42.0rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93bd9d9e81ab3d8096eac3ced83b75eaca39fe9ef51fa1a51a993e9408030f33 |
|
MD5 | d29cf800cc652e7bd8a02db800764534 |
|
BLAKE2b-256 | 6b5faad0736d3897469143e83ea7c04c1ad0df6c119b0d56389f325ab046902e |
Hashes for llvmlite-0.42.0rc1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c69a2d9f8020f19c5f0455685a83990777c117208275195763f3a9533ac24233 |
|
MD5 | aae048799c9290a6361ddc152b264160 |
|
BLAKE2b-256 | 712d8614168824f15cef4dc507400099abe4be3ec2395c8ef54b41f4e6828d6c |
Hashes for llvmlite-0.42.0rc1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e643e7817cd8c99b9d2d2dfdfa9c147127bc011787cda6f6c462e38af142c8be |
|
MD5 | fb24131a024e842c773795f8e62d05e6 |
|
BLAKE2b-256 | 51f71b3fcae19327c5f5118942061f9bcb72d9be0e3d1cc5aba8160d9d4def3b |
Hashes for llvmlite-0.42.0rc1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59ca5d262d23a0aee7ede2eb7fed7f3df6d6b78de79136fe9898ea888ec89e05 |
|
MD5 | c8ce468ba29081e5ebd63e94fb5200e6 |
|
BLAKE2b-256 | a1b8872772cd7df42c8902f7db1d9340621ecb97a263168d120290d3e1b0d94f |
Hashes for llvmlite-0.42.0rc1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebb5db67cbc1437dafea2bdb585516d5bb2a52af1b00f0d0ea0890c80503bbf8 |
|
MD5 | c8014d8468cdbe3cce64989ed5e8d92a |
|
BLAKE2b-256 | 09c52a688f2dc811d0f07f2a62191ff74094307d66cd4e8cd8e64a47bc01406f |
Hashes for llvmlite-0.42.0rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8a6584bf556542f6aeb6ee91adb00cbaf78d50f07e0be63e6e5aff21f7cdffd |
|
MD5 | d802a2a870b1b441632ab6aa8d230c20 |
|
BLAKE2b-256 | a9cdf68cb74b3ecaeded8e81598c27871f0914ed43d6a9d0e5eaaf0fc4a9a15c |
Hashes for llvmlite-0.42.0rc1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd46f7b03f172131ee8d33e15da23ca2cfa7c53c9cdef777bf86f4cbba33e20b |
|
MD5 | ca512d216a680e2b469102c3663eac03 |
|
BLAKE2b-256 | 69166cdea7139ef7cad3906946e347f0d61f7cec7a7ec27b97f88b7a084435b2 |
Hashes for llvmlite-0.42.0rc1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 971ff50e4e7f287b796fa527106648808cfd7e4ea34a391b379beb0c58a46b4a |
|
MD5 | b5bf8b5e2dde8126bfb6d010d2445e7b |
|
BLAKE2b-256 | 9fce7885a4ebe63b8bd273df9862c8f6911dca81c57ccc362459d40e392bb0f6 |
Hashes for llvmlite-0.42.0rc1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3ade537d62a30cda772327fc34f902af42b138e8c9d73b2960c2d4046dfdc39 |
|
MD5 | 8000a02c111b65900af3d79d34852dcf |
|
BLAKE2b-256 | 9a65990cae5efa46601ff3411de296905d6e1a83826dc6a3c2162372b0b42de3 |