From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A260A04DB; Tue, 10 Nov 2020 15:36:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4E21C2B9D; Tue, 10 Nov 2020 15:36:24 +0100 (CET) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id EB4752B93 for ; Tue, 10 Nov 2020 15:36:21 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id EC32BD31; Tue, 10 Nov 2020 09:36:16 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 10 Nov 2020 09:36:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= P1XDgyYWp5WmpoIG98/lNjmJNQm42ooPVHksJ45+Pc4=; b=XA9+13KcxNNuCnAx 0cHZxz5bItIFpvvkaxTk2+T35AVxDCJzcE4RCHFyewouG4xgNftbXf0/OceXJgHf C58hwmxgI/SVCuNEMZbLf/SM8U56NXTeMDKKuCKcwFZ6aMaeI13VBMROW2gz2NsN wmO4e4SfVqtIO36ehMR3XwUHwYTEwXhj5k2b/rE4cf6+J2IkELzHCloUPO0c2jt7 Ms7YKmpc9Y5U5xMiTrzRfBETVqNex7HXAkmWZEC5QpcLLrnhURoke96pVa3mZfjY S+JfNG97u5ry9mMPpi5Z1bCHILJZgh8KOywrFwyJ6Z/TJ2aVUVXC118q7K40TSXP DrMjHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=P1XDgyYWp5WmpoIG98/lNjmJNQm42ooPVHksJ45+P c4=; b=gbyMjQqHIYNFwbqrL3U7lQnZmwQcua6sKYEyIhfL97BmHcV3U51qZSyrc xHblzHQTJYa1XTGwWZP4bNC7ntEew5sF/QANSA+DFUshee4nEWhJ/2lrVFjDe1Gj gVGq+Rct6GDQYtNV8A6Yb3S8QbhgMa3DIfFoUb8nuvZZ7onnJn0upJ6fbdhjZ/xM TbQ7D+ot3K2inB1s8rMZYc3csn2Z6TalQlYl1mbfW/IIl4RdBkluYyGhJ55L38gs N8aRzldUMzkOr9YIRsMxBC94tAx9PiULD9Ajnf0TLwCmHknl2Ok1x4hotAcJYfUq 2eHoE6KjF/9vv+nIvbZ8lPMHiBRXw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddujedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepffdvffejueetleefieeludduuefgteejleevfeekjeefieegheet ffdvkeefgedunecuffhomhgrihhnpeguphgukhdrohhrghenucfkphepjeejrddufeegrd dvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 70FAF3063085; Tue, 10 Nov 2020 09:36:15 -0500 (EST) From: Thomas Monjalon To: Bruce Richardson Cc: dev@dpdk.org, david.marchand@redhat.com Date: Tue, 10 Nov 2020 15:36:14 +0100 Message-ID: <4260818.77I6s4UBcg@thomas> In-Reply-To: <20201110141900.GH1641@bricha3-MOBL.ger.corp.intel.com> References: <20201027173836.891184-1-bruce.richardson@intel.com> <2421980.ZJesrIL0Ng@thomas> <20201110141900.GH1641@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] devtools/test-meson-builds: allow custom set of examples X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 10/11/2020 15:19, Bruce Richardson: > On Tue, Nov 10, 2020 at 02:53:03PM +0100, Thomas Monjalon wrote: > > 10/11/2020 14:19, Bruce Richardson: > > > On Tue, Nov 10, 2020 at 02:04:21PM +0100, Thomas Monjalon wrote: > > > > 10/11/2020 12:34, Bruce Richardson: > > > > > On Tue, Nov 10, 2020 at 12:25:13PM +0100, Thomas Monjalon wrote: > > > > > > 10/11/2020 11:08, Bruce Richardson: > > > > > > > On Mon, Nov 09, 2020 at 08:26:10PM +0100, Thomas Monjalon wrote: > > > > > > > > 09/11/2020 19:02, Bruce Richardson: > > > > > > > > > On Mon, Nov 09, 2020 at 06:09:51PM +0100, Thomas Monjalon wrote: > > > > > > > > > > 27/10/2020 18:38, Bruce Richardson: > > > > > > > > > > > To test the installation process of DPDK using "ninja install" > > > > > > > > > > > test-meson-builds.sh builds a subset of the examples using "make". > > > > > > > > > > > To allow more flexibility for people testing, allow the set of > > > > > > > > > > > examples chosen for this make test to be overridden using variable > > > > > > > > > > > "DPDK_BUILD_TEST_EXAMPLES" in the environment. > > > > > > > > > > > > > > > > > > > > > > Since a number of example apps link against drivers directly even > > > > > > > > > > > for shared builds, we need to ensure that LD_LIBRARY_PATH points to > > > > > > > > > > > the main DPDK lib folder so any dependencies of those drivers can > > > > > > > > > > > be found e.g. that the PCI/vdev bus driver .so is found. [All > > > > > > > > > > > drivers are symlinked from drivers dir back to lib dir on install, > > > > > > > > > > > so only one dir rather than two is needed in the path.] > > > > > > > > > > [...] > > > > > > > > > > > +libdir=$(dirname $(find $DESTDIR -name librte_eal.so)) +export > > > > > > > > > > > LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH > > > > > > > > > > > > > > > > > > > > I don't get why libdir is required for some examples, and not for > > > > > > > > > > others? The pkg-config file is not enough? > > > > > > > > > > > > > > > > > > > > > > > > > > > > It's only needed for examples that link against drivers directly. > > > > > > > > > > > > > > > > > > I believe it's needed in those cases, because app linker flags > > > > > > > > > (including e.g. -lrte_pmd_bond) occur before the pkg-config flags, > > > > > > > > > which means that the linker at that point does not have the path to > > > > > > > > > find the dependencies of the driver. [In a normal build, this wouldn't > > > > > > > > > be necessary because the library directory would be a standard path] > > > > > > > > > > > > > > > > If it's just a matter of ordering, it would be a better example to fix > > > > > > > > the ordering in the Makefile, isn't it? > > > > > > > > > > > > > > > > > > > > > > I thought about that, but it seems strange to have the DPDK linker flags > > > > > > > appear before the application specific flags. The general style is to have > > > > > > > the apps own linker flags apply first, and then the list of dependencies, > > > > > > > so that any app linker flags take precedence. The other option is to have > > > > > > > two separate LDFLAG variables for the app, one for before pkg-config flags > > > > > > > and the other afterwards, but that is an untidy solution. > > > > > > > > > > > > > > Therefore, I think it's better to keep the ordering in the examples as-is > > > > > > > and just set the library path in the script. It's only a single extra > > > > > > > assignment that is necessary because we are installing to a non-standard > > > > > > > path using DESTDIR. > > > > > > > > > > > > It is OK to add LD_LIBRARY_PATH in test-meson-builds.sh because > > > > > > DPDK is "installed" with a DESTDIR prefix. > > > > > > > > > > > > But this change is unrelated to test more examples, > > > > > > it is a general fix for examples compilation. > > > > > > The thing I'm missing, as I said above, > > > > > > "why libdir is required for some examples, and not for others?" > > > > > > I feel something wrong made linking work where it should not. > > > > > > > > > > > > > > > > As I explained above, libdir is required for examples that link directly > > > > > against DPDK drivers in shared builds. There are only a few examples that > > > > > do so, which is why the majority worked fine, and why this was not needed > > > > > before. > > > > > > > > Sorry I don't understand how we link other libraries without LD_LIBRARY_PATH. > > > > Where the library path was taken from before this change? > > > > > > > > > > pkg-config outputs the library path via -L flag for all the other > > > libraries, which is why they are picked up. Right now the flags passed are > > > (in the case of the bonding example app): > > > > > > LDFLAGS += -lrte_net_bond > > > ... > > > LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) > > > ... > > > build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build > > > $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) > > > > > > which resolves to (roughly): > > > "-lrte_net_bond -L/path/to/dpdk/libs -lrte_ethdev ..." > > > > This is the part I still don't understand. > > How it can resolve to path including DESTDIR? > > In my test, it resolves to -L/usr/local/lib so it cannot work. > > > It's the --define-prefix parameter we pass to pkg-config that does the > trick. > > $ export PKG_CONFIG_LIBDIR=$(pwd)/usr/local/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig > > $ pkg-config --libs-only-L libdpdk > -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu > > $ pkg-config --define-prefix --libs-only-L libdpdk > -L/home/bruce/dpdk.org/__BUILDS/build-x86-default/install/usr/local/lib -L/usr/lib/lib/x86_64-linux-gnu > > This is done in test-meson-builds right before we call make for each > example: > > # if pkg-config defines the necessary flags, test building some examples > if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then > export PKGCONF="pkg-config --define-prefix" > ... > fi Yes this is what David suggested to me, but it doesn't work well for me (while test-meson-builds.sh works): PKG_CONFIG_PATH=../dpdk-build/build-x86-default/meson-private \ pkg-config --define-prefix --libs-only-L libdpdk -L/usr/local/lib Oh! I am testing on the build directory instead of installed one. PKG_CONFIG_PATH=../dpdk-build/build-x86-default/install/usr/local/lib/pkgconfig \ pkg-config --define-prefix --libs-only-L libdpdk -L../dpdk-build/build-x86-default/install/usr/local/lib Good :) Now THE question: what is the difference between these two .pc files?