[FFmpeg-devel] [PATCH] configure: support static libnpp [v3]

Andreas Håkon andreas.hakon at protonmail.com
Fri Jun 2 15:32:54 EEST 2017


This is an updated version of my previous patch.
Sorry! The previous one doesn’t work with the last version of the configure.
This version is tested with both parameters: “--enable-libnpp-static” and “--disable-libnpp-static”.

To summarize the info about this patch:

- This is a simple solution to include libnpp*_static.a when compile FFmpeg.

- Even “non-free” is required, three advantages exists:

1) If you link libnpp* static (with this patch) you can upgrade the NVidia driver and the CUDA SDK without recompiling the FFmpeg. The main advantage is this.

2) If you link libnpp* static you can uninstall the CUDA SDK after compile the FFmpeg. It doesn't need the SDK to run. Then you can save (a lot of) space.

3) Even if you compile FFmpeg with "non-free" enabled, you can use the binary in any machine you own. You can't distribute the binary, but you can copy/use the binary. So, if you have a cluster of machines, you only need to copy the binary, install the NVidia driver, and... nothing more. The CUDA SDK is not a requirement for run FFmpeg, only to compile it.

- The trick is the dynamic loading of the library "libcuda.so.1" in the source code of the "dynalink_loader.h".

- By default the linking is the regular dynamic link (aka "--disable-libnpp-static" config). However, if you like to compile statically with "libnpp*_static.a" then add these parameters:

$ configure ... --enable-nonfree --enable-libnpp --enable-libnpp-static --enable-cuda --extra-cflags="-I/usr/local/cuda/include/" --extra-ldflags="-L/usr/local/cuda/lib64/"

This assumes the CUDA SDK is installed in "/usr/local/cuda".

- This patch is based on the original work done by Timo Rothenpieler, and his patch for static linking with libnpp:

- Read more about linking directly to libnpp* libraries without link to the CUDA SDK:


Sent with [ProtonMail](https://protonmail.com) Secure Email.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-configure-support-static-libnpp-v3.patch.txt
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170602/7992b291/attachment.txt>

More information about the ffmpeg-devel mailing list