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.23.0, llvmlite requires LLVM 6.0. It does not support earlier or later versions of LLVM.
Historical compatibility table:
llvmlite versions |
compatible LLVM versions |
---|---|
0.27.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
File details
Details for the file llvmlite-0.27.1.tar.gz
.
File metadata
- Download URL: llvmlite-0.27.1.tar.gz
- Upload date:
- Size: 104.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48a1c3ae69fd8920cba153bfed8a46ac46474bc706a2100226df4abffe0000ab |
|
MD5 | 81946df6afaa8e30b6946eac5920f0d6 |
|
BLAKE2b-256 | 316a2af9e150c053c194c751060b904ce9bdbb588ae3c6ce95569f95a2004884 |
File details
Details for the file llvmlite-0.27.1-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5bab3a2fc754c6b8d8a550061299a8bc119dc0febf713a2f1f38fe50d670115 |
|
MD5 | 2e97e834be59119094baae63df7f9a21 |
|
BLAKE2b-256 | 70e4a9e9431f1ce0274d844b80b9993a940f8445289b6115f7a40d71a852f133 |
File details
Details for the file llvmlite-0.27.1-cp37-cp37m-manylinux1_i686.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp37-cp37m-manylinux1_i686.whl
- Upload date:
- Size: 17.5 MB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6194d74bdac3fd1454384f4922abb3c1afe209e15c607ed84b8bc60c35a7a4a |
|
MD5 | 580ee3a0156a9b435ca751c60c5925da |
|
BLAKE2b-256 | 7caff6e70508c36f9988286bf92d898d523633e3efa39531e1b84b760248cd50 |
File details
Details for the file llvmlite-0.27.1-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 13.2 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceed23df15ec814f9bd4ddbd8a8f9d7acb986fb571f7f034ec1f7f6cbed16cde |
|
MD5 | 18690c352c1ff8db4c803233292ac1d4 |
|
BLAKE2b-256 | 91c854b0c8e3975654e328ebbd92fabba422536e05be353da50f30b04fff60ba |
File details
Details for the file llvmlite-0.27.1-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 137817894dfc702c3f6fa17eef75a1fb004ce9a31b689671084c36ddba59920b |
|
MD5 | b7c448872fee9ea2c7646238b0afc424 |
|
BLAKE2b-256 | 71f5ed9af288084b4f0cc2e4db0c3be57ba0442ed837135a9c2607c3a1309790 |
File details
Details for the file llvmlite-0.27.1-cp36-cp36m-manylinux1_i686.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp36-cp36m-manylinux1_i686.whl
- Upload date:
- Size: 17.5 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a211eea04c5bd1c6d81a3a3b902686c379cdfc2d690b36c2ff42e8254755a0db |
|
MD5 | 2569d459be57ea87802710e6151a569d |
|
BLAKE2b-256 | edcc8de877e07abad8176fea513ac74270b506e8d6303978d9ab53e4a5f71720 |
File details
Details for the file llvmlite-0.27.1-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 13.2 MB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cbe079cb1eeaf4c90e1b75b2ef314ebb0ea5b4c420298e96065eafa3a0d0b0e |
|
MD5 | 7bee906c42674f10f9d9a3818d277432 |
|
BLAKE2b-256 | ddadfec27334d072762ca0af8350f5bd2d44aa7c5934f310f2c8368e2b6a7114 |
File details
Details for the file llvmlite-0.27.1-cp27-cp27mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp27-cp27mu-manylinux1_x86_64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd72c789d38e6cef8145a97a65e1f6eeecb4aab4c85a886015b630c8f7e7543d |
|
MD5 | f7971d4ebb648393774e6fda9c6b9577 |
|
BLAKE2b-256 | 6e6b10e1c00bb2afb15797b90f6e91427b97e5d4312b29a787756650305207a3 |
File details
Details for the file llvmlite-0.27.1-cp27-cp27mu-manylinux1_i686.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp27-cp27mu-manylinux1_i686.whl
- Upload date:
- Size: 17.5 MB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 727dad5c43c6dfda2781b47ad2f1af3e25a24c4265645d733b70aac01526d8c7 |
|
MD5 | 5cd067a91ef0dcaacc20f3bf9141d1c0 |
|
BLAKE2b-256 | 42fdba323e1888d3713b6877037e4608240f9ac4ee242b53446233f7a8402e93 |
File details
Details for the file llvmlite-0.27.1-cp27-cp27m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: llvmlite-0.27.1-cp27-cp27m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 13.2 MB
- Tags: CPython 2.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d05fca7ba5f5bf6d0ccefc99a10c54e0d5cc80d7b8003496372abc0f65be468 |
|
MD5 | 30034edeb1810e70fd985d8efe4fe922 |
|
BLAKE2b-256 | 0061dfdc2bbe1a76678fd7f2cb045cb6aa25457e56a7ae42fe43ae6f7313036b |