DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] build issue with out-of-tree builds and multiple mounts
@ 2015-05-04 12:42 Simon Kågström
  2015-05-04 12:48 ` Olivier MATZ
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Kågström @ 2015-05-04 12:42 UTC (permalink / raw)
  To: dev

Hi!

I'm trying to do a out-of-tree build of DPDK 2.0.0 (with make -C and
O=), but failing with errors such as

  In file included from
[...]/lib/librte_eal/common/include/rte_eal_memconfig.h:40:0,
  [...]
  rte_malloc_heap.h:39:26: fatal error: rte_spinlock.h: No such file or
directory

Looking in the include/ directory in my build directory, I see a lot of
invalid symlinks to things like rte_spinlock.h:

  lrwxrwxrwx 1 ska users   99 May  4 14:33 rte_spinlock.h ->
../[...]/dpdk/lib/librte_eal/common/include/arch/x86/rte_spinlock.h

and I believe that this is caused by my use of multiple mounts: I have
my home directory and the source code on NFS, while the build directory
is on local disk (under a build/-symlink from my home directory). So
using ../ relative to the build directory will actually end up on the
local disk, and not work.


I guess it should be possible to workaround this by building somewhere
else, but perhaps there is some patch to be made in mk/? Any pointer to
where to look?

// Simon

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

* Re: [dpdk-dev] build issue with out-of-tree builds and multiple mounts
  2015-05-04 12:42 [dpdk-dev] build issue with out-of-tree builds and multiple mounts Simon Kågström
@ 2015-05-04 12:48 ` Olivier MATZ
  2015-05-04 12:55   ` Simon Kågström
  0 siblings, 1 reply; 7+ messages in thread
From: Olivier MATZ @ 2015-05-04 12:48 UTC (permalink / raw)
  To: Simon Kågström, dev

Hi Simon,

On 05/04/2015 02:42 PM, Simon Kågström wrote:
> Hi!
> 
> I'm trying to do a out-of-tree build of DPDK 2.0.0 (with make -C and
> O=), but failing with errors such as
> 
>   In file included from
> [...]/lib/librte_eal/common/include/rte_eal_memconfig.h:40:0,
>   [...]
>   rte_malloc_heap.h:39:26: fatal error: rte_spinlock.h: No such file or
> directory
> 
> Looking in the include/ directory in my build directory, I see a lot of
> invalid symlinks to things like rte_spinlock.h:
> 
>   lrwxrwxrwx 1 ska users   99 May  4 14:33 rte_spinlock.h ->
> ../[...]/dpdk/lib/librte_eal/common/include/arch/x86/rte_spinlock.h

Can you please send the full make command line that produces this
issue?

Thanks,
Olivier



> 
> and I believe that this is caused by my use of multiple mounts: I have
> my home directory and the source code on NFS, while the build directory
> is on local disk (under a build/-symlink from my home directory). So
> using ../ relative to the build directory will actually end up on the
> local disk, and not work.
> 
> 
> I guess it should be possible to workaround this by building somewhere
> else, but perhaps there is some patch to be made in mk/? Any pointer to
> where to look?
> 
> // Simon
> 

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

* Re: [dpdk-dev] build issue with out-of-tree builds and multiple mounts
  2015-05-04 12:48 ` Olivier MATZ
@ 2015-05-04 12:55   ` Simon Kågström
  2015-05-05  9:00     ` [dpdk-dev] [PATCH] scripts: fix relpath.sh output when build dir is a symlink Olivier Matz
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Kågström @ 2015-05-04 12:55 UTC (permalink / raw)
  To: Olivier MATZ, dev

On 2015-05-04 14:48, Olivier MATZ wrote:
> Hi Simon,
> 
> On 05/04/2015 02:42 PM, Simon Kågström wrote:
>> Hi!
>>
>> I'm trying to do a out-of-tree build of DPDK 2.0.0 (with make -C and
>> O=), but failing with errors such as
>>
>>   In file included from
>> [...]/lib/librte_eal/common/include/rte_eal_memconfig.h:40:0,
>>   [...]
>>   rte_malloc_heap.h:39:26: fatal error: rte_spinlock.h: No such file or
>> directory
>>
>> Looking in the include/ directory in my build directory, I see a lot of
>> invalid symlinks to things like rte_spinlock.h:
>>
>>   lrwxrwxrwx 1 ska users   99 May  4 14:33 rte_spinlock.h ->
>> ../[...]/dpdk/lib/librte_eal/common/include/arch/x86/rte_spinlock.h
> 
> Can you please send the full make command line that produces this
> issue?

  make -C /home/ska/devel/dpdk EXTRA_CFLAGS="-g -O0"
RTE_KERNELDIR=/tmp/ubuntu-14.04/usr/src/linux-headers-3.13.0-51-generic
O=/home/ska/build/dpdk T=x86_64-default-linuxapp-gcc V=1

The config step works fine, but it fails on this step.

  /home/ska

is mounted on NFS, and

  /home/ska/build

is a symlink to

  /lhome/ska/build



It appears to work if I build outside the symlink, i.e.., build with
O=/lhome/ska/build/... instead.

// Simon

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

