Fabian
Fabian

Reputation: 1020

How to compile C++ dependencies during 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.

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

Upvotes: 10

Views: 3212

Answers (1)

Robert T. McGibbon
Robert T. McGibbon

Reputation: 5277

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

Upvotes: 5

Related Questions