添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Delivered-To: [email protected]
Received: by 10.103.10.2 with SMTP id 2csp172897vsk;
	Fri, 2 Jun 2017 05:33:15 -0700 (PDT)
X-Received: by 10.223.147.196 with SMTP id 62mr4967700wrp.107.1496406795035; 
	Fri, 02 Jun 2017 05:33:15 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1496406795; cv=none;
	d=google.com; s=arc-20160816;
	b=HjSQBvK9mApmd2OuGEnixK1KMhq2ifE5xxYR0UveuBEWPAPuNe4YVSdG/UEDydvn/f
	5fmXISiMYTybPTrmvIHRJdEKmlJniYNAVrVKQcLSjgOGhDgQ9D22E+QgHc3DYQPLGuki
	R6+kUuvQMqWWh+92Ws9MtIsgjYwpO/UQYCoF6bnkJt0b9AMNaX8qdIw2Rp86zUCYe5FI
	GMJawZjdmlgrIb1BjIjr36OLmWGM8t931nLKva/p6ZgKgxYvEKGHl7oOIntjDeweICGS
	t+QIoZKoelNdoVj5DKl/vz0vQMfX60A4yZVvMRDif2e9W7AfirNL11n9wBbkymN6HcEU
	FZgQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
	s=arc-20160816; 
	h=sender:errors-to:reply-to:list-subscribe:list-help:list-post
	:list-archive:list-unsubscribe:list-id:precedence:subject
	:mime-version:feedback-id:message-id:from:to:dkim-signature:date
	:delivered-to:arc-authentication-results;
	bh=lI0I9n3qz0ovYsKef/ASuCWu2kSJ2ssDfzTnoNjaFS0=;
	b=ZqhOC0gO1eUQtk7M+XNboRFF4yJ2RJa5VRaOodGKTVHWsoaJzVfDqh2XQEV4ExTabX
	E1BuapYqHOGL1i/1drX3TqRLUOE3bLiyRW/3dpOu/yA6GG7Li06CSy0vMGJ9I1+EYssv
	xXZ+2vdr89sm7EGS6ealTyzoX3qeSyPbjoYiEWr2JR0PtXAESsD0jydjBwD7TQBvMq5S
	7zIL53NdQUB2RAP3fWB6EUecMfIc+y37eDTWPWMysF+Fs+Qchsum7OzAXL6/A/SeVfRi
	svI/1f3auR71hfiXVSNN/kGe5BCSZiyN3p3P5MK2kd13sGoPFdtx6xoUX7wophHpGkZj
	fH7A==
ARC-Authentication-Results: i=1; mx.google.com;
	dkim=neutral (body hash did not verify) [email protected];
	spf=pass (google.com: domain of [email protected]
	designates 79.124.17.100 as permitted sender)
	[email protected]; 
	dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE)
	header.from=protonmail.com
Return-Path: <[email protected]>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100])
	by mx.google.com with ESMTP id
	p12si23292198wrd.273.2017.06.02.05.33.12; 
	Fri, 02 Jun 2017 05:33:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected]
	designates 79.124.17.100 as permitted sender)
	client-ip=79.124.17.100; 
Authentication-Results: mx.google.com;
	dkim=neutral (body hash did not verify) [email protected];
	spf=pass (google.com: domain of [email protected]
	designates 79.124.17.100 as permitted sender)
	[email protected]; 
	dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE)
	header.from=protonmail.com
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C598689B81;
	Fri,  2 Jun 2017 15:33:03 +0300 (EEST)
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from mail3.protonmail.ch (mail3.protonmail.ch [185.70.40.25])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 39837689A36
	for <[email protected]>; Fri,  2 Jun 2017 15:32:57 +0300 (EEST)
Date: Fri, 02 Jun 2017 08:32:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
	s=default; t=1496406778;
	bh=eqgdOTRuXttNPhROspb+ci+BGnDueNv/wplS7Ug8ILo=;
	h=To:From:Reply-To:Subject:Feedback-ID:From;
	b=CdfjzgTFc/mKi6mxautaRTm0YEnJaT7G8A/2seCuNVUl7Lkk3h6UfPMJKoJe9r13j
	o9xE+Sl7KkRUrCany3JYnu1QKD+O+r7hnaCb5bueQ1IosUK29a6WLlgOnYZm7fQsv9
	BfrC3vHTIsmheEdHoDZ/Ihk7bYKlw2ym3fCGPkYo=
To: FFmpeg development discussions and patches <[email protected]>
From: =?UTF-8?Q?Andreas_H=C3=A5kon?= <[email protected]>
Message-ID: <0jvAo3VLhFQ4_4u5oIjRgKWsvUsMNzbFI7uRxyeg3q5DRtwQTeyeAKjnI6vW56j-ckb7etJOBCdiWpXRwMivvzlb9rvRTrZ9UY4ORW1vWww=@protonmail.com>
Feedback-ID: Mx8CaiV20jk_fqXDN0fFpg3vRaGkb9VCTrYRnZNHwEija3aOdqvFspzl6ODkmHrlSKJSx29p-LzkuvS_96L02A==:Ext:ProtonMail
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="b1_b47d619a688e1a48b8f7b5ce0ca5b0bf"
X-Spam-Status: No, score=0.3 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED,
	DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE,
	MISSING_DATE autolearn=no autolearn_force=no version=3.4.1
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on
	mail3.protonmail.ch
