Run-time dependency doca-flow found: NO (tried pkgconfig and cmake)

Hi,

I tried to play around with the ARP Storm Control app discussed in the DOCA Flow course, but I am not able to compile the app itself.
I found the generic troubleshooting guide https://docs.nvidia.com/doca/archive/doca-v1.3/troubleshooting/index.html, and I set all ENV vars properly, but I still cannot compile the app.

I tried running the doca-2.6.0-devel container on the Bluefield as well, but it throws the same error as below.

Version: 0.61.2
Source dir: /opt/mellanox/doca/dev/arp_storm_control
Build dir: /opt/mellanox/doca/dev/arp_storm_control/build
Build type: native build
Program cat found: YES (/usr/bin/cat)
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
Project name: ARP_STORM_CONTROL
Project version: 1.3.0012
C compiler for the host machine: cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C linker for the host machine: cc ld.bfd 2.38
C++ compiler for the host machine: c++ (gcc 11.4.0 "c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C++ linker for the host machine: c++ ld.bfd 2.38

Host machine cpu family: aarch64
Host machine cpu: aarch64
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency libdpdk found: YES 22.11.2401.1.0
Run-time dependency json-c found: YES 0.15
Run-time dependency threads found: YES
Found CMake: /usr/bin/cmake (3.22.1)
Run-time dependency doca-flow found: NO (tried pkgconfig and cmake)

meson.build:37:0: ERROR: Dependency "doca-flow" not found, tried pkgconfig and cmake

What am I doing wrong? What did I miss here?

I am not an expert in pkg-config, but tried to create the .pc files manually under /opt/mellanox/doca/lib/aarch64-linux-gnu/pkgconfig by finding the right .a lib files under /opt/mellanox/doca/lib/aarch64-linux-gnu

I created doca-argp.c as follows:

prefix=/opt/mellanox/doca
libdir=${prefix}/lib/aarch64-linux-gnu
includedir=${prefix}/include

Name: doca_argp
Description: DOCA (doca-argp) pkg-config file.
Version: 2.6.0058
Requires: doca-libs
Requires.private: libibverbs, libmlx5, json-c, protobuf, grpc++, libdpdk, doca
Libs.private: -L${libdir} -l:libdoca_argp.a -Wl,--as-needed -pthread -L${prefix}/lib/aarch64-linux-gnu  -lm
Cflags: -I${includedir}

Then, doca-common as follows:

prefix=/opt/mellanox/doca
libdir=${prefix}/lib/aarch64-linux-gnu
includedir=${prefix}/include

Name: doca_common
Description: DOCA (doca-common) pkg-config file.
Version: 2.6.0058
Requires: doca-libs
Requires.private: libibverbs, libmlx5, json-c, protobuf, grpc++, libdpdk, doca
Libs.private: -L${libdir} -l:libdoca_common.a -Wl,--as-needed -pthread -L${prefix}/lib/aarch64-linux-gnu  -lm
Cflags: -I${includedir}

and lastly, doca-flow.pc:

prefix=/opt/mellanox/doca
libdir=${prefix}/lib/aarch64-linux-gnu
includedir=${prefix}/include

Name: doca_flow
Description: DOCA (doca-flow) pkg-config file.
Version: 2.6.0058
Requires: doca-libs
Requires.private: libibverbs, libmlx5, json-c, protobuf, grpc++, libdpdk, doca
Libs.private: -L${libdir} -l:libdoca_flow.a -l:libdoca_flow_ct.a -Wl,--as-needed -pthread -L${prefix}/lib/aarch64-linux-gnu  -lm
Cflags: -I${includedir}

Then, the meson build can come over the depencies, but then it complained about

meson.build:43:0: ERROR: Include dir ../common/src does not exist.

I realized this directory is here: /opt/mellanox/doca/applications. So I copied the whole source of arp_storm_control into that directory.

Now, the error is a missing C file:

meson.build:58:0: ERROR: File ../common/src/offload_rules.c does not exist.

Which does not exist anywhere on the system.

I know I tried a very hacky way to overcome the problem (without success), but I thought I jot it down here