How to compile C++ dependencies during pip install?

馋奶兔 提交于 2019-12-20 14:13:08

问题


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.

How can I do that? I haven't been able to find a good reference via simple Google searches.


回答1:


I would recommend taking a look at how llvmlite solves this problem. The idea is to use custom cmdclasss in setup.py that calls your other build system. In llvmlite, they call out to CMake, for example.

See: https://github.com/numba/llvmlite/blob/master/setup.py



来源:https://stackoverflow.com/questions/30657841/how-to-compile-c-dependencies-during-pip-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!