简体   繁体   中英

How to implement GPSR algorithm in ns3 ?

I want to implement gpsr using ns3 .For this purpose , I am follwing this github project. In this project , I am reading readme file . I have found that I have to execute this command : "./waf configure;./waf" .

So I enter in my terminal my folder path.When i put ./waf configure , it has showed me configuration is successfull.Then I put ./waf it show this type of error .

../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);

It also shows me the reason to get this error :

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']

So can you suggest me an way to resolve this error ? Why am I getting this error ? What can I do to run GPSR algorithm in ns3 ? I badly need the simulation of GPSR algorithm . Thanks for your co-operation .

You need to add this include to src/core/model/unix-system-wall-clock-ms.cc

#include <unistd.h>

Some systems (such as yours) need this explicitly added while others may pull it in with another header file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM