From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 88436A00E6 for ; Thu, 18 Apr 2019 12:14:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B9CC41B942; Thu, 18 Apr 2019 12:14:57 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id E27871B92D; Thu, 18 Apr 2019 12:14:55 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2019 03:14:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,365,1549958400"; d="scan'208";a="143917204" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.220.103]) by fmsmga007.fm.intel.com with SMTP; 18 Apr 2019 03:14:51 -0700 Received: by (sSMTP sendmail emulation); Thu, 18 Apr 2019 11:14:51 +0100 Date: Thu, 18 Apr 2019 11:14:51 +0100 From: Bruce Richardson To: Luca Boccassi Cc: Yongseok Koh , Jerin Jacob Kollanukkaran , Pavan Nikhilesh Bhagavatula , Shahaf Shuler , dev , Thomas Monjalon , "Gavin Hu (Arm Technology China)" , Honnappa Nagarahalli , "stable@dpdk.org" Message-ID: <20190418101450.GA1817@bricha3-MOBL.ger.corp.intel.com> References: <20190412232451.30197-1-yskoh@mellanox.com> <20190412232451.30197-4-yskoh@mellanox.com> <27a65b1d1737f475a6e32d5c3947d1c2b81d37fb.camel@debian.org> <73A9F0FA-6EDC-4D46-BF28-F60915D333B4@mellanox.com> <269e446ebbc3696429f73e153c769daf9c4ccced.camel@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <269e446ebbc3696429f73e153c769daf9c4ccced.camel@debian.org> User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] [PATCH 3/6] net/mlx: fix library search in meson build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190418101451.GTlqxHmOLWHQQcLAryeX6t_Z5zXfMzNbY6XLToWIkvA@z> On Thu, Apr 18, 2019 at 10:25:19AM +0100, Luca Boccassi wrote: > On Mon, 2019-04-15 at 19:48 +0000, Yongseok Koh wrote: > > Hi, > > > > > > > > Thanks, > > Yongseok > > > > > On Apr 15, 2019, at 3:12 AM, Luca Boccassi < > > > bluca@debian.org > > > > wrote: > > > > > > On Fri, 2019-04-12 at 16:24 -0700, Yongseok Koh wrote: > > > > If MLNX_OFED is installed, there's no .pc file installed for > > > > libraries and > > > > dependency() can't find libraries by pkg-config. By adding > > > > fallback > > > > of > > > > using cc.find_library(), libraries are properly located. > > > > > > > > Fixes: e30b4e566f47 ("build: improve dependency handling") > > > > Cc: > > > > bluca@debian.org > > > > > > > > > > > > Cc: > > > > stable@dpdk.org > > > > > > > > > > > > > > > > Signed-off-by: Yongseok Koh < > > > > yskoh@mellanox.com > > > > > > > > > > > > --- > > > > drivers/net/mlx4/meson.build | 19 +++++++++++-------- > > > > drivers/net/mlx5/meson.build | 19 +++++++++++-------- > > > > 2 files changed, 22 insertions(+), 16 deletions(-) > > > > > > > > diff --git a/drivers/net/mlx4/meson.build > > > > b/drivers/net/mlx4/meson.build > > > > index de020701d1..9082f69f25 100644 > > > > --- a/drivers/net/mlx4/meson.build > > > > +++ b/drivers/net/mlx4/meson.build > > > > @@ -13,21 +13,24 @@ if pmd_dlopen > > > > '-DMLX4_GLUE_VERSION="@0@"'.format(LIB_GLUE_VERSION), > > > > ] > > > > endif > > > > -libs = [ > > > > - dependency('libmnl', required:false), > > > > - dependency('libmlx4', required:false), > > > > - dependency('libibverbs', required:false), > > > > -] > > > > +libs = [ 'libmnl', 'libmlx4', 'libibverbs' ] > > > > +lib_deps = [] > > > > build = true > > > > foreach lib:libs > > > > - if not lib.found() > > > > + lib_dep = dependency(lib, required:false) > > > > + if not lib_dep.found() > > > > + lib_dep = cc.find_library(lib, required:false) > > > > > > Doesn't this end up trying to link the test program to -llibmnl and > > > thus failing? > > > > I also worried about that. But it works fine. > > Looks meson is smart enough. :-) > > Sorry, not to be skeptical, but at least with the meson version I was > using when doing something similar I'm sure this didn't work - > find_library just takes the parameter, adds "-l" in front of it and > uses it to compile. > > In the meson configure log, do you see: > > Dependency libmlx4 found: NO > Library libmlx4 found: YES > My understanding was the same as yours, Luca, and I'm pretty sure older versions used to have that restriction. I think we should - out of an abundance of caution - remove the "lib" prefix from all library/dependency requests. /Bruce