lightweight wrapper around basic LLVM functionality
Project description
A lightweight LLVM python binding for writing JIT compilers
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.
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.
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 2.7 and Python 3.4 or greater.
As of version 0.29.0, llvmlite requires LLVM 7.0.x or later
Historical compatibility table:
llvmlite versions |
compatible LLVM versions |
---|---|
0.29.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.31.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 947b81539aa751ff627626172a3bdb0ba0a92bfd1de1847f4c1ad7928ea2ea70 |
|
MD5 | 293a60febbdb2046a7c64b52953eb9c5 |
|
BLAKE2b-256 | 71970b6ef25e02d51d998af608e502c76ca9325b146a33ae40066a00b0c34192 |
Hashes for llvmlite-0.31.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3601a869da83e5fb1abbe55ecfcecb957f9d899179a4ef66fc4b3b82b461fc5a |
|
MD5 | b5809fbac322a12eadfc2549aaee84e2 |
|
BLAKE2b-256 | 47eaab67b980f3ff4619e922d7f1eb20cd8a7c1a66917f9f690e892dc96e7d69 |
Hashes for llvmlite-0.31.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a917b1b27895d0707078028ae842b3184e617ac04014965b197212e00d8e057 |
|
MD5 | aa088895a61af7c4897eda3cb051a3bb |
|
BLAKE2b-256 | 62c94de96d048ecead190d19366a691a50e2d8c686d8619af49eabb6b9b2ce18 |
Hashes for llvmlite-0.31.0-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e8154d1496a58157652fad1b13d817f73db80eb85b5915d49a9573a26655e38 |
|
MD5 | 9e676d947d07555b3e4bf2e3a16232ec |
|
BLAKE2b-256 | 401121c44cac82cd4332107ac232020374c0ba30bf3b956e956e9d4bd1a0e213 |
Hashes for llvmlite-0.31.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5593acefd5f01765ee403ea4b0288a59aff2276eb8f5241deb2e52018219a66a |
|
MD5 | 8979dca94dd5f9c9b2e03a44a4d2c496 |
|
BLAKE2b-256 | b9c3f5a53c8352a6a1576097904feae12d12f8081ba653962a15b126426a47f1 |
Hashes for llvmlite-0.31.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 363738f3eb3c6bed65cac38f295ff81a19a74e5aeab3d02e4e3b820279d8e36a |
|
MD5 | 0af4f19a681099308f58a9db121d2c7c |
|
BLAKE2b-256 | 1d83cd2843726a6316e372822e9e42cd0083b6d1d98d89d53880e7e67d5eec68 |
Hashes for llvmlite-0.31.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2a4e62b9f703bb669bb78ca45202dfedf6a1df000866d3ed694f29a85a73f4f |
|
MD5 | 0f7cc565dc379ff8f8132e87dd85f0cd |
|
BLAKE2b-256 | 665a2b3269422161ea77f18f03ddb440c1a2e4bee18678e59a5aff398845eeed |
Hashes for llvmlite-0.31.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81fc9ac6682a41f53bca113a8f97959b92728112f91714e850a72dc6d9dd8ced |
|
MD5 | 3425d749a3c1a4a68cd562da8257b87c |
|
BLAKE2b-256 | a010d02c0ac683fc47ecda3426249509cf771d748b6a2c0e9d5ebbee76a7b80a |
Hashes for llvmlite-0.31.0-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c676a549f44e559d7406824de83f659995b13b80c18aca4760981c9049a1a2d |
|
MD5 | 97204be471db1e4a79a923f862925ce0 |
|
BLAKE2b-256 | 6a095dc38db66f5bcb93bbc220f4ffdb2bd91154a8fd8173f3ea0fd4b4cdda4a |
Hashes for llvmlite-0.31.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d45b733f5ac76838a20c56d19d6a3032b856c2cedf7a65ce2a4e8a45f4062f93 |
|
MD5 | 3c35b67756c1aeb79c0f6d07b0a2fdd8 |
|
BLAKE2b-256 | 6d813ef1bf97adac4f200a7ff61a6c0be52f7eab9c4f8807edb494b72ec2674a |
Hashes for llvmlite-0.31.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f4bffdf6cb4f5bab4060ea57cdc11344d9b406227efb8ae1c5e4823e8d146d1 |
|
MD5 | 3dd00c3e97d81a41006bbf0217ba28cd |
|
BLAKE2b-256 | 41f71aff7e7bd1fbfe036b1274db43006162db95df2762a831480fa85ee294ed |
Hashes for llvmlite-0.31.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94c5c625088a9ddc0fcd2953f1e7cd94038e3c90b24522a5ba10559b2dd7f563 |
|
MD5 | 98cacefdaea2ec6492fe794fb6bfd616 |
|
BLAKE2b-256 | 07634c97e31ce9c9c4a357187f814932bcea376abded37377fbbf1fd65884ab3 |
Hashes for llvmlite-0.31.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebc86e3bb85fd2ad7f88ce80507350814719195d7555a802cd628713d3c08883 |
|
MD5 | a0b56e4db9b9a80bb5807308a503bb9e |
|
BLAKE2b-256 | adbb60d4033d56c9da36490af19caa6c794b72b8aef6f792fdfa8cb95d11e419 |
Hashes for llvmlite-0.31.0-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8189c8ad167ef8a65f4bbf9cbff19efbec7f0392996eec18f5e6b274462111b7 |
|
MD5 | 231bbadf296b711f1de094b7939fc1ef |
|
BLAKE2b-256 | 1f0f2d9c4d629d1212ea432f360b93446fd1e3af634c5695b6223711388cb646 |
Hashes for llvmlite-0.31.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 312cca3af9f539a81432cd47f06a621d895c21e8cb1db2f9cfb22acd7fb69fa5 |
|
MD5 | 5eaf901cb199216adb466e8f7aa9e459 |
|
BLAKE2b-256 | bee735e54bd7718e97cc6c3fcfb9dddbf743d273bb9ce38e4f89a3c6bc9c27a3 |
Hashes for llvmlite-0.31.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bcbb90807a42cd7f47d32e25e270a6886f89ae6783059ee3e1e4aa13d13f2a0 |
|
MD5 | b058fafe21fbcaa84971b661fdfc302e |
|
BLAKE2b-256 | 371bc502ad9234d332164ebab163970b96d841caaab11d618194a8d19d839e12 |
Hashes for llvmlite-0.31.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6699b0e6637f4f8624c2dd069b7b427da582f7ca3900f080bfebb5ff556272bd |
|
MD5 | 772fb4bc515333ced8ccfbb00cbebf95 |
|
BLAKE2b-256 | 075e0de02fcca34cf13071086fb8b374a4ef28b0b88d36bef3087253fca08f92 |
Hashes for llvmlite-0.31.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdba22341cefbdd7b8d57cc23256b5d5ab16faa64d744d66ecae6a0af86b1f9b |
|
MD5 | 57b9e0d1ca19df2df5ecf802938e160b |
|
BLAKE2b-256 | ab7daccde4254f32a5b9f2d354a85e50158f955363a5b5bbe7cc6c64f6f26c26 |
Hashes for llvmlite-0.31.0-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c842b722a38370ef5836e16cf73981da8f2f3765cead55b2d51fc87c65840f70 |
|
MD5 | fa66e14c3ea5b309267fada162b38439 |
|
BLAKE2b-256 | f7a51653ce3de5def703c50358db16975d5ec4205ffaf005d004f45370ceca61 |
Hashes for llvmlite-0.31.0-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 607fb3738cdc803ffcc69ef3732595f7c66c203c5a7eea35b26f89822fb2baaa |
|
MD5 | 60cc7345e2a746bfb23f5330043bff78 |
|
BLAKE2b-256 | 1031aa315fbc2e0b7777b95ce166b7c988f53e4cdd4c33d06eea24f395539eb4 |
Hashes for llvmlite-0.31.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a771ae6398c24117797e9fa0fa70def5334eeab918beaafd40718e80e5f936a |
|
MD5 | 1c52774a8b6080d20db7b0031d9a9536 |
|
BLAKE2b-256 | 910790cd9cdd43b287960b16dbf7929bff2267dc0b6647e8e0117a4937b19620 |
Hashes for llvmlite-0.31.0-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e8baa6d5b4383ca7b0abe0e8968b16d4e6b1c0691cbcef18eab298e9c840b5e |
|
MD5 | 6b03e13add1cdf85e5335a7a0e483d72 |
|
BLAKE2b-256 | 12399e86b4ccce0a803cb6de7aa8cf8e700e5337c3f2395476e828d07f7f6373 |
Hashes for llvmlite-0.31.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c999bbf838b7b29b81e070517ec2dad7f408428e4651f779028e0a35ed6f2dea |
|
MD5 | a81054c5a2ba3588f719d7f2941bb21e |
|
BLAKE2b-256 | 586d6d7d41a12c5bfee7c96cca5c17675b135ceb0074534cb5c8bc740232daab |
Hashes for llvmlite-0.31.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e4129f2d33a76c1415d2808bae58a15d5480b1cc09fd3e80fc8d0e25bf6c27e |
|
MD5 | 6d484fe7a020a320a571fe0a194cb67f |
|
BLAKE2b-256 | 23508ee1ee07cde1d5289eb1d43c11e2040f1745e1cdff8106608a327a3831a7 |
Hashes for llvmlite-0.31.0-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00fdf20d2f4972a00bcfaa9ce62ee55208ae5df38906a198650ddf91ba6a5fba |
|
MD5 | d90808fa3cee5541a9414282b15bedf9 |
|
BLAKE2b-256 | bc9c48975df3edf3030e22d8112db0eee0f98544b1b7e7904f7ff75621a8b9f2 |