AnsweredAssumed Answered

Issue on build of tsntool on LSDK20.04

Question asked by Tang zhantao on Jun 22, 2020
Latest reply on Jul 8, 2020 by Tang zhantao

Hi experts,

 

I find the tsntool is updated on LSDK20.04, and my local tsntool is based on LSDK19.09, to align with this updation, I get the related patches to apply to local tsntool.

 

But when I build the tools of tsntool with make tools, the build fails and show the following:

 

ztang@ztang-OptiPlex-5070:~/work/bsp/flexbuild_lsdk2004/packages/apps/networking/tsntool$ make tools
Package libnl-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libnl-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libnl-3.0' found
Package libnl-genl-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libnl-genl-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libnl-genl-3.0' found
Package libcjson was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcjson.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcjson' found
cc -c tools/event.c -o tools/event.o -Wall -Wextra -Wno-error=unused-parameter -Wno-error=sign-compare -Wno-format-security -g -fstack-protector-all -Imain -Iinclude
In file included from tools/event.c:33:0:
include/tsn/genl_tsn.h:9:10: fatal error: netlink/netlink.h: 没有那个文件或目录
#include <netlink/netlink.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:62: recipe for target 'tools/event.o' failed
make: *** [tools/event.o] Error 1

 

This may because of dependencies path not right. So I make the tools be built by default by reverting the patch:

         commit 10a0aeee94dfa71dbb82fcec425de8d3a8f38940  tools: make alone

 

I rebuild the tsntools with command flex-builder -c tsntool, and it failed too with the following errors:

 

flex-builder -c tsntool

 

...

...

 

aarch64-linux-gnu-gcc --sysroot=/home/ztang/work/bsp/flexbuild_lsdk2004/build/rfs/rootfs_lsdk2004_ubuntu_main_arm64 tools/event.o -o tools/event -ltsn -L/home/ztang/work/bsp/flexbuild_lsdk2004/build/rfs/rootfs_lsdk2004_ubuntu_main_arm64/usr/local/lib -L/home/ztang/work/bsp/flexbuild_lsdk2004/build/rfs/rootfs_lsdk2004_ubuntu_main_arm64/usr/lib/aarch64-linux-gnu -lnl-genl-3 -lnl-3 -lcjson -lpthread -lm -lrt -lreadline -ltermcap -L. -Wl,-rpath,/home/ztang/work/bsp/flexbuild_lsdk2004/packages/apps/networking/tsntool
aarch64-linux-gnu-gcc --sysroot=/home/ztang/work/bsp/flexbuild_lsdk2004/build/rfs/rootfs_lsdk2004_ubuntu_main_arm64 -c tools/timestamping.c -o tools/timestamping.o -Wall -Wextra -Wno-error=unused-parameter -Wno-error=sign-compare -Wno-format-security -g -fstack-protector-all -Imain -I/home/ztang/work/bsp/flexbuild_lsdk2004/build/rfs/rootfs_lsdk2004_ubuntu_main_arm64/usr/local/include -I/home/ztang/work/bsp/flexbuild_lsdk2004/build/rfs/rootfs_lsdk2004_ubuntu_main_arm64/usr/include/libnl3 -Iinclude
tools/timestamping.c: In function ‘setsockopt_txtime’:
tools/timestamping.c:404:9: error: variable ‘so_txtime_val’ has initializer but incomplete type
struct sock_txtime so_txtime_val = {
^~~~~~~~~~~
tools/timestamping.c:405:5: error: ‘struct sock_txtime’ has no member named ‘clockid’
.clockid = CLOCK_TAI,
^~~~~~~
tools/timestamping.c:405:16: warning: excess elements in struct initializer
.clockid = CLOCK_TAI,
^~~~~~~~~
tools/timestamping.c:405:16: note: (near initialization for ‘so_txtime_val’)
tools/timestamping.c:407:5: error: ‘struct sock_txtime’ has no member named ‘flags’
.flags = SOF_TXTIME_REPORT_ERRORS
^~~~~
tools/timestamping.c:407:13: error: ‘SOF_TXTIME_REPORT_ERRORS’ undeclared (first use in this function)
.flags = SOF_TXTIME_REPORT_ERRORS
^~~~~~~~~~~~~~~~~~~~~~~~
tools/timestamping.c:407:13: note: each undeclared identifier is reported only once for each function it appears in
tools/timestamping.c:407:13: warning: excess elements in struct initializer
tools/timestamping.c:407:13: note: (near initialization for ‘so_txtime_val’)
tools/timestamping.c:404:21: error: storage size of ‘so_txtime_val’ isn’t known
struct sock_txtime so_txtime_val = {
^~~~~~~~~~~~~
tools/timestamping.c:409:9: error: variable ‘so_txtime_val_read’ has initializer but incomplete type
struct sock_txtime so_txtime_val_read = { 0 };
^~~~~~~~~~~
tools/timestamping.c:409:44: warning: excess elements in struct initializer
struct sock_txtime so_txtime_val_read = { 0 };
^
tools/timestamping.c:409:44: note: (near initialization for ‘so_txtime_val_read’)
tools/timestamping.c:409:21: error: storage size of ‘so_txtime_val_read’ isn’t known
struct sock_txtime so_txtime_val_read = { 0 };
^~~~~~~~~~~~~~~~~~
tools/timestamping.c:413:26: error: ‘SOF_TXTIME_DEADLINE_MODE’ undeclared (first use in this function); did you mean ‘SOF_TXTIME_REPORT_ERRORS’?
so_txtime_val.flags |= SOF_TXTIME_DEADLINE_MODE;
^~~~~~~~~~~~~~~~~~~~~~~~
SOF_TXTIME_REPORT_ERRORS
tools/timestamping.c:409:21: warning: unused variable ‘so_txtime_val_read’ [-Wunused-variable]
struct sock_txtime so_txtime_val_read = { 0 };
^~~~~~~~~~~~~~~~~~
tools/timestamping.c:404:21: warning: unused variable ‘so_txtime_val’ [-Wunused-variable]
struct sock_txtime so_txtime_val = {
^~~~~~~~~~~~~
Makefile:63: recipe for target 'tools/timestamping.o' failed
make[2]: *** [tools/timestamping.o] Error 1
make[2]: 离开目录“/home/ztang/work/bsp/flexbuild_lsdk2004/packages/apps/networking/tsntool”
/home/ztang/work/bsp/flexbuild_lsdk2004/packages/apps/networking/networking.mk:33: recipe for target 'tsntool' failed
make[1]: *** [tsntool] Error 2
make[1]: 离开目录“/home/ztang/work/bsp/flexbuild_lsdk2004/packages/apps”
Makefile:25: recipe for target 'tsntool' failed
make: *** [tsntool] Error 2
make: 离开目录“/home/ztang/work/bsp/flexbuild_lsdk2004”

 

This seems the tools of tsntool can not be built by default. If I want to use these tools like event and timestamping, how can I do? And is there any known issues about tools of tsntool compilling? Or misconfiged in my build steps?

 

Thanks,

Zhantao

Outcomes