hkust-spark / ns3-sparkrtc

An ns-3 library to simulate the real-time communication (RTC) application.
9 stars 1 forks source link

Failed module integration #1

Open anthonyKiggundu opened 2 months ago

anthonyKiggundu commented 2 months ago

ns (3.34) build the module into ns3 (3.34) throws the following errors.

./usr/bin/ld: src/sparkrtc/examples/rtc-test.cc.1.o: in function boost::filesystem::exists(boost::filesystem::path const&)': /usr/include/boost/filesystem/operations.hpp:188: undefined reference to boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)' /usr/bin/ld: src/sparkrtc/examples/rtc-test.cc.1.o: in function boost::filesystem::create_directories(boost::filesystem::path const&)': /usr/include/boost/filesystem/operations.hpp:371: undefined reference to boost::filesystem::detail::create_directories(boost::filesystem::path const&, boost::system::error_code*)' collect2: error: ld returned 1 exit status

Waf: Leaving directory /home/username/ns-allinone-3.34/ns-3.34/build' Build failed -> task in 'rtc-test' failed with exit status 1 (run with -v to display more information)

`

mengzili commented 2 months ago

Hi Anthony,

It looks like the issue comes from the libboost not sparkrtc. Can you provide the version of libboost that you installed?

The compilation flags might also help. A post here discusses a similar issue where the workaround is to add the -DBOOST_NO_CXX11_SCOPED_ENUMS flag.

anthonyKiggundu commented 2 months ago

Hello there Mengzili,

I actually had not included find_package(Boost REQUIRED COMPONENTS system filesystem)

include_directories(${Boost_INCLUDE_DIRS}) from the CMakelist file when translating into a wscript file. Followed this and added the following to my wscript REQUIRED_BOOST_LIBS = ['system', 'filesystem']

def required_boost_libs(conf):

conf.env['REQUIRED_BOOST_LIBS'] += REQUIRED_BOOST_LIBS Thanks for the support.

anthonyKiggundu commented 2 months ago

By the way, if I may ask, is it possible to get the FEC block size? If so, any clues on how best to retrieve these values? Thanks again

mengzili commented 2 months ago

That's great to know!

By the way, if I may ask, is it possible to get the FEC block size? If so, any clues on how best to retrieve these values? Thanks again

The batchDataNum field in the fec.log is the block size. Please let us know should further questions arise!

anthonyKiggundu commented 2 months ago

The batchDataNum field in the fec.log is the block size. Please let us know should further questions arise!

Yeah, I saw this but I am just struggling to get it work for an OnOffApp or UDPClientHelper. Any pointers are helpful.

GoinDark commented 2 months ago

孟博士您好: 我在跑rtc-test的时候,输入该命令:./waf --run "rtc-test --vary=1 --fecPolicy=hairpin 出现以下报错:

noah@noah-G7-7588:~/study/project/hairpin/hairpin/ns-allinone-3.33/ns-3.33$ ./waf --run "rtc-test --vary=1 --fecPolicy=hairpin"
Waf: Entering directory `/home/noah/study/project/hairpin/hairpin/ns-allinone-3.33/ns-3.33/build'
[2157/2502] Linking build/src/sparkrtc/examples/ns3.33-rtc-test-debug
[2337/2502] Linking build/examples/wireless/ns3.33-wifi-error-models-comparison-debug
[2340/2502] Linking build/examples/realtime/ns3.33-realtime-udp-echo-debug
[2341/2502] Linking build/examples/socket/ns3.33-socket-bound-static-routing-debug
[2344/2502] Linking build/examples/socket/ns3.33-socket-bound-tcp-static-routing-debug
[2345/2502] Linking build/examples/socket/ns3.33-socket-options-ipv4-debug
[2347/2502] Linking build/examples/socket/ns3.33-socket-options-ipv6-debug
[2349/2502] Linking build/examples/matrix-topology/ns3.33-matrix-topology-debug
[2351/2502] Linking build/examples/tcp/ns3.33-tcp-large-transfer-debug
[2353/2502] Linking build/examples/tcp/ns3.33-tcp-nsc-lfn-debug
[2354/2502] Compiling examples/tcp/tcp-nsc-zoo.cc
[2355/2502] Compiling examples/tcp/tcp-star-server.cc
[2356/2502] Compiling examples/tcp/star.cc
[2357/2502] Compiling examples/tcp/tcp-bulk-send.cc
[2358/2502] Compiling examples/tcp/tcp-pcap-nanosec-example.cc
[2359/2502] Compiling examples/tcp/tcp-nsc-comparison.cc
[2360/2502] Compiling examples/tcp/tcp-variants-comparison.cc
[2361/2502] Compiling examples/tcp/tcp-pacing.cc
[2362/2502] Compiling examples/tcp/dctcp-example.cc
[2363/2502] Compiling examples/tcp/tcp-linux-reno.cc
/usr/bin/ld: src/sparkrtc/examples/rtc-test.cc.1.o: in function `boost::filesystem::exists(boost::filesystem::path const&)':
/usr/include/boost/filesystem/operations.hpp:463: undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
/usr/bin/ld: src/sparkrtc/examples/rtc-test.cc.1.o: in function `boost::filesystem::create_directories(boost::filesystem::path const&)':
/usr/include/boost/filesystem/operations.hpp:583: undefined reference to `boost::filesystem::detail::create_directories(boost::filesystem::path const&, boost::system::error_code*)'
collect2: error: ld returned 1 exit status

Waf: Leaving directory `/home/noah/study/project/hairpin/hairpin/ns-allinone-3.33/ns-3.33/build'
Build failed
 -> task in 'rtc-test' failed with exit status 1 (run with -v to display more information)

