Problem with "Buildings" module in DCE

163 views
Skip to first unread message

niter...@gmail.com

unread,
Dec 12, 2016, 12:10:25 AM12/12/16
to ns-3-users
I'm trying to run a simulation with DCE using the ShadowingLoss propagation model and because of that, I tried to configure the Buildings module but the linker keeps returning the following error:


$ ./waf --run myexample
Waf: Entering directory `/home/username/workspace/dce/source/ns-3-dce/build'

--------------------------------------------------------------------
 Python bindings compilation
--------------------------------------------------------------------
[ 14/387] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/387] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
[170/387] cxx: myscripts/myexample/myexample.cc -> build/myscripts/myexample/myexample.cc.1.o
[364/387] cxxprogram: build/myscripts/myexample/myexample.cc.1.o -> build/myscripts/myexample/bin/myexample
myscripts/myexample/myexample.cc.1.o: In function `main':
/home/username/workspace/dce/source/ns-3-dce/build/../myscripts/myexample/myexample.cc:95: undefined reference to `ns3::Building::SetBoundaries(ns3::Box)'
/home/username/workspace/dce/source/ns-3-dce/build/../myscripts/myexample/myexample.cc:96: undefined reference to `ns3::Building::SetBuildingType(ns3::Building::BuildingType_t)'
/home/username/workspace/dce/source/ns-3-dce/build/../myscripts/myexample/myexample.cc:97: undefined reference to `ns3::Building::SetExtWallsType(ns3::Building::ExtWallsType_t)'
/home/username/workspace/dce/source/ns-3-dce/build/../myscripts/myexample/myexample.cc:119: undefined reference to `ns3::BuildingsHelper::Install(ns3::NodeContainer)'
/home/username/workspace/dce/source/ns-3-dce/build/../myscripts/myexample/myexample.cc:120: undefined reference to `ns3::BuildingsHelper::MakeMobilityModelConsistent()'
myscripts/myexample/myexample.cc.1.o: In function `ns3::Ptr<ns3::Building> ns3::CreateObject<ns3::Building>()':
/home/username/workspace/dce/build/include/ns3.25/ns3/object.h:526: undefined reference to `ns3::Building::Building()'
myscripts/myexample/myexample.cc.1.o: In function `ns3::Ptr<ns3::Building> ns3::CompleteConstruct<ns3::Building>(ns3::Building*)':
/home/username/workspace/dce/build/include/ns3.25/ns3/object.h:508: undefined reference to `ns3::Building::GetTypeId()'
collect2: error: ld returned 1 exit status
Waf: Leaving directory `/home/username/workspace/dce/source/ns-3-dce/build'
Build failed
 -> task in 'bin/myexample' failed (exit status 1):
        {task 140306246721296: cxxprogram myexample.cc.1.o -> myexample}
['/usr/bin/g++', '-Wl,--no-as-needed', '-pthread', '-pthread', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', 'myscripts/myexample/myexample.cc.1.o', '-o', '/home/username/workspace/dce/source/ns-3-dce/build/myscripts/myexample/bin/myexample', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Llib', '-Llib', '-L/home/username/workspace/dce/build/lib', '-L/home/username/workspace/dce/build/lib', '-L/home/username/workspace/dce/build/lib', '-L/home/username/workspace/dce/build/lib', '-L/home/username/workspace/dce/build/lib', '-lns3-dce', '-lns3-netlink', '-lns3.25-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm', '-lns3.25-internet-debug', '-lns3.25-bridge-debug', '-lns3.25-mpi-debug', '-lns3.25-traffic-control-debug', '-lns3.25-network-debug', '-lns3.25-stats-debug', '-lsqlite3', '-lns3.25-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm', '-lns3.25-wifi-debug', '-lns3.25-propagation-debug', '-lns3.25-energy-debug', '-lns3.25-mobility-debug', '-lns3.25-network-debug', '-lns3.25-stats-debug', '-lsqlite3', '-lns3.25-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm', '-lns3.25-applications-debug', '-lns3.25-internet-debug', '-lns3.25-config-store-debug', '-lgtk-x11-2.0', '-lgdk-x11-2.0', '-latk-1.0', '-lgio-2.0', '-lpangoft2-1.0', '-lpangocairo-1.0', '-lgdk_pixbuf-2.0', '-lcairo', '-lpango-1.0', '-lfontconfig', '-lgobject-2.0', '-lglib-2.0', '-lfreetype', '-lxml2', '-lns3.25-bridge-debug', '-lns3.25-mpi-debug', '-lns3.25-traffic-control-debug', '-lns3.25-network-debug', '-lns3.25-stats-debug', '-lsqlite3', '-lns3.25-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm', '-lns3.25-network-debug', '-lns3.25-stats-debug', '-lsqlite3', '-lns3.25-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm']


