Originally a github fork of the llvm-py repository from http://www.mdevan.org/llvm-py/index.html updated to work with LLVM 3.x. Since then it has changed significantly with multiple sub-projects.
www.llvmpy.org
This issue would cause running the example program to crash with the error:
File "/usr/local/lib/python2.7/dist-packages/llvm/passes.py", line 161, in add
self._ptr.add(pass_obj._ptr)
File "/usr/local/lib/python2.7/dist-packages/llvmpy/api/llvm/__init__.py", line 3726, in add
capsule.release_ownership(unwrapped1[0])
File "/usr/local/lib/python2.7/dist-packages/llvmpy/capsule.py", line 113, in release_ownership
raise Exception("Already released")
Exception: Already released
|
||
|---|---|---|
| buildscripts/condarecipe | ||
| docs | ||
| example | ||
| llpython | ||
| llrtc | ||
| llvm | ||
| llvm_array | ||
| llvm_cbuilder | ||
| llvmpy | ||
| test | ||
| tools | ||
| www | ||
| .gitattributes | ||
| .gitignore | ||
| .travis.yml | ||
| CHANGELOG | ||
| LICENSE | ||
| llvm-config-win32.py | ||
| MANIFEST.in | ||
| README.rst | ||
| README_LLVM_CBUILDER.md | ||
| setup.py | ||
| versioneer.py | ||
================================
llvmpy: Python bindings for LLVM
================================
Home page
---------
http://www.llvmpy.org
Versions
--------
This package has been tested with LLVM 3.2, Python 2.6, 2.7 and 3.3.
Other Python versions may work.
Quickstart
----------
1. Get and extract LLVM 3.2 source tarball from
`llvm.org <http://llvm.org/releases/download.html#3.2>`_. Then, ``cd`` into
the extracted directory.
2. Run ``./configure --enable-optimized --prefix=LLVM_INSTALL_PATH``.
**Note**: Without the ``--enable-optimized`` flag, debug build will be
selected. Unless you are developing LLVM or llvmpy, it is recommended
that the flag is used to reduce build time and binary size.
**Note**: Use prefix to select the installation path. It is recommended
to separate your custom build from the default system package. Please
replace ``LLVM_INSTALL_PATH`` with your own path.
3. Run ``REQUIRES_RTTI=1 make install`` to build and install.
**Note**: With LLVM 3.2, the default build configuration has C++ RTTI
disabled. However, llvmpy requires RTTI.
**Note**: Use ``make -j2 install`` to enable concurrent build.
Replace ``2`` with the actual number of processor you have.
4. Get llvm-py and install it::
$ git clone git@github.com:llvmpy/llvmpy.git
$ cd llvmpy
$ LLVM_CONFIG_PATH=LLVM_INSTALL_PATH/bin/llvm-config python setup.py install
Run the tests::
$ python -c "import llvm; llvm.test()"
5. See documentation at 'http://www.llvmpy.org' and examples
under 'test'.
Common Build Problems
---------------------
1. If llvmpy cannot be imported due to "undefined symbol:
_ZTIN4llvm24PassRegistrationListenerE", it is because RTTI is not enabled
when building LLVM. "_ZTIN4llvm24PassRegistrationListenerE" is the typeinfo
of PassRegistrationListener class.
LICENSE
-------
llvmpy is distributed under the new BSD license, which is similar to the LLVM
license itself.
See the file called LICENSE for the full license text.