我尝试了以下几种解决思路,均失败: 1.本issue的楼主提到的方法:在wscript添加以下代码:

REQUIRED_BOOST_LIBS = ['system', 'filesystem']

def required_boost_libs(conf):

 conf.env['REQUIRED_BOOST_LIBS'] += REQUIRED_BOOST_LIBS

2.该链接提到的使用编译选项-DBOOST_NO_CXX11_SCOPED_ENUMS

因此,我十分苦恼于这个bug怎么解决。为了方便您的分析,我的相关配置信息提供如下:

1.操作系统:Ubuntu 20.04.6 LTS

2.libboost版本:1.71.0.0ubuntu2

3.编译之前配置的信息:

noah@noah-G7-7588:~/study/project/hairpin/hairpin/ns-allinone-3.33/ns-3.33$ LDFLAGS="-lboost_filesystem -lboost_system" ./waf configure --cxx-standard=-std=c++17 --disable-python --enable-examples
Setting top to                           : /home/noah/study/project/hairpin/hairpin/ns-allinone-3.33/ns-3.33 
Setting out to                           : /home/noah/study/project/hairpin/hairpin/ns-allinone-3.33/ns-3.33/build 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking for cc version                  : 9.4.0 
Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
Checking for compilation flag -Wl,--soname=foo support : ok 
Checking for compilation flag -std=c++17 support       : ok 
Checking boost includes                                : 1_71 
Checking boost libs                                    : lib signals not found in /usr/lib/x86_64-linux-gnu 
Checking boost includes                                : 1_71 
Checking boost libs                                    : lib signals not found in /usr/lib/x86_64-linux-gnu 
Checking for click location                            : not found 
Checking for program 'pkg-config'                      : /usr/bin/pkg-config 
Checking for 'gtk+-3.0 >= 3.20'                        : yes 
Checking for 'libxml-2.0 >= 2.7'                       : yes 
checking for uint128_t                                 : not found 
checking for __uint128_t                               : yes 
Checking high precision implementation                 : 128-bit integer (default) 
Checking for header stdint.h                           : yes 
Checking for header inttypes.h                         : yes 
Checking for header sys/inttypes.h                     : not found 
Checking for header sys/types.h                        : yes 
Checking for header sys/stat.h                         : yes 
Checking for header dirent.h                           : yes 
Checking for header signal.h                           : yes 
Checking for header pthread.h                          : yes 
Checking for header stdint.h                           : yes 
Checking for header inttypes.h                         : yes 
Checking for header sys/inttypes.h                     : not found 
Checking for library rt                                : yes 
Checking for header boost/units/systems/si.hpp         : yes 
Checking for header sys/ioctl.h                        : yes 
Checking for header net/if.h                           : yes 
Checking for header net/ethernet.h                     : yes 
Checking for 'libdpdk'                                 : not found 
Checking for header linux/if_tun.h                     : yes 
Checking for header netpacket/packet.h                 : yes 
Checking for header net/netmap_user.h                  : not found 
Checking for NSC location                              : not found 
Checking for 'sqlite3'                                 : yes 
Checking for header semaphore.h                        : yes 
Checking for header linux/if_tun.h                     : yes 
Checking for program 'sudo'                            : /usr/bin/sudo 
Checking for program 'valgrind'                        : not found 
Checking for 'gsl'                                     : yes 
libgcrypt-config                                       : not found 
Checking for compilation flag -fstrict-aliasing support : ok 
Checking for compilation flag -fstrict-aliasing support : ok 
Checking for compilation flag -Wstrict-aliasing support : ok 
Checking for compilation flag -Wstrict-aliasing support : ok 
Checking for program 'doxygen'                          : /usr/bin/doxygen 
---- Summary of optional NS-3 features:
Build profile                 : debug
Build directory               : 
BRITE Integration             : not enabled (BRITE not enabled (see option --with-brite))
DES Metrics event collection  : not enabled (defaults to disabled)
DPDK NetDevice                : not enabled (libdpdk not found, $RTE_SDK and/or $RTE_TARGET environment variable not set or incorrect)
Emulation FdNetDevice         : enabled
Examples                      : enabled
File descriptor NetDevice     : enabled
GNU Scientific Library (GSL)  : enabled
Gcrypt library                : not enabled (libgcrypt not found: you can use libgcrypt-config to find its location.)
GtkConfigStore                : enabled
MPI Support                   : not enabled (option --enable-mpi not selected)
NS-3 Click Integration        : not enabled (nsclick not enabled (see option --with-nsclick))
NS-3 OpenFlow Integration     : not enabled (Required boost libraries not found)
Netmap emulation FdNetDevice  : not enabled (needs net/netmap_user.h)
Network Simulation Cradle     : not enabled (NSC not found (see option --with-nsc))
PlanetLab FdNetDevice         : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
PyViz visualizer              : not enabled (Python Bindings are needed but not enabled)
Python Bindings               : not enabled (disabled by user request)
Real Time Simulator           : enabled
SQLite stats support          : enabled
Tap Bridge                    : enabled
Tap FdNetDevice               : enabled
Tests                         : not enabled (defaults to disabled)
Threading Primitives          : enabled
Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
XmlIo                         : enabled
'configure' finished successfully (1.913s)

期待您的回复,谢谢!

anthonyKiggundu commented 2 months ago

Hello @GoinDark, depending on how you installed your libboost-all-dev, for my case I used apt.

Then you need to find the directory where your boost includes are located, I found out that by doing a locate filesystem.hpp (this file is an include in the rtc-test.cc). This returns something like /usr/include/boost/filesystem.hpp, so /usr/include/boost/ was the directory for my boost includes. Next is to find the location of the boost libraries, usually for ubuntu -> /usr/lib/x86_64-linux-gnu/. Then ./waf configure --boost-libs=/usr/lib/x86_64-linux-gnu/ --boost-includes=/usr/include/boost/ --enable-examples --enable-tests --disable-python and ./waf build. No need for the FLAGS in my case as they were returning more errors.

Hope it helps