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.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05cb7e9b6ce69165ce4d1b994fbdedca0c62492e537b0cc86141b6e2c78d5888 |
|
MD5 | f651cf3b61e97f769813f7195c63c9dd |
|
BLAKE2b-256 | 5301cdd6dc60080f94fdec506cfbc4044277b6abc90862ba3fc32e1b4f4f54f6 |
Hashes for llvmlite-0.42.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d47494552559e00d81bfb836cf1c4d5a5062e54102cc5767d5aa1e77ccd2505c |
|
MD5 | c4e0140f0c1b81f03b45ef2dcb66e2a0 |
|
BLAKE2b-256 | 62afc3df8a3f26c3cff7730ab1cb7c7a4c899f8c4fb4acd9020150d1599575ac |
Hashes for llvmlite-0.42.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebe66a86dc44634b59a3bc860c7b20d26d9aaffcd30364ebe8ba79161a9121f4 |
|
MD5 | 98bf1cf87964cfe313a98ff491feffa2 |
|
BLAKE2b-256 | 9ac57a1716343ad90204fde896bc052707bc6946cc32a52616d141e494d518a3 |
Hashes for llvmlite-0.42.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2fce7d355068494d1e42202c7aff25d50c462584233013eb4470c33b995e3ee |
|
MD5 | 0875b6da68b30e21d9db137ad4c9d6e8 |
|
BLAKE2b-256 | 7b1b0fc1895fd6ae3b50775aaee42221668e0d04927b386d8e56940710e63b1f |
Hashes for llvmlite-0.42.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08fa9ab02b0d0179c688a4216b8939138266519aaa0aa94f1195a8542faedb56 |
|
MD5 | 68e3044548d5abf54c5915a9ca63eade |
|
BLAKE2b-256 | dc942d3a9d784738947462c3f2c761c5ced225866f7e762ce4253c6cc2c4c4e5 |
Hashes for llvmlite-0.42.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e0c4c11c8c2aa9b0701f91b799cb9134a6a6de51444eff5a9087fc7c1384275 |
|
MD5 | 48443e027d207c609d1225cdb6ec1f81 |
|
BLAKE2b-256 | f3bd3b27a1c8bbbe01b053f5e0c9ca9a37dbc3e39282dfcf596d143ad389f156 |
Hashes for llvmlite-0.42.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5bece0cdf77f22379f19b1959ccd7aee518afa4afbd3656c6365865f84903f9 |
|
MD5 | 0f7182c854b3c285c344ad8a00f18312 |
|
BLAKE2b-256 | a41f300788b5eab99aec872ed2f3647386d7d7f7bbf4f99c91e9e023b404ff7f |
Hashes for llvmlite-0.42.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb3975787f13eb97629052edb5017f6c170eebc1c14a0433e8089e5db43bcce6 |
|
MD5 | 5d89f88d0b45b6598fb3d03750dec1ea |
|
BLAKE2b-256 | e10b4f9c7479137280bf868ee6f9bfe4540cd5f5d5522ecf72662e9ad78a153e |
Hashes for llvmlite-0.42.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81e674c2fe85576e6c4474e8c7e7aba7901ac0196e864fe7985492b737dbab65 |
|
MD5 | 4f12b26d450e34974970c151eb1eaeff |
|
BLAKE2b-256 | ba3a286d01191e62ddbe645d4a3f1e0d96106a98d3fd7f82441d20ffe93ab669 |
Hashes for llvmlite-0.42.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae511caed28beaf1252dbaf5f40e663f533b79ceb408c874c01754cafabb9cbf |
|
MD5 | f8356ebfd979bcfd0df0df135509384c |
|
BLAKE2b-256 | 13974aac09bdfc1bc35f8eb64e21ff5897224a788170e5e8cab3e62c9eb78efb |
Hashes for llvmlite-0.42.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d90edf400b4ceb3a0e776b6c6e4656d05c7187c439587e06f86afceb66d2be5 |
|
MD5 | a96939bb32b9545f32afd5ca32e63766 |
|
BLAKE2b-256 | e0a270e18cab31b707ff62c5dd4f5ed6ea88f553ba3a8e40ce99aefb8e056af1 |
Hashes for llvmlite-0.42.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 763f8d8717a9073b9e0246998de89929071d15b47f254c10eef2310b9aac033d |
|
MD5 | 8c4c486026434589f27d41814276435a |
|
BLAKE2b-256 | 2b01764489e364948f52aa7cb958a91a8dafd489357d2401f66946542bbc1764 |
Hashes for llvmlite-0.42.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70f44ccc3c6220bd23e0ba698a63ec2a7d3205da0d848804807f37fc243e3f77 |
|
MD5 | 2e0d9ec9a53d4c3cfb8904ab115d405f |
|
BLAKE2b-256 | 0ae4bce6de49651ade8b47ed7f0c11366d49be1bad752fbf16c1976545d389fa |
Hashes for llvmlite-0.42.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c35da49666a21185d21b551fc3caf46a935d54d66969d32d72af109b5e7d2b6f |
|
MD5 | cec39ced831493ba84ad09e373b8aa2b |
|
BLAKE2b-256 | 4fc3aa006e8cbd02e756352342146dc95d6d5880bc32d566be8f0c0e0f202796 |
Hashes for llvmlite-0.42.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3366938e1bf63d26c34fbfb4c8e8d2ded57d11e0567d5bb243d89aab1eb56098 |
|
MD5 | d7e080e41d703500a2a1cf9a64b1c0bd |
|
BLAKE2b-256 | 3899d5058a83c9e4c3ed9d895b5fcbcd805bea83f4a38cda90a29dd778ff755e |
Hashes for llvmlite-0.42.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43d65cc4e206c2e902c1004dd5418417c4efa6c1d04df05c6c5675a27e8ca90e |
|
MD5 | f220abbac243a9d24e617f320ff49d5e |
|
BLAKE2b-256 | 5d9be80d248a56224b01cc791f2ca66ef1ec790ef61e1ef588339abc0a30a9e8 |
Hashes for llvmlite-0.42.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7599b65c7af7abbc978dbf345712c60fd596aa5670496561cc10e8a71cebfb2 |
|
MD5 | 35ce68fe42e8511a47c6be029c19085a |
|
BLAKE2b-256 | 3d0b8189f705f5b622c7b670223552a9a4d748ca95fd1acaf957b80384fe4cd3 |
Hashes for llvmlite-0.42.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a78ab89f1924fc11482209f6799a7a3fc74ddc80425a7a3e0e8174af0e9e2301 |
|
MD5 | 89ea989887032885698dc641b257ccdc |
|
BLAKE2b-256 | 8df6b75a5c70293a5689b64078bd6efaf5d895fc3fa8f88ab9ab3c0ffdc207f5 |
Hashes for llvmlite-0.42.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0936c2067a67fb8816c908d5457d63eba3e2b17e515c5fe00e5ee2bace06040 |
|
MD5 | 1d6b60b837e97bc1face3431c7361c5e |
|
BLAKE2b-256 | b8e74afe1a4b447f4c0a7047420ae4080877f5cd2858d1b37d1ea402d8cd0400 |
Hashes for llvmlite-0.42.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdd3888544538a94d7ec99e7c62a0cdd8833609c85f0c23fcb6c5c591aec60ad |
|
MD5 | b63a022f6a7203c1c2d6e31f928c94ba |
|
BLAKE2b-256 | 4ee86ec701f12044cc6307dfb5e6f7a43b8714e9bb18d88b02e450713d896537 |