DCE error when trying to use "native" ns-3 modules

367 views
Skip to first unread message

Sergio Maeso

unread,
Oct 19, 2016, 9:16:33 AM10/19/16
to ns-3-users
Hi,

My name is Sergio and I'm currently testing an application for IoT service discovery. I installed DCE by using bake:

   hg clone http://code.nsnam.org/bake bake
   export BAKE_HOME=`pwd`/bake
   export PATH=$PATH:$BAKE_HOME
   export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
   bake.py configure -e dce-ns3-1.9
   bake.py download
   bake.py build

It worked like a charm till I tried to use olsr module.

I added the #include "ns3/olsr-helper.h" line on my .cc script and modified my wscript script located together with the .cc code:

def build(bld):
    bld.build_a_script(dce', needed = ['core', 'internet', 'dce', 'point-to-point', 'netanim' , 'olsr'],
                  target='coap_olsr',
                  source=['coap_olsr.cc'],
                  )


The compiler basically says it cannot find such that elements:
 

/ns3/source/ns-3-dce/build/../myscripts/coap_olsr/coap_olsr.cc:239: undefined reference to `ns3::OlsrHelper::OlsrHelper()'
myscripts/coap_olsr/coap_olsr.cc.1.o: On function `ns3::OlsrHelper::~OlsrHelper()':
/ns3/build/include/ns3.26/ns3/olsr-helper.h:40: undefined reference to `vtable for ns3::OlsrHelper'
collect2: error: ld returned 1 exit status

 

I tried to run ./waf configure but it turns out that it does not work on DCE:
 

File "/ns3/source/ns-3-dce/ns3waf/__init__.py", line 164, in _check_dependencies
pcfiles = glob.glob(conf.env['NS3_DIR'] + '/lib*/pkgconfig/' + 'libns%s*-%s-%s*' % (ver, module.lower(), conf.env['LIB_SUFFIX']))
TypeError: can only concatenate list (not "str") to list


I try to solve this thing by doing the following things:
  1. I tried to find the solution on this mail list, the only similar thing was this thread.
  2. Then I though maybe I was missing some variable so I tried by writting : "export PKG_CONFIG_PATH=/media/semaesoj/Datos/ns3/build/lib/pkgconfig/" but this doesn't work
  3. Finally I started to "fix" the __init__.py script in order to help it to find the correct libraries but I think that's the wrong path too.


What am I missing? Is there some environement variable I'm missing or maybe what I'm trying to achieve is not possible?

Can I use modules like olsr or aodv or even my own (routing) modules compiled on ns-3 (and in the ns-3 models folder) with DCE? How?



Thanks in advance and sorry for my lack of knowledge.


Sergio Maeso.
Research Assistant
GAST Group
University Carlos III, Madrid
http://www.gast.it.uc3m.es/~semaesoj/indice.html

Matt Anonyme

unread,
Oct 19, 2016, 6:10:37 PM10/19/16
to ns-3-users
Be sure to run ./waf configure --with-ns3=path/where/you/installed/ns3

you install ns3 with ./waf install

Sergio Maeso

unread,
Oct 20, 2016, 9:19:36 AM10/20/16
to ns-3-users
Thanks for the hint! it is still not working unfortunately. That's what I did.

  • Download bake and  build everything
   hg clone http://code.nsnam.org/bake bake
   export BAKE_HOME=`pwd`/bake
   export PATH=$PATH:$BAKE_HOME
   export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
   bake.py configure -e dce-ns3-1.9
   bake.py download
   bake.py build
  • go inside "source/ns-3.26/" and execute:

./waf configure --prefix=/media/semaesoj/Datos/workspace/build --includedir=/media/semaesoj/Datos/workspace/include

./waf build

./waf install

  • Now go to "source/ns-3-dce and execute:

 ./waf configure --with-ns3=/media/semaesoj/Datos/workspace/build --prefix=/media/semaesoj/Datos/workspace/build


But this command fails:



Checking for 'gcc' (c compiler)                 : /usr/bin/gcc
Checking for ns3-flow-monitor (ns3.26)          : yes
Checking for ns3-dce (None)                     : not found
The configuration failed
(complete log in /media/semaesoj/Datos/ns3/source/ns-3-dce/build/config.log)

and inside that log there is:

Checking for ns3-dce (None)
['/usr/bin/pkg-config', 'None', '--cflags', '--libs']
err: Package None was not found in the pkg-config search path.
Perhaps you should add the directory containing `None.pc'
to the PKG_CONFIG_PATH environment variable

No package 'None' found

not found


Matt

unread,
Oct 20, 2016, 9:28:38 AM10/20/16
to ns-3-users
Sorry I don't have much time to help with this.
Can you debug it with print() in the wscript to see where that "None"
comes from.

Do you have a global ns3 install ? in /usr/lib. I've had some weird
problems in such case.
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ns-3-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ns-3-users/jfHnK2G3fN8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

Sergio Maeso

unread,
Oct 20, 2016, 10:05:16 AM10/20/16
to ns-3-users
i've downloaded and installed ns3 on another empty drive (named "Datos").

The "None" cames from script source/ns-3-dec/ns3waf/__init__.py on the _check_dependencies method, line 166. I think that it is no able to locate the dce-package on the place I'm giving it.

        for ver in ns3_versions:
            match_pkg = 'None'

            pcfiles = glob.glob(conf.env['NS3_DIR'] + '/lib*/pkgconfig/' + 'libns%s*-%s-%s*'
                                % (ver, module.lower(), conf.env['LIB_SUFFIX']))
            if not len(pcfiles) is 0:
                match_pkg = os.path.basename(pcfiles[0])
                if match_pkg:
                    match_pkg = os.path.splitext(match_pkg)[0]
                break

        lib = re.search("(ns[0-9][\.\-][dev0-9\.]+)", match_pkg)
        lib = lib.group(0) if lib else 'None'
        retval = conf.check_cfg(package = match_pkg or 'None',
                                args='--cflags --libs', mandatory=mandatory,
                                msg="Checking for ns3-%s (%s)" % (module.lower(), lib),
                                uselib_store='NS3_%s' % module.upper())
        if not retval is None:
            # XXX pkg-config doesn't give the proper order of whole-archive option..
            if conf.env['NS3_ENABLE_STATIC']:
                libname = 'STLIB_ST_NS3_%s' % module.upper()
                conf.env[libname] = '-l%s' % (match_pkg.replace('libns3', 'ns3'))
                for lib in conf.env['LIB_NS3_%s' % module.upper()]:
                    if 'ns3' in lib:
                        conf.env.append_value(libname, '-l%s' % lib)

match_pkg is None

Can I install dce without configuring it?
Reply all
Reply to author
Forward
0 new messages