Issue on build of tsntool on LSDK20.04

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue on build of tsntool on LSDK20.04

2,047 Views
hittzt
Contributor V

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

0 Kudos
5 Replies

1,950 Views
yipingwang
NXP TechSupport
NXP TechSupport

I have verified building tsntool in LSDK 20.04 with command  "flex-builder -c tsntool", I didn't find any problem.

Would you please clean rfs and download rfs again to build tsntool?

$ flex-builder clean-rfs

flex-builder -c tsntool

0 Kudos

877 Views
HingWong
Contributor III

Hi yiping:

Now I compile tsntool with flex-builder on ubuntu20.04, and the prompt is "could not resolve host: source.codeaurora.org". How can I solve this situation?

 

hingw@ubuntu:~/ls1028/flexbuild_lsdk2108$ flex-builder -c tsntool
COMPONENT: tsntool
make: Entering directory '/home/hingw/ls1028/flexbuild_lsdk2108'
make[1]: Entering directory '/home/hingw/ls1028/flexbuild_lsdk2108/packages/apps'

 Building tsntool ... 
Cloning into '/home/hingw/ls1028/flexbuild_lsdk2108/components/apps/networking/tsntool'...
fatal: unable to access 'https://source.codeaurora.org/external/qoriq/qoriq-components/tsntool.git/': Could not resolve host: source.codeaurora.org
make[1]: *** [/home/hingw/ls1028/flexbuild_lsdk2108/packages/apps/networking/tsntool.mk:11: tsntool] Error 128
make[1]: Leaving directory '/home/hingw/ls1028/flexbuild_lsdk2108/packages/apps'
make: *** [Makefile:25: tsntool] Error 2
make: Leaving directory '/home/hingw/ls1028/flexbuild_lsdk2108'

 

In addition, I have seen the tsntool software package on github. In the compilation instructions, a kernal path should be specified. What should be filled in this path?

 

2. How to compile the tsntool:

2.1 Setup cross compile environment
2.2 Compile binary:
    > source source_arm64.sh <dir_to_kernel_source>
    > make

    The tsntool and libtsn.so will be generated.

 

 

0 Kudos

1,950 Views
hittzt
Contributor V

Hi Yiping,

Thanks for your reply.

I think I should make it more clear.

My issue is that:

1> when build tsntool using "flex-builder -c tsntool" by default, it is OK.

      But the compile result did not contain event and timestamping binary in tools directory of tsntool.

      Because on LSDK20.04, tsntool added patches to make event and timestamping be built alone.

      while I did not get the way to build event and timestamping with flex-builder.

2> I need event and timestamping binary, so I want to build them by default. When I reverted the patches that       makes event and timestamping be built alone, I got the build errors above.

      

So I submit the issue.

Thanks,

Zhantao

0 Kudos

1,950 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello zhantao,

Please install flexbuild_lsdk2004_update_290520, in tsntool source code packages/apps/networking/tsntool, please revert patch "tools: make alone".

Then run "flex-builder -c tsntool -a arm64" again, you will find event and timestamping in packages/apps/networking/tsntool/tools/.

Thanks,

Yiping

0 Kudos

1,950 Views
hittzt
Contributor V

Hi Yiping,

Thanks for your reply.

I will try your recommend method.

Thanks,

Zhantao

0 Kudos