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 57E44A00E6 for ; Mon, 15 Apr 2019 21:48:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D00FD1B3B5; Mon, 15 Apr 2019 21:48:26 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130084.outbound.protection.outlook.com [40.107.13.84]) by dpdk.org (Postfix) with ESMTP id 056161B215; Mon, 15 Apr 2019 21:48:25 +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=7NtGQxT8WJ/W9tJhT1LQ2ssh6lkhSiph0VmRpzdzsUY=; b=sAh3luH0UiP/R34nEHPuYWMAls2OSwGBHHRoTTGqOOS7iU5XFPPxqMW9bEfZyFpwM5s9pe8YAnmwx55FyzxdsSWTvdnLcQDB8igm9jY4mUwKIQniSZJ3xoVQrT0N29tV2lCYsbbBsZa1FcAZqNb4y7MYwG2NRkljStsGnoD/jog= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4057.eurprd05.prod.outlook.com (52.134.67.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.17; Mon, 15 Apr 2019 19:48:23 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a%3]) with mapi id 15.20.1792.018; Mon, 15 Apr 2019 19:48:23 +0000 From: Yongseok Koh To: Luca Boccassi CC: Bruce Richardson , 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: AQHU8Yb4dNKN2lEEa0GyaR3eo4jOEaY9BGiAgACg5wA= Date: Mon, 15 Apr 2019 19:48:23 +0000 Message-ID: <73A9F0FA-6EDC-4D46-BF28-F60915D333B4@mellanox.com> References: <20190412232451.30197-1-yskoh@mellanox.com> <20190412232451.30197-4-yskoh@mellanox.com> <27a65b1d1737f475a6e32d5c3947d1c2b81d37fb.camel@debian.org> In-Reply-To: <27a65b1d1737f475a6e32d5c3947d1c2b81d37fb.camel@debian.org> 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: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7778cbac-5acd-468e-48b9-08d6c1db51e2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600140)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:DB3PR0502MB4057; x-ms-traffictypediagnostic: DB3PR0502MB4057: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 000800954F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(39860400002)(376002)(396003)(136003)(199004)(189003)(25786009)(83716004)(106356001)(105586002)(229853002)(36756003)(33656002)(14454004)(5660300002)(2616005)(486006)(446003)(82746002)(6486002)(6436002)(11346002)(71190400001)(478600001)(476003)(256004)(6512007)(6916009)(6506007)(86362001)(76176011)(6246003)(102836004)(7736002)(316002)(81166006)(71200400001)(54906003)(53546011)(305945005)(68736007)(8936002)(99286004)(81156014)(3846002)(4326008)(66066001)(186003)(26005)(2906002)(6116002)(8676002)(97736004)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4057; H:DB3PR0502MB3980.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: /+hV6DyePIylSiEfygQqS6N5yNk8P0DOw7ts/NughAXN1ZVEKdCmJvhV7n+dctMyhZAm7Bh28ss6Qpz7Xsby591wjrlRehKI6+CPp2RqXhYEN92cUR2EkXOXcDQK4YQKBMlIzqJPxx1vUOSPLjuucdAsHNm/kYl5b+4+r1rtO9YCpXHPvMosoanxt5+0Yv2ZqkEnWOGwcT1COVahNf8jpdwkkxaV81CvCqyEK1DZdX0csHFUcjiMhVo4crbbkvprWFoBSk8QjGOC26uDnicPIL2KUzW9RWp7pHzNfdw1zj1lHZJU25sMDeepGWE4fx9/VEZJnnAttRg2IV0/jbeTibCUWym+pyph3IwBNTUjD8EZwLVUtehIEaDnFgMhaqGJDt9DZJfgTGFS38csS3YwnrYrWsSo4VKrp6Mq+flyywI= Content-Type: text/plain; charset="UTF-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7778cbac-5acd-468e-48b9-08d6c1db51e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2019 19:48:23.3145 (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: DB3PR0502MB4057 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: <20190415194823.bjjLnms2jjVEaC8V1NSsQzPxNrPA_IDeK2GniZxD6sg@z> Hi, Thanks, Yongseok > On Apr 15, 2019, at 3:12 AM, Luca Boccassi 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 >> Cc:=20 >> stable@dpdk.org >>=20 >>=20 >> Signed-off-by: Yongseok Koh < >> yskoh@mellanox.com >>>=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? I also worried about that. But it works fine. Looks meson is smart enough. :-) >> + endif >> + if lib_dep.found() >> + lib_deps +=3D [ lib_dep ] >> + else >> build =3D false >> endif >> endforeach >> # Compile PMD >> if build >> allow_experimental_apis =3D true >> - ext_deps +=3D libs >> + ext_deps +=3D lib_deps >> sources =3D files( >> 'mlx4.c', >> 'mlx4_ethdev.c', >> @@ -103,7 +106,7 @@ if pmd_dlopen and build >> dlopen_sources, >> include_directories: global_inc, >> c_args: cflags, >> - dependencies: libs, >> + dependencies: libs_deps, >> link_args: [ >> '-Wl,-export-dynamic', >> '-Wl,-h,@0@'.format(LIB_GLUE), >=20 > --=20 > Kind regards, > Luca Boccassi