From patchwork Fri Jun 2 08:56:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_H=C3=A5kon?= X-Patchwork-Id: 3791 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp96035vsk; Fri, 2 Jun 2017 01:56:56 -0700 (PDT) X-Received: by 10.223.143.11 with SMTP id p11mr4242495wrb.3.1496393816192; Fri, 02 Jun 2017 01:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496393816; cv=none; d=google.com; s=arc-20160816; b=pZmYkjnH3+BGZ9u/RIjq3h1LfK+bugmWrlUQnKkpjzEpZ2YkZqx84Twt1JHVWy5LQH NdvO2ETtqFu331lFWzqFGiAjAZAAKme9uU8DicGHPsQLHpa5ntG/BPR1SFMjruuKEdlg azmb8m9185XLjQ/2HlDOewmJ23ZsCF4z1i4C3maqvXftTgBWBWK+0gvENFPuQd9Vtvf4 0rfSQr9A/tuZMShlRfX3bBCEpm6Ovz/YHz/D9Iz+IKDJbiuXxgO5T2aZObepTYZUa/9c eGOQDFPepR9LOfMGTraIzLcIzV/vLt27mBFQ4f9lHsl4omgwWG+4pHo5ShjwFRi8Gf7+ 2+Cw== 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=2vJm5u9NSulmdGB0ChCBw7PE4RrIZ0VijacMukLwMLg=; b=Mm3B1ReYJMYwquR0LDN2MhvAn5u6pMby2iFpGigUbwd4MTaeX1bemV/aAlOJBoYUA3 uc8f/iwYED4lGUn6xEafVj9TYb4MmBpKcrJT7R9U5sHvvzTy+l4VU1Kt8CxU2jIXYIHt Fh0bmgIKHYMVlWQLZ5BfG7QxRj/+08k2xOa4qootbEmjzUvCRwYT5ZQMALEU8z1Hi4WL 90teolc4YzK9SqV1sksVn+ZHVzoSjxLFMkm/ev6FzuNxuqh+ss4+NA6lpXsUiFTxO3Ou H9NFvnIxLb/O+EZ2yX2i5Vg5UIH9AqE3AII0BcS+aZov9NWR/120D+tGQZ0EwIS1yAnE ZSsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@protonmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 32si9778026wrf.313.2017.06.02.01.56.55; Fri, 02 Jun 2017 01:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org 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) header.i=@protonmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; 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 CE446689B11; Fri, 2 Jun 2017 11:56:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail3.protonmail.ch (mail3.protonmail.ch [185.70.40.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D91C668839F for ; Fri, 2 Jun 2017 11:56:40 +0300 (EEST) Date: Fri, 02 Jun 2017 04:56:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1496393804; bh=SQTspW1e9/3z1WINLyVu74M2ZsDIpTwuKXbuuCtW3pU=; h=To:From:Reply-To:Subject:Feedback-ID:From; b=ZcQR9n9YUlhMzYW7EeLGpLNVkDiglkHlPH2//i0NNaVjUOLcV4c23JR2Wa52aGvAb oH3o65ruJN0RHkB0rZml7MFDJDvG+X4c2H2WORGITvmfbn65m3NNzWUgtAK6do1Cyr PQxBuBRkwna/TitlflPSIZy2RaEDBlm9U62G6+PM= To: FFmpeg development discussions and patches From: =?UTF-8?Q?Andreas_H=C3=A5kon?= Message-ID: Feedback-ID: Mx8CaiV20jk_fqXDN0fFpg3vRaGkb9VCTrYRnZNHwEija3aOdqvFspzl6ODkmHrlSKJSx29p-LzkuvS_96L02A==:Ext:ProtonMail MIME-Version: 1.0 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 [v2] X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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". Regards. A.H. From db73653ea3da9478ac012e4d143b8c6551acb06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20H=C3=A5kon?= Date: Fri, 2 Jun 2017 09:35:03 +0100 Subject: [PATCH] configure: support static libnpp [v2] --- configure | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 72060ef..4eac083 100755 --- a/configure +++ 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 npp.h nppGetLibVersion -lnppi_static -lnppc_static -lcudart_static -lculibos $ldl || + check_lib npp.h nppGetLibVersion -lnppi_static -lnppc_static -lcudart_static -lculibos $ldl -lstdc++ || + check_lib npp.h nppGetLibVersion -lnppi_static -lnppc_static -lcudart_static -lculibos $ldl -lstdc++ -lrt + else false; fi; } || + { if ! enabled libnpp_static; then + check_lib 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 &&