cisco-system-traffic-generator / trex-core

trex-core site
https://trex-tgn.cisco.com/
Other
1.26k stars 457 forks source link

Link error when compiling with libarchive on Debian 11 #1108

Open firthmj opened 4 months ago

firthmj commented 4 months ago

I installed libarchive, because the configure process warned that it was not found.

However, when trying to build, the build then failed with a group of "undefined reference" errors for things from the libarchive library (e.g. "archive_read_new") in the "eal_firmware.c" file.

I suspect the fix is to add the equivalent of "-larchive" somewhere, but it isn't possible for me to work out how to do that in the "waf" system.

I removed libarchive again and the build completed successfully (but obviously without that part enabled)

This is on the latest patch version of Debian 11.

hhaim commented 4 months ago

it seems it is already supported the WAF code check if it is installed and add it, maybe you installed it after ./b configure ?

    conf.env.DPDK_WITH_ARCHIVE = False
    if conf.check_cxx(lib = 'archive', errmsg = 'Could not find libarchive', mandatory = False):
        conf.env.DPDK_WITH_ARCHIVE = True
tjjh89017 commented 3 weeks ago

Faced the same issue in Debian 12 I install libarchive-dev before ./b configure. remove and reinstall libarchive-dev didn't help at all. Thank you

Setting top to                           : /home/date/trex-core-3.05
Setting out to                           : /home/date/trex-core-3.05/linux_dpdk/build_dpdk
Checking for program 'strings'           : /usr/bin/strings
you have newer 3430 libstdc++.so remove the old one, do not commit this

mv: cannot stat '../scripts/so/x86_64/libstdc++.so.6': No such file or directory
Checking for program 'g++, c++'          : /usr/bin/g++
Checking for program 'ar'                : /usr/bin/ar
Checking for program 'gcc, cc'           : /usr/bin/gcc
Checking for program 'ar'                : /usr/bin/ar
Checking for program 'ldd'               : /usr/bin/ldd
Checking for library z                   : yes
Build sanitized images (GCC >= 4.9.0)    : no
Checking for OFED                        : not found
Checking for library mnl                 : not found, will use internal version
Configuring dummy MLX5 autoconf          : done
Warning: will use internal version of ibverbs. If you need to use Mellanox NICs, install OFED:
https://trex-tgn.cisco.com/trex/doc/trex_manual.html#_mellanox_connectx_4_support
Building mlx5 PMD
Building bnxt PMD
Checking for library archive             : yes
'configure' finished successfully (0.260s)
/usr/bin/ld: src/dpdk/lib/eal/unix/eal_firmware.c.4.o: in function `firmware_open':
/home/date/trex-core-3.05/linux_dpdk/build_dpdk/../../src/dpdk/lib/eal/unix/eal_firmware.c:31: undefined reference to `archive_read_new'
/usr/bin/ld: /home/date/trex-core-3.05/linux_dpdk/build_dpdk/../../src/dpdk/lib/eal/unix/eal_firmware.c:35: undefined reference to `archive_read_support_format_raw'
/usr/bin/ld: /home/date/trex-core-3.05/linux_dpdk/build_dpdk/../../src/dpdk/lib/eal/unix/eal_firmware.c:38: undefined reference to `archive_read_support_filter_xz'
/usr/bin/ld: /home/date/trex-core-3.05/linux_dpdk/build_dpdk/../../src/dpdk/lib/eal/unix/eal_firmware.c:42: undefined reference to `archive_read_open_filename'
/usr/bin/ld: /home/date/trex-core-3.05/linux_dpdk/build_dpdk/../../src/dpdk/lib/eal/unix/eal_firmware.c:45: undefined reference to `archive_read_next_header'
/usr/bin/ld: /home/date/trex-core-3.05/linux_dpdk/build_dpdk/../../src/dpdk/lib/eal/unix/eal_firmware.c:51: undefined reference to `archive_read_free'
/usr/bin/ld: src/dpdk/lib/eal/unix/eal_firmware.c.4.o: in function `firmware_read_block':
/home/date/trex-core-3.05/linux_dpdk/build_dpdk/../../src/dpdk/lib/eal/unix/eal_firmware.c:59: undefined reference to `archive_read_data'
/usr/bin/ld: src/dpdk/lib/eal/unix/eal_firmware.c.4.o: in function `firmware_close':
/home/date/trex-core-3.05/linux_dpdk/build_dpdk/../../src/dpdk/lib/eal/unix/eal_firmware.c:65: undefined reference to `archive_read_free'
collect2: error: ld returned 1 exit status