> On Apr 18, 2019, at 3:14 AM, Bruce Richardson <bruce.richard...@intel.com> > wrote: > > 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 < >>>> bl...@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: >>>>> bl...@debian.org >>>>> >>>>> >>>>> Cc: >>>>> sta...@dpdk.org >>>>> >>>>> >>>>> >>>>> Signed-off-by: Yongseok Koh < >>>>> ys...@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
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="@0@"'.format(LIB_GLUE_VERSION), ] endif -libnames = [ 'libmnl', 'libmlx4', 'libibverbs' ] +libnames = [ 'mnl', 'mlx4', 'ibverbs' ] libs = [] build = true foreach libname:libnames - lib = dependency(libname, required:false) + lib = dependency('lib' + libname, required:false) if not lib.found() lib = 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="@0@"'.format(LIB_GLUE_VERSION), ] endif -libnames = [ 'libmnl', 'libmlx5', 'libibverbs' ] +libnames = [ 'mnl', 'mlx5', 'ibverbs' ] libs = [] build = true foreach libname:libnames - lib = dependency(libname, required:false) + lib = dependency('lib' + libname, required:false) if not lib.found() lib = 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