Hi Hendrik,

I don't like that there is a separate configure option. We can link to
other libraries dynamically or statically depending on what is found,
without needing two configure options per library.

I understand. However, this is not really true for libnpp*.
Let me to explain about this special case:

If you like to compile FFmpeg statically you can do it. However, you link all 
or none.
And in the case of libnpp* if you link with regular shard objects, then you 
need to have all CUDA SDK libraries installed in your computer.
However, if you link to the static version of this library then you need to 
install only the NVidia driver.

The trick is the dynamic loading of the library "libcuda.so.1" in the source 
code of the "dynalink_loader.h".
Please, review my description about this special case at: 
http://trac.ffmpeg.org/ticket/6405

So, this patch simplifies a lot the use of the libnpp functions (like the 
'scale_npp').
More or less, is similar to the use of "nvenc_*" in FFmpeg. By default it 
doesn't link dynamic with CUDA, as the "dynalink_loader.h" has the code to load 
the functions from the shared library provided by the DRIVER, not the CUDA lib 
(the shared object "libcuda.so.1" is provided by the DRIVER, and not by the 
SDK).
In fact, the CUDA shared library is a mere wrapper to load some functions. 
These functions can be in shared objects or in static libraries.
Then, if you like to compile a regular FFmpeg with shared objects and dependent 
to the NVidia DRIVER, but not with the CUDA SDK, you can use this patch.

I hope you agree this explanation. This patch is really useful.
Regards,
A.H.

Sent with [ProtonMail](https://protonmail.com) Secure Email.

-------- Original Message --------
Subject: Re: [FFmpeg-devel] [PATCH] configure: support static libnpp [v2]
Local Time: June 2, 2017 11:04 AM
UTC Time: June 2, 2017 9:04 AM
From: h.lepp...@gmail.com
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>

On Fri, Jun 2, 2017 at 10:56 AM, Andreas Håkon
<andreas.ha...@protonmail.com> wrote:
> Hi,
>
> This patch is based on the original work done by Timo Rothenpieler, and his 
> patch for static linking with libnpp:
> [http://ffmpeg.org/pipermail/ffmpeg-devel/2016-June/195078.html](https://ffmpeg.org/pipermail/ffmpeg-devel/2016-June/195078.html)
>
> Based in my recomendations now it's possible to link directly to libnpp* 
> libraries without linking to the CUDA SDK:
> [http://trac.ffmpeg.org/ticket/6405](https://trac.ffmpeg.org/ticket/6405)
> http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=2d978d1c721ae69a9007b530153067736d4ddc79
>
> Then I created an updated version of the patch.
>
> 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".

I don't like that there is a separate configure option. We can link to
other libraries dynamically or statically depending on what is found,
without needing two configure options per library.

- Hendrik
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to