DPDK usage discussions
 help / color / mirror / Atom feed
* Re: [dpdk-users] Building app with source in subdirectory ?doesn't work
@ 2018-09-09 10:51 Rami Rosen
  2018-09-09 18:21 ` Petr Houska
  0 siblings, 1 reply; 5+ messages in thread
From: Rami Rosen @ 2018-09-09 10:51 UTC (permalink / raw)
  To: users, t-pehous

HI Peter,

>I tried debugging the `Makefile` via `make D=1` but it doesn't output any debug >information before failing on abovementioned message.

You need to run "make V=1" in order to get debug messages in the build
process, and not D=1. I would suggest that you will try again with V=1
and post the log here.

Second, where is the Makefile (with SRC-y) that you mentioned located ?

If I understand correctly, you added the "tst" folder under the root DPDK tree.

Third: usually applications are added under the examples folder or the
app folder, and you can follow recent patches of adding app under
examples, unless it is mandatory that the tst folder you added will be
under the root DPDK folder.

Regards,
Rami Rosen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] Building app with source in subdirectory ?doesn't work
  2018-09-09 10:51 [dpdk-users] Building app with source in subdirectory ?doesn't work Rami Rosen
@ 2018-09-09 18:21 ` Petr Houska
  2018-09-10  9:14   ` Rami Rosen
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Houska @ 2018-09-09 18:21 UTC (permalink / raw)
  To: Rami Rosen, users

Hi,

> >I tried debugging the `Makefile` via `make D=1` but it doesn't output any debug
> >information before failing on abovementioned message.
> 
> You need to run "make V=1" in order to get debug messages in the build process,
> and not D=1. I would suggest that you will try again with V=1 and post the log
> here.

The "V=1" option only turns it to verbose mode which prints the command that is being run. 
Unfortunately due to the way the extapp.rte.mk Makefile is done it doesn't print anything useful.

The "D=1" actually shows what targets are run and why for a dry (i.e. after `make clean`) run. When
(at least the tst.o) is build, however, it simply fails on it with the previously mentioned message without
outputting anything useful.

t-***@***-Virtual-Machine:~/dev/dpdk-18.05/examples/helloworld$ make V=1
mkdir -p /home/t-pehous/dev/dpdk-18.05/examples/helloworld/build
make -C /home/t-pehous/dev/dpdk-18.05/examples/helloworld/build -f /home/t-pehous/dev/dpdk-18.05/examples/helloworld/Makefile \
        S=/home/t-pehous/dev/dpdk-18.05/examples/helloworld O=/home/t-pehous/dev/dpdk-18.05/examples/helloworld/build SRCDIR=/home/t-pehous/dev/dpdk-18.05/examples/helloworld
make[1]: Nothing to be done for 'tst.o'.


> Second, where is the Makefile (with SRC-y) that you mentioned located ?
> If I understand correctly, you added the "tst" folder under the root DPDK tree.

No, that's not the case. I added it to the project's root and so the FS structure is following.

examples/helloworld
|-main.c
|-Makefile
|-tst       //This is the folder I added
   |-tst.c //This is the file I added

And the contents of Makefile are following (the rest is without any changes):
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation

# binary name
APP = helloworld

# all source are stored in SRCS-y | I added the tst/tst.c entry
SRCS-y := main.c \
        tst/tst.c

...the rest of example's makefile

> Third: usually applications are added under the examples folder or the app
> folder, and you can follow recent patches of adding app under examples, unless
> it is mandatory that the tst folder you added will be under the root DPDK folder.

Just to be clear this has nothing to the with the helloworld app / being located within 
the examples folder of DPDK's root. Whenever you create a DPDK app _anywhere_, 
use the advised way of creating Makefile (i.e. include extapp.rte.mk) and have source file
that you add to SRC-y in a subfolder of current's project root the same issue happens.

I only chose the helloworld example to create a simple repro for you.

Regards Petr Houska

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] Building app with source in subdirectory ?doesn't work
  2018-09-09 18:21 ` Petr Houska
@ 2018-09-10  9:14   ` Rami Rosen
  2018-09-10 16:47     ` Petr Houska
  0 siblings, 1 reply; 5+ messages in thread
