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.43.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a2872ee80dcf6b5dbdc838763d26554c2a18aa833d31a2635bff16aafefb9c9 |
|
MD5 | b8c8b6552cdcb6acb9ce2a8b38b0081c |
|
BLAKE2b-256 | c694dea10e263655ce78d777e78d904903faae39d1fc440762be4a9dc46bed49 |
Hashes for llvmlite-0.43.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df6509e1507ca0760787a199d19439cc887bfd82226f5af746d6977bd9f66844 |
|
MD5 | f21e07569b21555779afe5686dd92d0e |
|
BLAKE2b-256 | 005f323c4d56e8401c50185fd0e875fcf06b71bf825a863699be1eb10aa2a9cb |
Hashes for llvmlite-0.43.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eccce86bba940bae0d8d48ed925f21dbb813519169246e2ab292b5092aba121f |
|
MD5 | 4f0aca7af89d67522174e18f8717d816 |
|
BLAKE2b-256 | bff14c205a48488e574ee9f6505d50e84370a978c90f08dab41a42d8f2c576b6 |
Hashes for llvmlite-0.43.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35d80d61d0cda2d767f72de99450766250560399edc309da16937b93d3b676e7 |
|
MD5 | 511ca85c9dffce940f153fc6deaae6af |
|
BLAKE2b-256 | a29c24139d3712d2d352e300c39c0e00d167472c08b3bd350c3c33d72c88ff8d |
Hashes for llvmlite-0.43.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f99b600aa7f65235a5a05d0b9a9f31150c390f31261f2a0ba678e26823ec38f7 |
|
MD5 | 99376aed834396e017ae2cbda6aed392 |
|
BLAKE2b-256 | 0b679443509e5d2b6d8587bae3ede5598fa8bd586b1c7701696663ea8af15b5b |
Hashes for llvmlite-0.43.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5bd550001d26450bd90777736c69d68c487d17bf371438f975229b2b8241a91 |
|
MD5 | 41a855c2e22f38e96d5c75f096fbdc88 |
|
BLAKE2b-256 | 20abed5ed3688c6ba4f0b8d789da19fd8e30a9cf7fc5852effe311bc5aefe73e |
Hashes for llvmlite-0.43.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 977525a1e5f4059316b183fb4fd34fa858c9eade31f165427a3977c95e3ee749 |
|
MD5 | 1c1dbcb8c6e8828c8e45907afe9878da |
|
BLAKE2b-256 | 6b995d00a7d671b1ba1751fc9f19d3b36f3300774c6eebe2bcdb5f6191763eb4 |
Hashes for llvmlite-0.43.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1da416ab53e4f7f3bc8d4eeba36d801cc1894b9fbfbf2022b29b6bad34a7df2 |
|
MD5 | 6aef15b67a12004ce8313b65a6eaf195 |
|
BLAKE2b-256 | 2fb24429433eb2dc8379e2cb582502dca074c23837f8fd009907f78a24de4c25 |
Hashes for llvmlite-0.43.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0a9a1a39d4bf3517f2af9d23d479b4175ead205c592ceeb8b89af48a327ea57 |
|
MD5 | f9652e298462bffc94451426a8d871c1 |
|
BLAKE2b-256 | eee138deed89ced4cf378c61e232265cfe933ccde56ae83c901aa68b477d14b1 |
Hashes for llvmlite-0.43.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e8d0618cb9bfe40ac38a9633f2493d4d4e9fcc2f438d39a4e854f39cc0f5f98 |
|
MD5 | 95db6a50f519fd4a5fe0b8a520ae7d2d |
|
BLAKE2b-256 | 958cde3276d773ab6ce3ad676df5fab5aac19696b2956319d65d7dd88fb10f19 |
Hashes for llvmlite-0.43.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14f0e4bf2fd2d9a75a3534111e8ebeb08eda2f33e9bdd6dfa13282afacdde0ed |
|
MD5 | 486f047d799d38a494d99a1a4ad9840e |
|
BLAKE2b-256 | f226b5478037c453554a61625ef1125f7e12bb1429ae11c6376f47beba9b0179 |
Hashes for llvmlite-0.43.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6912a87782acdff6eb8bf01675ed01d60ca1f2551f8176a300a886f09e836a6a |
|
MD5 | 1e636a564489d452bfb092eb11806792 |
|
BLAKE2b-256 | c6212ffbab5714e72f2483207b4a1de79b2eecd9debbf666ff4e7067bcc5c134 |
Hashes for llvmlite-0.43.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d434ec7e2ce3cc8f452d1cd9a28591745de022f931d67be688a737320dfcead |
|
MD5 | c6bb4dffc1c7e81d9054f698655d4453 |
|
BLAKE2b-256 | 7e3c4410f670ad0a911227ea2ecfcba9f672a77cf1924df5280c4562032ec32d |
Hashes for llvmlite-0.43.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d4fd101f571a31acb1559ae1af30f30b1dc4b3186669f92ad780e17c81e91bc |
|
MD5 | 06f6719591e9e972686540880bfea0e1 |
|
BLAKE2b-256 | ca5ca27f9257f86f0cda3f764ff21d9f4217b9f6a0d45e7a39ecfa7905f524ce |
Hashes for llvmlite-0.43.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a289af9a1687c6cf463478f0fa8e8aa3b6fb813317b0d70bf1ed0759eab6f761 |
|
MD5 | cc21e545ca4b17259020d720de818f5e |
|
BLAKE2b-256 | 23ff6ca7e98998b573b4bd6566f15c35e5c8bea829663a6df0c7aa55ab559da9 |
Hashes for llvmlite-0.43.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e147cdda9037f94b399bf03bfd8a6b6b1f2f90be94a454e3386f006455a9b4 |
|
MD5 | 327758f1e3f294644caf5e1540e3df79 |
|
BLAKE2b-256 | df4173cc26a2634b538cfe813f618c91e7e9960b8c163f8f0c94a2b0f008b9da |
Hashes for llvmlite-0.43.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc9efc739cc6ed760f795806f67889923f7274276f0eb45092a1473e40d9b867 |
|
MD5 | e1066f7231b98ace6889a6fd2237feec |
|
BLAKE2b-256 | e0d0889e9705107db7b1ec0767b03f15d7b95b4c4f9fdf91928ab1c7e9ffacf6 |
Hashes for llvmlite-0.43.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74937acd22dc11b33946b67dca7680e6d103d6e90eeaaaf932603bec6fe7b03a |
|
MD5 | e8b96f1d62b1ed7c85b7eeb14441ab74 |
|
BLAKE2b-256 | c8c69324eb5de2ba9d99cbed853d85ba7a318652a48e077797bec27cf40f911d |
Hashes for llvmlite-0.43.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18e9953c748b105668487b7c81a3e97b046d8abf95c4ddc0cd3c94f4e4651ae8 |
|
MD5 | 7df72cb439b4934da5e2fa5290d07c85 |
|
BLAKE2b-256 | cc6158c70aa0808a8cba825a7d98cc65bef4801b99328fba80837bfcb5fc767f |
Hashes for llvmlite-0.43.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cd2a7376f7b3367019b664c21f0c61766219faa3b03731113ead75107f3b66c |
|
MD5 | 5e444d25394ce018d52607f0d65e65f7 |
|
BLAKE2b-256 | 2a7312925b1bbb3c2beb6d96f892ef5b4d742c34f00ddb9f4a125e9e87b22f52 |