在pip安装期间如何编译C ++依赖项? [英] How to compile C++ dependencies during pip install?
问题描述
我想使我的python代码可点入.但是,我的代码依赖于另一个无法点子的库.因此,当用户调用pip install
时,我需要以某种方式编译源代码.
I want to make my python code pip-able. However, my code depends on another library which isn't pip-able. So, somehow I need to compile the source code when a user calls pip install
.
我该怎么做?我无法通过简单的Google搜索找到很好的参考.
How can I do that? I haven't been able to find a good reference via simple Google searches.
推荐答案
我建议您看一下llvmlite如何解决此问题.这个想法是在setup.py
中使用自定义的cmdclass
来调用您的其他构建系统.例如,在llvmlite中,他们呼唤CMake.
I would recommend taking a look at how llvmlite solves this problem. The idea is to use custom cmdclass
s in setup.py
that calls your other build system. In llvmlite, they call out to CMake, for example.
请参阅: https://github.com/numba/llvmlite/blob/master/setup.py
这篇关于在pip安装期间如何编译C ++依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!