NVIDIA / VideoProcessingFramework

Set of Python bindings to C++ libraries which provides full HW acceleration for video decoding, encoding and GPU-accelerated color space and pixel format conversions
Apache License 2.0
1.32k stars 233 forks source link

Removed python development lib dependency #420

Closed JeroenHoogers closed 1 year ago

JeroenHoogers commented 1 year ago

Background: I was having trouble using this extension outside of a development context because of the wide range of dependencies needed to build/use it. Unfortunately the docker image was not a viable solution in my specific case. So Instead I tried packing the extension inside a .whl file however, this didn't work out of the box since the extension is explicitly linking to libpython3.x.so

This change:

Drawback:

Alternative implementation:

theHamsta commented 1 year ago

Thank you! I think this should already be addressed in #397 (there is no dependency on libpython3.so). #397 only has the SHARED -> MODULE change but this seems to be enough to don't require the libpython3.so on the target machine. Does your PR also eliminate the need to have libpython3.so at build time by searching for only a part of the Python libraries?

Please don't merge the master branch, but rebase instead.

JeroenHoogers commented 1 year ago

Thank you for the response! Yes this also removes build time requirement for a libpython3.x.so which doesn't exist inside a manylinux image. Since CMake 3.18 Development is split into 2 parts: Development.Module which is always needed to create a python extension but doesn't link to libpython and Development.Embed which embeds the python interpreter by linking to libpython (see: https://cmake.org/cmake/help/latest/module/FindPython.html )

Do you have any thoughts on whether to implement it as it is or to make it as an optional CMake parameter?