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 94CDBA00E6 for ; Thu, 18 Apr 2019 13:25:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8212A1B953; Thu, 18 Apr 2019 13:25:30 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140079.outbound.protection.outlook.com [40.107.14.79]) by dpdk.org (Postfix) with ESMTP id 501841B944; Thu, 18 Apr 2019 13:25:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L9IoSsAvhLoQXmwbLj5MAln3maLP7qGWmavgLsT77a0=; b=viTSYSTXs70ZfAvJdy3xEv01unVPiQCNhIgCJoMFZAFBpq9wgMkMfB/trlzEIgObCIWGMZoBl4ncEWD++2xIImsWfnrAPq9pXb4Jz+4ZSduvnjZOH+p3PWbVkwsXN7hibfml9/J4T+sCZkBQSgsvqUKqLbofs+H6jHPvG+YXm+8= Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com (52.133.40.151) by AM0PR0502MB4052.eurprd05.prod.outlook.com (52.133.36.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Thu, 18 Apr 2019 11:25:26 +0000 Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::7da6:9e13:922a:9d88]) by AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::7da6:9e13:922a:9d88%5]) with mapi id 15.20.1813.013; Thu, 18 Apr 2019 11:25:26 +0000 From: Yongseok Koh To: Bruce Richardson , Luca Boccassi CC: Jerin Jacob Kollanukkaran , Pavan Nikhilesh Bhagavatula , Shahaf Shuler , dev , Thomas Monjalon , "Gavin Hu (Arm Technology China)" , Honnappa Nagarahalli , "stable@dpdk.org" Thread-Topic: [PATCH 3/6] net/mlx: fix library search in meson build Thread-Index: AQHU8Yb4dNKN2lEEa0GyaR3eo4jOEaY9BGiAgACg5wCABAjqgIAADdeAgAATt4A= Date: Thu, 18 Apr 2019 11:25:25 +0000 Message-ID: <8CC8822C-C89D-46DF-BDF5-CCB74A11499A@mellanox.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> <20190418101450.GA1817@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20190418101450.GA1817@bricha3-MOBL.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [69.181.245.183] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d20d4e14-1c98-4117-0d2e-08d6c3f08def x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR0502MB4052; x-ms-traffictypediagnostic: AM0PR0502MB4052: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0011612A55 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(136003)(346002)(396003)(366004)(51914003)(199004)(189003)(6116002)(3846002)(102836004)(2616005)(11346002)(5660300002)(71200400001)(186003)(26005)(6506007)(97736004)(83716004)(99286004)(71190400001)(53936002)(53546011)(93886005)(476003)(25786009)(316002)(6512007)(110136005)(33656002)(305945005)(486006)(446003)(256004)(54906003)(81166006)(86362001)(4326008)(229853002)(478600001)(6246003)(81156014)(8936002)(14454004)(6486002)(68736007)(66066001)(6436002)(76176011)(82746002)(2906002)(36756003)(7736002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB4052; H:AM0PR0502MB3971.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9gAYOM8iOKg0r+il+PRY8fG5ftKeBhc9imXPv9F2XMCNj91sBbTTT6liXrpbxQPIMz00Xei6j8uW/6xREO1yVkEv4ma5CP90Pb+9g8LEbm0PS9EdF/fmmQ3VtGdIfAVtlOFD2pOREbICDBAkEVjxP5oMuAXAwYXL2IkgYnOeaKWPqRcmXIL4v17ONdVXApMyILMQODtjtrITVDhBQhGZwRXDjLEOmHZRt125mrTBVxQ66iFnsjFT+dA7/cF8iIXjZYjusGLUQAqYxZ0GaTlMva6Y/KWAHGPyJV+FGLjswZoysvBQRheTSgtBxIg46RHQFvml8h0R2CcnuxK1gYNB7ofLMDdBBJoIuDrqn8olsJX7i+quKKGOhEMTVU/0q9rwizznyHFaeXT0YakB0sGDu+TDds6zKx6QW6qTlOiorCM= Content-Type: text/plain; charset="UTF-8" Content-ID: <0706F20DD20B934F90E8A69E22012D4F@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d20d4e14-1c98-4117-0d2e-08d6c3f08def X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2019 11:25:25.8764 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB4052 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: <20190418112525.rNqG0Z5X1ZjP3zE-XrPsvbZxLVBNeKmbLeCVLlq59tg@z> > On Apr 18, 2019, at 3:14 AM, Bruce Richardson wrote: >=20 > 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, >>>=20 >>>=20 >>>=20 >>> Thanks, >>> Yongseok >>>=20 >>>> On Apr 15, 2019, at 3:12 AM, Luca Boccassi < >>>> bluca@debian.org >>>>> wrote: >>>>=20 >>>> 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. >>>>>=20 >>>>> Fixes: e30b4e566f47 ("build: improve dependency handling") >>>>> Cc:=20 >>>>> bluca@debian.org >>>>>=20 >>>>>=20 >>>>> Cc:=20 >>>>> stable@dpdk.org >>>>>=20 >>>>>=20 >>>>>=20 >>>>> Signed-off-by: Yongseok Koh < >>>>> yskoh@mellanox.com >>>>>=20 >>>>>=20 >>>>> --- >>>>> drivers/net/mlx4/meson.build | 19 +++++++++++-------- >>>>> drivers/net/mlx5/meson.build | 19 +++++++++++-------- >>>>> 2 files changed, 22 insertions(+), 16 deletions(-) >>>>>=20 >>>>> 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=3D"@0@"'.format(LIB_GLUE_VERSION), >>>>> ] >>>>> endif >>>>> -libs =3D [ >>>>> - dependency('libmnl', required:false), >>>>> - dependency('libmlx4', required:false), >>>>> - dependency('libibverbs', required:false), >>>>> -] >>>>> +libs =3D [ 'libmnl', 'libmlx4', 'libibverbs' ] >>>>> +lib_deps =3D [] >>>>> build =3D true >>>>> foreach lib:libs >>>>> - if not lib.found() >>>>> + lib_dep =3D dependency(lib, required:false) >>>>> + if not lib_dep.found() >>>>> + lib_dep =3D cc.find_library(lib, required:false) >>>>=20 >>>> Doesn't this end up trying to link the test program to -llibmnl and >>>> thus failing? >>>=20 >>> I also worried about that. But it works fine. >>> Looks meson is smart enough. :-) >>=20 >> 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. >>=20 >> In the meson configure log, do you see: >>=20 >> Dependency libmlx4 found: NO >> Library libmlx4 found: YES Thanks for the note, Luca. It worked regardless. Compilation's done successfully and the final testpmd binary was good to run. Don't know how it worked but will change it anyway.= Not a hard task. Here's the diff. $ git diff diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index 9d04dd930d..2540489bb7 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -13,11 +13,11 @@ if pmd_dlopen '-DMLX4_GLUE_VERSION=3D"@0@"'.format(LIB_GLUE_VERSION), ] endif -libnames =3D [ 'libmnl', 'libmlx4', 'libibverbs' ] +libnames =3D [ 'mnl', 'mlx4', 'ibverbs' ] libs =3D [] build =3D true foreach libname:libnames - lib =3D dependency(libname, required:false) + lib =3D dependency('lib' + libname, required:false) if not lib.found() lib =3D cc.find_library(libname, required:false) endif diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index ee8399af27..1a65c3a989 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -13,11 +13,11 @@ if pmd_dlopen '-DMLX5_GLUE_VERSION=3D"@0@"'.format(LIB_GLUE_VERSION), ] endif -libnames =3D [ 'libmnl', 'libmlx5', 'libibverbs' ] +libnames =3D [ 'mnl', 'mlx5', 'ibverbs' ] libs =3D [] build =3D true foreach libname:libnames - lib =3D dependency(libname, required:false) + lib =3D dependency('lib' + libname, required:false) if not lib.found() lib =3D cc.find_library(libname, required:false) endif Then, it will give us: Dependency libmnl found: NO Library mnl found: YES Dependency libmlx5 found: NO Library mlx5 found: YES Dependency libibverbs found: NO Library ibverbs found: YES Thanks, Yongseok