X-Content-Filtered-By: Mailman/MimeDel 2.1.20
Subject: [FFmpeg-devel] [PATCH] configure: support static libnpp [v3]
X-BeenThere: [email protected]
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <http://ffmpeg.org/mailman/options/ffmpeg-devel>,
	<mailto:[email protected]?subject=unsubscribe>
List-Archive: <http://ffmpeg.org/pipermail/ffmpeg-devel/>
List-Post: <mailto:[email protected]>
List-Help: <mailto:[email protected]?subject=help>
List-Subscribe: <http://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
	<mailto:[email protected]?subject=subscribe>
Reply-To: FFmpeg development discussions and patches
	<[email protected]>
Errors-To: [email protected]
Sender: "ffmpeg-devel" <[email protected]>
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:
http://ffmpeg.org/pipermail/ffmpeg-devel/2016-June/195078.html
- Read more about linking directly to libnpp* libraries without link to the CUDA SDK:
http://trac.ffmpeg.org/ticket/6405
Regards.
Sent with [ProtonMail](https://protonmail.com) Secure Email.
From 01b521720c78fdc0f1e6fab0887def03d559b58c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20H=C3=A5kon?= <[email protected]>
Date: Fri, 2 Jun 2017 13:19:26 +0100
Subject: [PATCH] configure: support static libnpp [v3]
 configure |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
I don't like the complexity of this.
It also seems strange to me that you put cudart_static and other culibos 
in there, as well as $ldl, stdc++ and so on.
That would most likely link against shared cuda and static cuda at the 
same time, which seems highly redundant.
Also, no other library uses an additional configure switch to use its 
static version. I'm against adding one for libnpp.
Besides, I consider scale_npp a candidate for deprecation, in favor of 
scale_cuda, so I'm not too thrilled about introducing new and complex 
stuff for it.
Hi Timo,
As for the deprecation of libnpp, I suggest to keeping it. We use it a lot! In addition, we have some improvements for the current scale_npp... however, before publishing it it's necesssary to solve the question of the linking with libnpp.
Regarding the static linking with libnpp, I have already mentioned the reasons for this. And the main one is that in this way you don't have to recompile the binary when changing the video driver. Think of the problem of kernel modules and the graphic drivers as an example, when the kernel version is changed you have to recompile the driver. Wouldn't it be better not to do this? With this configuration (fully optional) you can achieve that with FFMpeg & nVidia drivers.
And as for linking or not with other libraries, it may be possible to improve the patch. What I've published is based on previous work you did yourself. Therefore, perhaps we can work together to improve that option. You agree?
In any case, I fully recommend adding the option (by default disabled) of statically linking with libnpp.
Regards,
+++ b/configure
@@ -300,6 +300,7 @@  External library support:
   --disable-dxva2          disable Microsoft DirectX 9 video acceleration code [autodetect]
   --enable-libmfx          enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
   --enable-libnpp          enable Nvidia Performance Primitives-based code [no]
+  --disable-libnpp-static  disable using static version of libnpp [autodetect]
   --enable-mmal            enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
   --disable-nvenc          disable Nvidia video encoding code [autodetect]
   --enable-omx             enable OpenMAX IL code [no]
@@ -1599,6 +1600,7 @@  HWACCEL_AUTODETECT_LIBRARY_LIST="
 HWACCEL_LIBRARY_NONFREE_LIST="
     cuda_sdk
     libnpp
+    libnpp_static
 HWACCEL_LIBRARY_LIST="
@@ -5816,7 +5818,15 @@  enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h" MFXInit ||
                                { require libmfx "mfx/mfxvideo.h" MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
 enabled libmodplug        && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
 enabled libmp3lame        && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
-enabled libnpp            && require libnpp npp.h nppGetLibVersion -lnppi -lnppc
+enabled libnpp            && { { if ! disabled libnpp_static; then
+                                 check_lib libnpp npp.h nppGetLibVersion -lnppi_static -lnppc_static -lcudart_static -lculibos $ldl  ||
+                                 check_lib libnpp npp.h nppGetLibVersion -lnppi_static -lnppc_static -lcudart_static -lculibos $ldl -lstdc++ ||
+                                 check_lib libnpp npp.h nppGetLibVersion -lnppi_static -lnppc_static -lcudart_static -lculibos $ldl -lstdc++ -lrt
+                               else false; fi; } ||
+                               { if ! enabled libnpp_static; then
+                                 require libnpp npp.h nppGetLibVersion -lnppi -lnppc
+                               else false; fi; } ||
+                               die "ERROR: libnpp not found"; }
 enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
 enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
 enabled libopencv         && { check_header opencv2/core/core_c.h &&