【问题标题】:How to implement GPSR algorithm in ns3 ?如何在 ns3 中实现 GPSR 算法?
【发布时间】:2017-12-27 18:38:43
【问题描述】:

我想使用 ns3 实现 gpsr。为此,我关注this github project. 在这个项目中,我正在阅读自述文件。我发现我必须执行这个命令:“./waf configure;./waf”。

所以我在终端输入我的文件夹路径。当我输入./waf configure 时,它显示配置成功。然后我输入./waf 它显示这种类型的错误。

../src/core/model/unix-system-wall-clock-ms.cc: In member function ‘int64_t ns3::SystemWallClockMsPrivate::End()’:
../src/core/model/unix-system-wall-clock-ms.cc:78:44: error: ‘_SC_CLK_TCK’ was not declared in this scope
   static int64_t ticksPerSecond = sysconf (_SC_CLK_TCK);
                                            ^
../src/core/model/unix-system-wall-clock-ms.cc:78:55: error: ‘sysconf’ was not declared in this scope
   static int64_t ticksPerSecond = sysconf (_SC_CLK_TCK);

它也告诉我得到这个错误的原因:

Build failed
 -> task failed (exit status 1): 
    {task 139770074846736: cxx unix-system-wall-clock-ms.cc -> unix-system-wall-clock-ms.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-Ibuild', '-I.', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DPYTHONDIR="/usr/local/lib/python2.7/dist-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/dist-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '../src/core/model/unix-system-wall-clock-ms.cc', '-c', '-o', 'src/core/model/unix-system-wall-clock-ms.cc.1.o']

那么你能建议我解决这个错误的方法吗?为什么我会收到此错误?我该怎么做才能在 ns3 中运行 GPSR 算法?我非常需要 GPSR 算法的模拟。谢谢您的合作 。

【问题讨论】:

    标签: routing ns-3


    【解决方案1】:

    您需要将此包含添加到 src/core/model/unix-system-wall-clock-ms.cc

    #include <unistd.h>
    

    某些系统(例如您的系统)需要显式添加此内容,而其他系统可能会使用另一个头文件将其拉入。

    【讨论】:

    • 感谢您的建议,看来可行。但是存在以下错误paste.ubuntu.com/26323905 ^
    • 注意,我建议您考虑使用 ns-3-users Google Group 来解决这种类型的 ns-3 问题。该论坛中还有其他关于将 GPSR 用于 ns-3 的讨论。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-10-12
    • 1970-01-01
    • 2012-11-10
    • 1970-01-01
    • 2016-03-25
    • 2011-03-21
    • 1970-01-01
    相关资源
    最近更新 更多