The relevant parts of my script are:

#include <ns3/buildings-module.h>
#include <ns3/building.h>
#include <ns3/buildings-helper.h>
#include <ns3/buildings-propagation-loss-model.h>
#include <ns3/constant-position-mobility-model.h>

...

double x_min = 0.0;
double x_max = 46.0;
double y_min = 0.0;
double y_max = 28.0;
double z_min = 0.0;
double z_max = 10.0;
Ptr<Building> b = CreateObject <Building> ();
b->SetBoundaries (Box (x_min, x_max, y_min, y_max, z_min, z_max));
b->SetBuildingType (Building::Residential);
b->SetExtWallsType (Building::ConcreteWithWindows);

MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (46.0, 0.0, 0.0));
positionAlloc->Add (Vector (3.0, 14.0, 0.0));
positionAlloc->Add (Vector (13.0, 14.0, 0.0));
positionAlloc->Add (Vector (23.0, 14.0, 0.0));
positionAlloc->Add (Vector (33.0, 14.0, 0.0));
positionAlloc->Add (Vector (43.0, 14.0, 0.0));
positionAlloc->Add (Vector (3.0, -14.0, 0.0));
positionAlloc->Add (Vector (13.0, -14.0, 0.0));
positionAlloc->Add (Vector (23.0, -14.0, 0.0));
positionAlloc->Add (Vector (33.0, -14.0, 0.0));
positionAlloc->Add (Vector (43.0, -14.0, 0.0));
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (nodes);
BuildingsHelper::Install (nodes);
BuildingsHelper::MakeMobilityModelConsistent ();


These are the modules that were built in my instalation:

Modules built:
antenna                   aodv                      applications             
bridge                    buildings                 config-store             
core                      csma                      csma-layout              
dsdv                      dsr                       energy                   
fd-net-device             flow-monitor              internet                 
internet-apps             lr-wpan                   lte                      
mesh                      mobility                  mpi                      
netanim (no Python)       network                   nix-vector-routing       
olsr                      point-to-point            point-to-point-layout    
propagation               sixlowpan                 spectrum                 
stats                     tap-bridge                test (no Python)         
topology-read             traffic-control           uan                      
virtual-net-device        visualizer                wave                     
wifi                      wimax

The ns-3 tests executed succefully for buildings.