* [dpdk-dev] [PATCH] scripts: fix relpath.sh output when build dir is a symlink
  2015-05-04 12:55   ` Simon Kågström
@ 2015-05-05  9:00     ` Olivier Matz
  2015-05-05  9:00       ` Olivier MATZ
  0 siblings, 1 reply; 7+ messages in thread
From: Olivier Matz @ 2015-05-05  9:00 UTC (permalink / raw)
  To: dev

The script relpath.sh return the relative path of the first directory
from the second directory. It is used to generate relative symlinks,
which can be useful if the build directory is embedded in the dpdk
directory: the whole dpdk can be moved without breaking the links,
which is helpful for an installation.

In case the build directory is a symlink, the script was not generating
the proper relative path. Fix this by calling "readlink -f" on the
arguments.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 scripts/relpath.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/relpath.sh b/scripts/relpath.sh
index 00030e5..7d2f48f 100755
--- a/scripts/relpath.sh
+++ b/scripts/relpath.sh
@@ -43,8 +43,13 @@ if [ $# -ne 2 ]; then
 	exit 1
 fi
 
-REL1=${1#/}
-REL2=${2#/}
+# get the real absolute path, derefencing symlinks
+ABS1=$(readlink -f $1)
+ABS2=$(readlink -f $2)
+
+# remove leading slash
+REL1=${ABS1#/}
+REL2=${ABS2#/}
 
 left1=${REL1%%/*}
 right1=${REL1#*/}
-- 
2.1.4

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

* Re: [dpdk-dev] [PATCH] scripts: fix relpath.sh output when build dir is a symlink
  2015-05-05  9:00     ` [dpdk-dev] [PATCH] scripts: fix relpath.sh output when build dir is a symlink Olivier Matz
@ 2015-05-05  9:00       ` Olivier MATZ
  2015-05-05  9:14         ` Simon Kågström
  0 siblings, 1 reply; 7+ messages in thread
From: Olivier MATZ @ 2015-05-05  9:00 UTC (permalink / raw)
  To: dev, simon.kagstrom

Hi Simon,

On 05/05/2015 11:00 AM, Olivier Matz wrote:
> The script relpath.sh return the relative path of the first directory
> from the second directory. It is used to generate relative symlinks,
> which can be useful if the build directory is embedded in the dpdk
> directory: the whole dpdk can be moved without breaking the links,
> which is helpful for an installation.
>
> In case the build directory is a symlink, the script was not generating
> the proper relative path. Fix this by calling "readlink -f" on the
> arguments.
>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Can you have a try with this patch?

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH] scripts: fix relpath.sh output when build dir is a symlink
  2015-05-05  9:00       ` Olivier MATZ
@ 2015-05-05  9:14         ` Simon Kågström
  2015-05-12 12:26           ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Kågström @ 2015-05-05  9:14 UTC (permalink / raw)
  To: Olivier MATZ, dev

On 2015-05-05 11:00, Olivier MATZ wrote:
> On 05/05/2015 11:00 AM, Olivier Matz wrote:
>> The script relpath.sh return the relative path of the first directory
>> from the second directory. It is used to generate relative symlinks,
>> which can be useful if the build directory is embedded in the dpdk
>> directory: the whole dpdk can be moved without breaking the links,
>> which is helpful for an installation.
>>
>> In case the build directory is a symlink, the script was not generating
>> the proper relative path. Fix this by calling "readlink -f" on the
>> arguments.
> 
> Can you have a try with this patch?

Yes, this fixes my build issue, thanks!

Verified-by: Simon Kagstrom <simon.kagstrom@netinsight.net>

// Simon

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

* Re: [dpdk-dev] [PATCH] scripts: fix relpath.sh output when build dir is a symlink
  2015-05-05  9:14         ` Simon Kågström
@ 2015-05-12 12:26           ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2015-05-12 12:26 UTC (permalink / raw)
  To: Olivier MATZ; +Cc: dev

2015-05-05 11:14, Simon Kågström:
> On 2015-05-05 11:00, Olivier MATZ wrote:
> > On 05/05/2015 11:00 AM, Olivier Matz wrote:
> >> The script relpath.sh return the relative path of the first directory
> >> from the second directory. It is used to generate relative symlinks,
> >> which can be useful if the build directory is embedded in the dpdk
> >> directory: the whole dpdk can be moved without breaking the links,
> >> which is helpful for an installation.
> >>
> >> In case the build directory is a symlink, the script was not generating
> >> the proper relative path. Fix this by calling "readlink -f" on the
> >> arguments.
> > 
> > Can you have a try with this patch?
> 
> Yes, this fixes my build issue, thanks!
> 
> Verified-by: Simon Kagstrom <simon.kagstrom@netinsight.net>

Applied, thanks

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

end of thread, other threads:[~2015-05-12 12:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04 12:42 [dpdk-dev] build issue with out-of-tree builds and multiple mounts Simon Kågström
2015-05-04 12:48 ` Olivier MATZ
2015-05-04 12:55   ` Simon Kågström
2015-05-05  9:00     ` [dpdk-dev] [PATCH] scripts: fix relpath.sh output when build dir is a symlink Olivier Matz
2015-05-05  9:00       ` Olivier MATZ
2015-05-05  9:14         ` Simon Kågström
2015-05-12 12:26           ` Thomas Monjalon

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