DPDK patches and discussions
 help / color / mirror / Atom feed
From: Abhineet Pandey <abhineet.pandey@nutanix.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [Question/Issue] pkgconfig does not include dpdk/drivers libs
Date: Thu, 3 Aug 2023 09:15:11 +0000	[thread overview]
Message-ID: <CO6PR02MB8820C12D6B09DCE24E38BA0AF508A@CO6PR02MB8820.namprd02.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2177 bytes --]

I’m consuming dpdk via spdk.
I was trying to use pkg-config for a Makefile that I’m writing,

Executing:
PKG_CONFIG_PATH=dpdk/build/lib/pkgconfig pkg-config --libs --static libdpdk

Output:
-Wl,--whole-archive -Wl,--no-whole-archive -Wl,--as-needed -pthread -L/home/nutanix/exact_spdk/spdk/dpdk/build/lib -l:librte_bus_pci.a -l:librte_bus_vdev.a -l:librte_mempool_ring.a -l:librte_vhost.a -l:librte_security.a -l:librte_reorder.a -l:librte_power.a -l:librte_cryptodev.a -l:librte_compressdev.a -l:librte_timer.a -l:librte_hash.a -l:librte_cmdline.a -l:librte_pci.a -l:librte_ethdev.a -l:librte_meter.a -l:librte_net.a -l:librte_mbuf.a -l:librte_mempool.a -l:librte_rcu.a -l:librte_ring.a -l:librte_eal.a -l:librte_telemetry.a -l:librte_kvargs.a -lrte_vhost -lrte_security -lrte_reorder -lrte_power -lrte_cryptodev -lrte_compressdev -lrte_timer -lrte_hash -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs -lm -ldl -lnuma

At a closer look, you’ll see -l:librte_bus_pci.a -l:librte_bus_vdev.a -l:librte_mempool_ring.a, but you won’t find corresponding -lrte_bus_pci, -lrte_bus_vdev, -lrte_mempool_ring. This showed up in my use case as rte_mempool_ring has some functions which execute on startup via __attribute__((constructor)), and they did not execute thus causing issues.

I think the issue is that in pkgconfig we reference ‘dpdk_libraries’, which is updated libs/meson.build, but not updated in drivers/meson.build.

If I apply this fix:

--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -277,7 +277,7 @@ foreach subpath:subdirs
         static_dep = declare_dependency(
                 include_directories: includes,
                 dependencies: static_deps)
-
+        dpdk_libraries = [shared_lib] + dpdk_libraries
          dpdk_drivers += static_lib

Then things work well and I see -lrte_bus_pci, -lrte_bus_vdev, -lrte_mempool_ring in output of:
PKG_CONFIG_PATH=dpdk/build/lib/pkgconfig pkg-config --libs --static libdpdk

Please let me know if the current behavior is expected, or this change is needed.

Regards
Abhineet Pandey

[-- Attachment #2: Type: text/html, Size: 4327 bytes --]

             reply	other threads:[~2023-08-03  9:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  9:15 Abhineet Pandey [this message]
2023-08-03 10:15 ` Bruce Richardson
2023-08-03 12:51   ` Abhineet Pandey
2023-08-03 13:01     ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO6PR02MB8820C12D6B09DCE24E38BA0AF508A@CO6PR02MB8820.namprd02.prod.outlook.com \
    --to=abhineet.pandey@nutanix.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).