Skip to contentSkip to conversation

use pkg-config to find Netcope dependencies

PATCH In review Thomas Monjalon 3 participants 10 messages Sep 14, 2019 – Oct 3, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover use pkg-config to find Netcope dependencies

The libraries required for Netcope PMDs can be found in
https://www.netcope.com/en/company/community-support/dpdk-libsze2

These libraries are compatible with pkg-config, which is a better solution than directly looking for libraries and includes.
These patches are using exclusively pkg-config with meson.

Thomas Monjalon (2):
net/nfb: fix dependency check
net/szedata2: fix dependency check

 drivers/net/nfb/meson.build      | 9 ++-------
 drivers/net/szedata2/meson.build | 2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/2 net/nfb: fix dependency check

The library libnfb is part of netcope-common which provides a pkg-config file: netcope-common.pc.
Looking for this .pc file - with dependency() - is preferred than looking for the library - with cc.find_library().

If the library is not installed in a standard path, it can be found thanks to PKG_CONFIG_PATH variable. The previous solution required to use CFLAGS and LDFLAGS environment variables.

Fixes 6435f9a0ac22 ("net/nfb: add new netcope driver")
---
 drivers/net/nfb/meson.build | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/nfb/meson.build +2 -7
index 4502c3f76..d53e8eca7 100644
@@ -3,14 +3,9 @@
 # Copyright(c) 2019 Netcope Technologies, a.s. <[email protected]>
 # All rights reserved.
 
-dep = cc.find_library('nfb', required: false)
+dep = dependency('netcope-common', required: false)
 reason = 'missing dependency, "libnfb"'
-
-build = dep.found() and cc.has_header('nfb/nfb.h', dependencies: dep)
-
-nc = dependency('netcope-common', required: false)
-
+build = dep.found()
 ext_deps += dep
-ext_deps += nc
 
 sources = files('nfb_rx.c', 'nfb_tx.c', 'nfb_stats.c', 'nfb_ethdev.c', 'nfb_rxmode.c')
Signature · 1 line
2.23.0
Acked-by on v1 1/2
#2 lore raw

Re: [dpdk-dev] [PATCH 1/2] net/nfb: fix dependency check

Quoted 11 lines · Thomas Monjalon

The library libnfb is part of netcope-common which provides a pkg-config file: netcope-common.pc.
Looking for this .pc file - with dependency() - is preferred than looking for the library - with cc.find_library().

If the library is not installed in a standard path, it can be found thanks to PKG_CONFIG_PATH variable. The previous solution required to use CFLAGS and LDFLAGS environment variables.

Quoted 4 lines
Fixes 6435f9a0ac22 ("net/nfb: add new netcope driver")
Quoted 28 lines
---
 drivers/net/nfb/meson.build | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/nfb/meson.build +2 -8
index 4502c3f76..d53e8eca7 100644
@@ -3,14 +3,9 @@
 # Copyright(c) 2019 Netcope Technologies, a.s. <[email protected]>
 # All rights reserved.
 
-dep = cc.find_library('nfb', required: false)
+dep = dependency('netcope-common', required: false)
 reason = 'missing dependency, "libnfb"'
-
-build = dep.found() and cc.has_header('nfb/nfb.h', dependencies: dep)
-
-nc = dependency('netcope-common', required: false)
-
+build = dep.found()
 ext_deps += dep
-ext_deps += nc
 
 sources = files('nfb_rx.c', 'nfb_tx.c', 'nfb_stats.c', 'nfb_ethdev.c', 'nfb_rxmode.c')
--

2.23.0

#3 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH 1/2] net/nfb: fix dependency check

15/09/2019 14:04, Jan Remeš:

Quoted 12 lines · Thomas Monjalon
Quoted 11 lines

The library libnfb is part of netcope-common which provides a pkg-config file: netcope-common.pc.
Looking for this .pc file - with dependency() - is preferred than looking for the library - with cc.find_library().

If the library is not installed in a standard path, it can be found thanks to PKG_CONFIG_PATH variable. The previous solution required to use CFLAGS and LDFLAGS environment variables.

Quoted 5 lines
Quoted 4 lines
Fixes 6435f9a0ac22 ("net/nfb: add new netcope driver")

Series applied

#4 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH 1/2] net/nfb: fix dependency check

16/09/2019 17:46, Thomas Monjalon:

Quoted 13 lines

15/09/2019 14:04, Jan Remeš:

