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.30.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 960ac92388a23ea8036f7c321facd2d721952db3ee62d6aa763dc219e53aebf1 |
|
MD5 | bbf1065df7ccd8c1fbd4a213091c0069 |
|
BLAKE2b-256 | 793259b4f7037cb24aed86d962a805bb02319515608aa91473118c7ff3a02996 |
Hashes for llvmlite-0.30.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06eb546c9d8f138dd91484e0e898cf0f10100e82f0112bb39f9fdcff18aca631 |
|
MD5 | 1dbdcc3ce96b409f1f7c7ebc1abaa248 |
|
BLAKE2b-256 | 053805295ddceebde072b44dbeeead2a8b598e0ec4b4a91fbd2936aefbd752aa |
Hashes for llvmlite-0.30.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6daff653c0b516add52639c7b05b4176670e79cd308d53d801606b1b64bcd22 |
|
MD5 | 0d9ef8fe9e141910922b0a8ddf62e8d7 |
|
BLAKE2b-256 | 1f3e642ffb29ed35ca5e93f171ba327452bdee81ec76f2d711ef0f15b411928a |
Hashes for llvmlite-0.30.0-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f71e9a03da5b666ddbadf645182921fb399c7d4cf5c6660ebc456c3a491b041 |
|
MD5 | 042c4f34842ceae57db35c1d1825d7ad |
|
BLAKE2b-256 | ff3c38398cd47dd677db2a8dfe74588eee2f699d5be6f08bc119f7e76435f1ce |
Hashes for llvmlite-0.30.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 983b5bfdce72f4008016a5d9e3bcca072ef08d13d782e45d94ef6ea32768814e |
|
MD5 | 41825625762b97f47de87aced000abe1 |
|
BLAKE2b-256 | caba1b1e5c4c707c082b1125c30f93887b827ee3db6a2e86184532fe529d31bd |
Hashes for llvmlite-0.30.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a63fa4a09a2292d9b5a166e45c9feb65299a0520ba46f42af0b0a467329883e5 |
|
MD5 | c6083bac402552f63e74260964c88df3 |
|
BLAKE2b-256 | 4460894615d70d4bfbb9d6b035354b5d72a2a0d5fefc579f8405d750e062cf77 |
Hashes for llvmlite-0.30.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2596ea5346f7327d2fca01e047ea9e2b0a5e60df0a112f4d88d8cd4b98bc2b5 |
|
MD5 | c14eaa10f955d6ff68a36fd7a8c40465 |
|
BLAKE2b-256 | 63f16214f4bd210391eb7c34c113c240d5f7e3a2fef466a40509ddd94fab02c6 |
Hashes for llvmlite-0.30.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4386c310138aa381bace2a88ddf743ec944d11687e9a98777266abc66c8e53ee |
|
MD5 | 0e18097770392e0d9b19a61701c8cba2 |
|
BLAKE2b-256 | b393924788871a889ead1c115ba2d43e67932a8865d38fdb179505c99e4bb575 |
Hashes for llvmlite-0.30.0-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 692ad0a0012f2cefe17b7bd0a0fddc903f9c6b2047a8e8fdb7a8f4e4b1f6cf95 |
|
MD5 | bdf9e374b4fa941d337c37d237a55665 |
|
BLAKE2b-256 | 0fc50900b446d216e2b29f0a4a6eb8b4abe12ef2d969ae575eef180632f65070 |
Hashes for llvmlite-0.30.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ad4f3462169884b087a9c300db26841b20d996e9f07652ca7178f9a0296ffc4 |
|
MD5 | 1a9bcc8fbf6e82bbae793f93a5ba6b94 |
|
BLAKE2b-256 | b46e9dfac2466a7c920acb85ef6a061d8453b851bb06e5c8ac6cc6cdaf2e37c4 |
Hashes for llvmlite-0.30.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dab58e45c0ef5bd47f657fa5ff2e7341846798632517aa319368c998fe994c4e |
|
MD5 | 1f0e063d8a4155d123c4a7baa55295cb |
|
BLAKE2b-256 | 1a73aeb0adc325bff9a927b9db12a9033ea98bd7de1000d6e490802f9625f3c2 |
Hashes for llvmlite-0.30.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f0bfd1cb98d4d240275ec83876e10f9b9d31e758e8464135c46a257b9837649 |
|
MD5 | d755a95858a354e26c0000b9b47d1d12 |
|
BLAKE2b-256 | db2a60ee2642595f4d916486097d4d9665e8fb78d671fef2374b3899ca98214f |
Hashes for llvmlite-0.30.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81db97d407012f474097c644cb689e4c4649ebf66a018cfa2b7580b1e5417677 |
|
MD5 | 0a74cb101021bf983b4e01c57e3d7907 |
|
BLAKE2b-256 | 46762e5470636f57e88ba4a128457137cd6c2ca3c7e834f03b8890242b2df1b6 |
Hashes for llvmlite-0.30.0-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 327161412337f9e14e3a5babcfcfa4e7e6aa89cf1400fdbe162a4e19e6418013 |
|
MD5 | c0fe78c14085d6bf06eb445d526dd8ed |
|
BLAKE2b-256 | f63c76a26b5a26969d1d97c06c3a768d2a24c364f96694be10d8c46eda5ce2ff |
Hashes for llvmlite-0.30.0-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8523c21b2ace8bf5ee2dfeb86c9703714be43ce93fa99e29143d25f1ef01b51e |
|
MD5 | fadb3153c9d8a2dec4a1f3a14fd0929a |
|
BLAKE2b-256 | ba1e5fbd5e03713bffde84e33e0b3e3028b0ba28c9bf3874937dbc4a1b45080e |
Hashes for llvmlite-0.30.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3f3c64be18b754175b78ab76e0f11d9d9ec11832fbc4ed15329dd52b2d6d40f |
|
MD5 | ed2742f1d816c988d6da69f6102c156c |
|
BLAKE2b-256 | b98f94b6cec780a65fa9091df7d1a8b066d3642435108caaaed5ab2c64448d6f |
Hashes for llvmlite-0.30.0-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5a8b571f333c5bd6ca26092faec6b728e40c1a7d7c24ff4d9b8cf2a9799852c |
|
MD5 | 462a6e1e71b37cff8b57cf978f152d07 |
|
BLAKE2b-256 | 3e3b9ecf9411d334edfda2fd8b2123483d25e05dc91f8bdef697237d89658ac4 |
Hashes for llvmlite-0.30.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 327558ee71574ecd813b3feb3ffd1f5c32a20595f2c7d02b503aafa55d79285a |
|
MD5 | 4dabab4dbb6fdba78899f8d85db1b572 |
|
BLAKE2b-256 | 47275951e3fbf9d4ea2985dbbc2614775e1ce5610e55d1a46ed12b643d5a42e0 |
Hashes for llvmlite-0.30.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6667551d737e31d7134c731bddf2c9177cc9bcac72da7b16999098218272fc0b |
|
MD5 | 0bd5e3b34d5945e3e0d5a874ae737f17 |
|
BLAKE2b-256 | 74b507704ca1290796c18bf59d0b6638777364b49e7afe101b88e0aee2941ab3 |
Hashes for llvmlite-0.30.0-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 965fc64a2f5ca38326d7755e6b1447c3d85bb8bd043907d4dc3eff337d1f3a5d |
|
MD5 | 4b7e2187228ad6b170d5e692dbe81dfb |
|
BLAKE2b-256 | 9699f7aed0fe4482f33f6e7282e398ed6b46c242fa69df44e554af463308ccd4 |