llvmlite

A lightweight LLVM python binding for writing JIT compilers

  • 所有者: numba/llvmlite
  • 平台:
  • 許可證: BSD 2-Clause "Simplified" License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

========
llvmlite

.. image:: https://travis-ci.org/numba/llvmlite.svg?branch=master
:target: https://travis-ci.org/numba/llvmlite
:alt: Travis CI
.. image:: https://codeclimate.com/github/numba/llvmlite/badges/gpa.svg
:target: https://codeclimate.com/github/numba/llvmlite
:alt: Code Climate
.. image:: https://coveralls.io/repos/github/numba/llvmlite/badge.svg
:target: https://coveralls.io/github/numba/llvmlite
:alt: Coveralls.io
.. image:: https://readthedocs.org/projects/llvmlite/badge/
:target: https://llvmlite.readthedocs.io
:alt: Readthedocs.io

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.

.. _llvmpy: https://github.com/llvmpy/llvmpy

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 <https://anaconda.org/numba>_. For example::

$ conda install --channel=numba llvmlite

(or, simply, the official llvmlite package provided in the Anaconda_
distribution)

.. _Numba: http://numba.pydata.org/
.. _Conda: http://conda.pydata.org/
.. _Anaconda: http://docs.continuum.io/anaconda/index.html

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

主要指標

概覽
名稱與所有者numba/llvmlite
主編程語言Python
編程語言Python (語言數: 7)
平台
許可證BSD 2-Clause "Simplified" License
所有者活动
創建於2014-08-07 14:51:28
推送於2025-05-30 10:49:39
最后一次提交
發布數126
最新版本名稱v0.44.0 (發布於 2025-01-16 21:06:56)
第一版名稱v0.1.0 (發布於 2014-11-13 14:10:20)
用户参与
星數2.1k
關注者數57
派生數338
提交數2.7k
已啟用問題?
問題數474
打開的問題數121
拉請求數582
打開的拉請求數30
關閉的拉請求數133
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?