Quoted 12 lines · Thomas Monjalon
Quoted 11 lines

The library libnfb is part of netcope-common which provides a pkg-config file: netcope-common.pc.
Looking for this .pc file - with dependency() - is preferred than looking for the library - with cc.find_library().

If the library is not installed in a standard path, it can be found thanks to PKG_CONFIG_PATH variable. The previous solution required to use CFLAGS and LDFLAGS environment variables.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Fixes 6435f9a0ac22 ("net/nfb: add new netcope driver")

Series applied

Sorry no, not applied on master.
It should go in next-net after Ferruh's review.

#5 lore raw

PATCH 2/2 net/szedata2: fix dependency check

In reply to Thomas Monjalon

The library libsze2 provides a pkg-config file: libsze2.pc. Looking for this .pc file - with dependency() - is preferred than looking for the library - with cc.find_library().

If the library is not installed in a standard path, it can be found thanks to PKG_CONFIG_PATH variable. The previous solution required to use CFLAGS and LDFLAGS environment variables.

Fixes 508cfe6be9f1 ("net/szedata2: add to meson build")
---
 drivers/net/szedata2/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/szedata2/meson.build +1 -1
index 032b42518..b53fcbc59 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-dep = cc.find_library('sze2', required: false)
+dep = dependency('libsze2', required: false)
 build = dep.found()
 reason = 'missing dependency, "libsze2"'
 ext_deps += dep
Signature · 1 line
2.23.0
Acked-by on v1 2/2
#6 lore raw

Re: [dpdk-dev] [PATCH 2/2] net/szedata2: fix dependency check

Quoted 10 lines · Thomas Monjalon

The library libsze2 provides a pkg-config file: libsze2.pc. Looking for this .pc file - with dependency() - is preferred than looking for the library - with cc.find_library().

If the library is not installed in a standard path, it can be found thanks to PKG_CONFIG_PATH variable. The previous solution required to use CFLAGS and LDFLAGS environment variables.

Quoted 4 lines
Fixes 508cfe6be9f1 ("net/szedata2: add to meson build")
Quoted 20 lines
---
 drivers/net/szedata2/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/szedata2/meson.build +1 -2
index 032b42518..b53fcbc59 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-dep = cc.find_library('sze2', required: false)
+dep = dependency('libsze2', required: false)
 build = dep.found()
 reason = 'missing dependency, "libsze2"'
 ext_deps += dep
--

2.23.0

#7 lore raw
In reply to Thomas Monjalon
Quoted 12 lines · Thomas Monjalon

The libraries required for Netcope PMDs can be found in
https://www.netcope.com/en/company/community-support/dpdk-libsze2

These libraries are compatible with pkg-config, which is a better solution than directly looking for libraries and includes.
These patches are using exclusively pkg-config with meson.

Thomas Monjalon (2):
net/nfb: fix dependency check
net/szedata2: fix dependency check

+1 to this patch, unrelated to this patch I remember there was an issue with the nfb & szedata2 dependencies, that their dependencies conflict with each other, so it wasn't possible to enable both at the same time.

Jan, Rastislav,

Is it still the case, or is there any improvement there?

Thanks,
ferruh

#8 lore raw
Quoted 7 lines · Ferruh Yigit

+1 to this patch, unrelated to this patch I remember there was an issue with the nfb & szedata2 dependencies, that their dependencies conflict with each other, so it wasn't possible to enable both at the same time.

Jan, Rastislav,

Is it still the case, or is there any improvement there?

They work with the same hardware, they are (crudely and rudely speaking) just mutually incompatible versions of the same thing (both provide configuration access and data transfer for Netcope NFB family of FPGA cards).

Therefore, there is no motivation to install both of them, "szedata2 (libsze2)" is deprecated and we only want to keep the PMD for existing users. If it becomes a burden, we will phase it out eventually.

Regards,
Jan

#9 lore raw
In reply to Thomas Monjalon
Quoted 11 lines · Thomas Monjalon

The libraries required for Netcope PMDs can be found in
https://www.netcope.com/en/company/community-support/dpdk-libsze2

These libraries are compatible with pkg-config, which is a better solution than directly looking for libraries and includes.
These patches are using exclusively pkg-config with meson.

Thomas Monjalon (2):
net/nfb: fix dependency check
net/szedata2: fix dependency check

Series applied to dpdk-next-net/master, thanks.