From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <luca.boccassi@gmail.com>
Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com
 [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id C9A861B0FC;
 Mon, 15 Apr 2019 12:12:31 +0200 (CEST)
Received: by mail-wm1-f66.google.com with SMTP id q16so19875957wmj.3;
 Mon, 15 Apr 2019 03:12:31 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to
 :references:content-transfer-encoding:user-agent:mime-version;
 bh=CtUD5OnhMU5aIqa/B8JrVfCOWq9Jm23G2/mu8FqUD2I=;
 b=Ius0A5COtzSa2akG1xreL/PlLS9A/EZu01mO0TF73aOVJmJWqdzgIEDmdaN6g+Mbmb
 A/Ahu9Ht8O5qM6Y/jpQBIXG/yiAaJsQhwmsszmTCmwpPJis7m4exDt3qAbztD+zkTSBU
 XBSKvtlQOsm0SiKVLBC/m5KWShgVpbHArf+cuL+0wdsHbuaA1QP8a0L2nI8/WRP+q7v+
 qGojcNQ5sdtvQAPBdjWIt2d0oXodoAQZ8z5rPRJoPvvCOpLArsJ2Dq4M5iCXfAWf0+AR
 IzlScwHoR3an4CnLRghL6qn8t5/+kv6Uu2oV+v0e6DOOhwtFS1GEuwRa6GT8ubW8m6tf
 M99Q==
X-Gm-Message-State: APjAAAVJNlbNWnJPZPEOTp+wrcQ6Vgo+Q1PwO5yEDT6x58fXbWSVdGJW
 pb11p8tY2PWMhN8ut5g8Jp4=
X-Google-Smtp-Source: APXvYqyJXxZJdSChpi8ZF/E2EE6X8MUJ6sK3Nvp7FVhAQ/7k1hJjPy+Xt1HIXsE7oTqReCwZSL7NhA==
X-Received: by 2002:a7b:cb16:: with SMTP id u22mr21475871wmj.60.1555323151263; 
 Mon, 15 Apr 2019 03:12:31 -0700 (PDT)
Received: from localhost ([88.98.246.218])
 by smtp.gmail.com with ESMTPSA id t81sm34947416wmb.5.2019.04.15.03.12.29
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 15 Apr 2019 03:12:29 -0700 (PDT)
Message-ID: <27a65b1d1737f475a6e32d5c3947d1c2b81d37fb.camel@debian.org>
From: Luca Boccassi <bluca@debian.org>
To: Yongseok Koh <yskoh@mellanox.com>, bruce.richardson@intel.com, 
 jerinj@marvell.com, pbhagavatula@marvell.com, shahafs@mellanox.com
Cc: dev@dpdk.org, thomas@monjalon.net, gavin.hu@arm.com, 
 Honnappa.Nagarahalli@arm.com, stable@dpdk.org
Date: Mon, 15 Apr 2019 11:12:29 +0100
In-Reply-To: <20190412232451.30197-4-yskoh@mellanox.com>
References: <20190412232451.30197-1-yskoh@mellanox.com>
 <20190412232451.30197-4-yskoh@mellanox.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.30.5-1 
MIME-Version: 1.0
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 15 Apr 2019 10:12:32 -0000

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
> >
> ---
>  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)

Doesn't this end up trying to link the test program to -llibmnl and
thus failing?

> +	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
Kind regards,
Luca Boccassi

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id E8AF6A00E6
	for <public@inbox.dpdk.org>; Mon, 15 Apr 2019 12:12:33 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 8B6371B142;
	Mon, 15 Apr 2019 12:12:32 +0200 (CEST)
Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com
 [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id C9A861B0FC;
 Mon, 15 Apr 2019 12:12:31 +0200 (CEST)
Received: by mail-wm1-f66.google.com with SMTP id q16so19875957wmj.3;
 Mon, 15 Apr 2019 03:12:31 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to
 :references:content-transfer-encoding:user-agent:mime-version;
 bh=CtUD5OnhMU5aIqa/B8JrVfCOWq9Jm23G2/mu8FqUD2I=;
 b=Ius0A5COtzSa2akG1xreL/PlLS9A/EZu01mO0TF73aOVJmJWqdzgIEDmdaN6g+Mbmb
 A/Ahu9Ht8O5qM6Y/jpQBIXG/yiAaJsQhwmsszmTCmwpPJis7m4exDt3qAbztD+zkTSBU
 XBSKvtlQOsm0SiKVLBC/m5KWShgVpbHArf+cuL+0wdsHbuaA1QP8a0L2nI8/WRP+q7v+
 qGojcNQ5sdtvQAPBdjWIt2d0oXodoAQZ8z5rPRJoPvvCOpLArsJ2Dq4M5iCXfAWf0+AR
 IzlScwHoR3an4CnLRghL6qn8t5/+kv6Uu2oV+v0e6DOOhwtFS1GEuwRa6GT8ubW8m6tf
 M99Q==
X-Gm-Message-State: APjAAAVJNlbNWnJPZPEOTp+wrcQ6Vgo+Q1PwO5yEDT6x58fXbWSVdGJW
 pb11p8tY2PWMhN8ut5g8Jp4=
X-Google-Smtp-Source: APXvYqyJXxZJdSChpi8ZF/E2EE6X8MUJ6sK3Nvp7FVhAQ/7k1hJjPy+Xt1HIXsE7oTqReCwZSL7NhA==
X-Received: by 2002:a7b:cb16:: with SMTP id u22mr21475871wmj.60.1555323151263; 
 Mon, 15 Apr 2019 03:12:31 -0700 (PDT)
Received: from localhost ([88.98.246.218])
 by smtp.gmail.com with ESMTPSA id t81sm34947416wmb.5.2019.04.15.03.12.29
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 15 Apr 2019 03:12:29 -0700 (PDT)
Message-ID: <27a65b1d1737f475a6e32d5c3947d1c2b81d37fb.camel@debian.org>
From: Luca Boccassi <bluca@debian.org>
To: Yongseok Koh <yskoh@mellanox.com>, bruce.richardson@intel.com, 
 jerinj@marvell.com, pbhagavatula@marvell.com, shahafs@mellanox.com
Cc: dev@dpdk.org, thomas@monjalon.net, gavin.hu@arm.com, 
 Honnappa.Nagarahalli@arm.com, stable@dpdk.org
Date: Mon, 15 Apr 2019 11:12:29 +0100
In-Reply-To: <20190412232451.30197-4-yskoh@mellanox.com>
References: <20190412232451.30197-1-yskoh@mellanox.com>
 <20190412232451.30197-4-yskoh@mellanox.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.30.5-1 
MIME-Version: 1.0
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190415101229.FjvO7fNFtSMH8913zOFux1XqDyzmE8IRqjFt-apbcHU@z>

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
> >
> ---
>  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)

Doesn't this end up trying to link the test program to -llibmnl and
thus failing?

> +	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
Kind regards,
Luca Boccassi