From: Rami Rosen @ 2018-09-10  9:14 UTC (permalink / raw)
  To: t-pehous; +Cc: users

Hi Petr,

OK, your reply clarifies the issue. I confirm that I could reproduce
the same issue
you had following your reply. So something is missing, or maybe if the
use case is justified, maybe
additional work should be done in the build system (maybe related to
mk/rte.extsubdir.mk) to support it (I assume you know the build system
is now moving to meson/ninja)

I found a workaround, maybe it will satisfy you.
I created a soft link from the helloworld folder:
ln -s tst/tst.c tst.c
and
instead having
SRCS-y := main.c \
        tst/tst.c
I use
SRCS-y := main.c tst.c

And it works for me. Any change in tst/tst.c and running make triggers
building of tst/tst.c. "make clean" works, etc.

Another thing that I wan to mention that generally the build system
does support nesting
but in a different way than you try. What I mean is creating
subfolders under a sprcified folder, but not
having modules at all in the root folder.
For example, the multi process sample app:
https://git.dpdk.org/dpdk/tree/examples/multi_process

Regards,
Rami Rosen
http://ramirose.wixsite.com/ramirosen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] Building app with source in subdirectory ?doesn't work
  2018-09-10  9:14   ` Rami Rosen
@ 2018-09-10 16:47     ` Petr Houska
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Houska @ 2018-09-10 16:47 UTC (permalink / raw)
  Cc: users

Hi,

> OK, your reply clarifies the issue. I confirm that I could reproduce 
> the same issue you had following your reply. So something is missing, 
> or maybe if the use case is justified, maybe additional work should be 
> done in the build system (maybe related to
> mk/rte.extsubdir.mk) to support it (I assume you know the build system 
> is now moving to meson/ninja)

It would be really beneficial for (I suppose not only) our use case where we generate some files (.c and .h) for serialization/deserialization (we're using thrift) and would prefer them contained in a standalone folder. 

Having it in standalone folder makes a few things easier. It clearly communicates that these are compiler generated files. It also makes regenerating / clearing them easy and safe.

And I don't think that's the only usecase for having modules both in project's root and a subfolder.

> 
> I found a workaround, maybe it will satisfy you.
> I created a soft link from the helloworld folder:
> ln -s tst/tst.c tst.c
> and
> instead having
> SRCS-y := main.c \
>         tst/tst.c
> I use
> SRCS-y := main.c tst.c
> 
> And it works for me. Any change in tst/tst.c and running make triggers 
> building of tst/tst.c. "make clean" works, etc.

Awesome! That's better than the hack workaround I came up with.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-users] Building app with source in subdirectory ?doesn't work
@ 2018-09-09  4:49 Petr Houska
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Houska @ 2018-09-09  4:49 UTC (permalink / raw)
  To: users

Hi,
I'm having troubles creating a working Makefile for DPDK app that has source files in subdirectories.
Minimal repro I created uses the `helloworld` sample with following changes:

  1.  Add `tst` subdirectory to project's root
  2.  Add empty `tst.c` file to such subdirectory
  3.  Modify original `Makefile`'s SRC-y variable so that it includes `tst/tst.c`
When doing that the fist invoke of `make` works just fine and build the app correctly. Subsequent invokes
(unless either build directory is cleaned manually or `make clean` is invoked), however, don't track changes in
files and always fail on `make[1]: Nothing to be done for 'tst.o'.`.

I tried debugging the `Makefile` via `make D=1` but it doesn't output any debug information before failing on
abovementioned message.

Moving `tst.c` to root folder solved the issue. The issue has been observed with custom Makefiles referencing
`app.rte.mk` as well so it's not just helloworld's issue.

Petr Houska
Azure Intern

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-10 16:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-09 10:51 [dpdk-users] Building app with source in subdirectory ?doesn't work Rami Rosen
2018-09-09 18:21 ` Petr Houska
2018-09-10  9:14   ` Rami Rosen
2018-09-10 16:47     ` Petr Houska
  -- strict thread matches above, loose matches on Subject: below --
2018-09-09  4:49 Petr Houska

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).