在pip安装期间如何编译C ++依赖项? [英] How to compile C++ dependencies during pip install?

查看:84
本文介绍了在pip安装期间如何编译C ++依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使我的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 cmdclasss 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