I read the tutorial and model library, searched a lot for this problem, but could not find a solution. The closer I came was this thread from october: [https://groups.google.com/forum/#!topic/ns-3-users/jfHnK2G3fN8].

One other thing I did but still didn't work was add 'buildings' on the wscript. When I did that, I got this error:


$ ./waf --run myexample
Waf: Entering directory `/home/username/workspace/dce/source/ns-3-dce/build'

--------------------------------------------------------------------
 Python bindings compilation
--------------------------------------------------------------------
program 'myexample' not found; available programs are: ['dce-sleep', 'myscripts/sleep/bin/dce-sleep', 'dce-tuto1', 'myscripts/tuto1/bin/dce-tuto1', 'olsrd3', 'myscripts/olsrd_20160909/bin/olsrd3', 'dce-tuto2', 'myscripts/tuto2/bin/dce-tuto2', 'dce-bt1', 'myscripts/btorrent1/bin/dce-bt1', 'olsrd4', 'myscripts/olsrd_20161127/bin/olsrd4', 'dce-mt2', 'myscripts/mt2/bin/dce-mt2', 'diego-thesis-random', 'myscripts/diego-thesis-random/bin/diego-thesis-random', 'dce-olsrd', 'myscripts/olsrd/bin/dce-olsrd', 'dce-twin', 'myscripts/loaders-test/bin/dce-twin', 'vdl-dce-twin', 'myscripts/loaders-test/bin/vdl-dce-twin', 'dce-emu-ping', 'myscripts/dce-emu-ping/bin/dce-emu-ping', 'dce-ping', 'myscripts/ping/bin/dce-ping', 'diego-thesis', 'myscripts/diego-thesis/bin/diego-thesis', 'olsrd2', 'myscripts/olsrd_20160828/bin/olsrd2', 'dce-tuto3', 'myscripts/tuto3/bin/dce-tuto3', 'dce-iperf-multi', 'myscripts/iperf-multi/bin/dce-iperf-multi', 'dce-ccn-exp1', 'myscripts/ccn-exp1/bin/dce-ccn-exp1', 'dce-ccn-mt1', 'myscripts/ccn-mt1/bin/dce-ccn-mt1', 'dce-ccn-vlc', 'myscripts/ccn-tap-vlc/bin/dce-ccn-vlc', 'dce-ping-mt1', 'myscripts/ping-mt1/bin/dce-ping-mt1', 'dce-mt3', 'myscripts/mt3/bin/dce-mt3', 'test', './lib/test', 'dce-tcp-simple', './bin/dce-tcp-simple', 'dce-udp-simple', './bin/dce-udp-simple', 'dce-ccnd-simple', './bin/dce-ccnd-simple', 'dce-ccnd-short-stuff', './bin/dce-ccnd-short-stuff', 'dce-tap-udp-echo', './bin/dce-tap-udp-echo', 'dce-tap-ccnd', './bin/dce-tap-ccnd', 'dce-tap-vlc', './bin/dce-tap-vlc', 'dce-bash-simple', './bin/dce-bash-simple', 'dce-ccn-cache', './bin/dce-ccn-cache', 'dce-iperf', './bin/dce-iperf', 'dce-iperf-emulation', './bin/dce-iperf-emulation', 'linear-udp-perf', './bin/linear-udp-perf', 'dce-udp-perf', './bin/dce-udp-perf', 'dce-linux-simple', './bin/dce-linux-simple', 'dce-linux', './bin/dce-linux', 'dce-dccp', './bin/dce-dccp', 'dce-ccnd-udp-2-nodes', './bin/dce-ccnd-udp-2-nodes', 'dce-ccnd-linear-multiple', './bin/dce-ccnd-linear-multiple', 'dce-xfrm', './bin/dce-xfrm', 'dce-ltp', './bin/dce-ltp', 'dce-iperf-mptcp', './bin/dce-iperf-mptcp', 'dce-iperf-heterogeneous-multihop', './bin/dce-iperf-heterogeneous-multihop', 'dce-cradle-mptcp', './bin/dce-cradle-mptcp', 'dce-mptcp-lte-wifi', './bin/dce-mptcp-lte-wifi', 'dce-cradle-simple', './bin/dce-cradle-simple', 'dce-tcp-ns3-nsc-comparison', './bin/dce-tcp-ns3-nsc-comparison', 'dce-httpd', './bin/dce-httpd', 'dce-wifi-ccnx', './bin/dce-wifi-ccnx', 'dce-freebsd', './bin/dce-freebsd', 'test-runner', './bin/test-runner', 'test-runner-vdl', './bin/test-runner-vdl', 'dce-runner', 'utils/../bin/dce-runner']


I also would apreciate some help on how to use the shadowing propagation loss model, because I didn't find any example showing how to configure that. I'm trying to set it just like the other models, but it's not working:


wifiChannel.AddPropagationLoss ("ns3::BuildingsPropagationLossModel::ShadowingLoss");


Best regards!
Reply all
Reply to author
Forward
0 new messages