Skip to contentSkip to conversation

build issue with out-of-tree builds and multiple mounts

PATCH Applied Simon Kågström 3 participants 7 messages May 4, 2015 – May 12, 2015 5 messages not in the archive

lore
Share & tools
lore
#0 lore raw

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

#2 lore raw
In reply to a message not in the archive

Hi Simon,

Quoted 11 lines · Simon Kågström

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

Quoted 5 lines

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

Quoted 14 lines

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

#4 lore raw
In reply to a message not in the archive
Quoted 14 lines · Olivier MATZ

Hi Simon,

Quoted 11 lines · Simon Kågström

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

Quoted 8 lines
Quoted 5 lines

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

#6 lore raw

PATCH 1/1 scripts: fix relpath.sh output when build dir is a symlink

In reply to a message not in the archive

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.

---
 scripts/relpath.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
scripts/relpath.sh +7 -2
index 00030e5..7d2f48f 100755
@@ -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#*/}
Signature · 1 line
2.1.4
#8 lore raw

Re: [PATCH] scripts: fix relpath.sh output when build dir is a symlink

In reply to a message not in the archive

Hi Simon,

Quoted 11 lines · Olivier Matz

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?

Regards,
Olivier

#10 lore raw

Re: [PATCH] scripts: fix relpath.sh output when build dir is a symlink

In reply to a message not in the archive
Quoted 7 lines · Olivier MATZ
Quoted 6 lines · Olivier Matz

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.

Quoted 5 lines
Quoted 3 lines

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!

// Simon

#11 lore raw

Re: [PATCH] scripts: fix relpath.sh output when build dir is a symlink

2015-05-05 11:14, Simon Kågström:

Quoted 12 lines · Olivier MATZ
Quoted 11 lines · Olivier Matz
Quoted 9 lines

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.

Quoted 5 lines
Quoted 1 line

Can you have a try with this patch?

Yes, this fixes my build issue, thanks!

Applied, thanks