llvm的python绑定
llvmp的Python项目详细描述
版本
这个包已经用llvm 3.3、python 2.6、2.7、3.3和3.4进行了测试。 其他python版本也可以工作。
快速启动
从中获取并提取llvm 3.2源tarball llvm.org。然后,cd进入 提取的目录。
运行./configure --enable-optimized--prefix=LLVM_INSTALL_PATH。
Note: Without the ^{tt3}$ 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 ^{tt4}$ with your own path.
运行REQUIRES_RTTI=1 make install生成并安装。
Note: With LLVM 3.3, the default build configuration has C++ RTTI disabled. However, llvmpy requires RTTI.
Note: Use ^{tt6}$ to enable concurrent build. Replace ^{tt7}$ with the actual number of processor you have.
获取llvm py并安装它:
$ git clone https://github.com/llvmpy/llvmpy.git $ cd llvmpy $ LLVM_CONFIG_PATH=LLVM_INSTALL_PATH/bin/llvm-config python setup.py install
运行测试:
$ python -c "import llvm; llvm.test()"
请参阅http://www.llvmpy.org中的文档和示例 在“测试”下。
常见的构建问题
- 如果由于“未定义的符号: _ ztin4llvm24passregistrationlistenere“,这是因为没有启用rtti 在构建llvm时。“ztin4llvm24passregistrationlistenere”是类型信息 PassRegistrationListener类的。
- llvm3.3 ssize\u t在64位窗口上不匹配。 从http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130701/180049.html 获取修补程序
- OSX 10.9 Mavericks默认使用libc++但Anaconda分发llvm 二进制文件链接到旧的libstdc++。这两个二进制文件不兼容 但是没有编译/链接时间警告。产生的二进制文件可能 在运行时生成分段错误(可能是由于ABI不匹配)。 修复:使用以下C++标志: -std=libstdc++-mmacosx-version-min=10.6。
许可证
llvmpy是在新的bsd许可证下发布的,它类似于llvm 许可证本身。 请参阅名为license的文件以获取完整的许可文本。