[ndnSIM] How python scripts in .waf-tools dir are invoked?

Anil Jangam anilj.mailing at gmail.com
Fri Oct 2 19:45:58 PDT 2015


Hi Spyros.

I have integrated the NSLR codebase under ndnSIM (just like it is done for
NFD) and have modified the ndnSIM/wscript file towards this goal. So far, I
have been able to compile all the NLSR files except the following issues:

   - NLSR includes a compilation of a .proto file. The corresponding tool -
   src/ndnSIM/NLSR/.waf-tools/protoc.py - I believe is being loaded. When I
   start the build after configure, it throws the following error and stops.
      -
      - [ 484/2982] Processing src/ndnSIM/NLSR/nsync/sync-state.proto

19:24:00 runner ['/usr/bin/protoc',
'--cpp_out=/home/anilj1/sandbox/ndnSIM/ns-3/build/src/ndnSIM/NLSR/nsync',
'-Isrc/ndnSIM/NLSR/nsync', '-I../src/ndnSIM/NLSR/nsync', '-I/usr/include',
'/home/anilj1/sandbox/ndnSIM/ns-3/src/ndnSIM/NLSR/nsync/sync-state.proto']

/home/anilj1/sandbox/ndnSIM/ns-3/src/ndnSIM/NLSR/nsync/sync-state.proto:
File does not reside within any path specified using --proto_path (or -I).
You must specify a --proto_path which encompasses this file.  Note that the
proto_path must be an exact prefix of the .proto file names -- protoc is
too dumb to figure out when two paths (e.g. absolute and relative) are
equivalent (it's harder than you think).


   - The changes I have made to the ndnSIM/wscript file are attached
      herewith. Can you suggest any clue to fix this? As a workaround, I have
      another NLSR buid, from where I copy the protoc generated files, and use
      them. But that's just a workaround.
   - After workaround, the build again fails end in the end during linking
   phase with the following erros, again related to the protobuf library. Not
   sure how to configure this library during the configure time.

3030 [2896/2968] Linking
build/src/ndnSIM/examples/ns3-dev-ndn-congestion-topo-plugin-debug

3031 [2896/2968] Linking build/bindings/python/ns/internet.so

3032 [2897/2968] Linking build/src/ndnSIM/examples/ns3-dev-ndn-csma-debug

3033 ./libns3-dev-ndnSIM-debug.so: undefined reference to
`google::protobuf::Message::CheckTypeAndMergeFrom(google::proto
buf::MessageLite const&)'

3034 ./libns3-dev-ndnSIM-debug.so: undefined reference to `vtable for
google::protobuf::Message'

3035 ./libns3-dev-ndnSIM-debug.so: undefined reference to
`google::protobuf::internal::LogMessage::LogMessage(google::pro
tobuf::LogLevel, char const*, int)'

3036 ./libns3-dev-ndnSIM-debug.so: undefined reference to
`google::protobuf::io::CodedInputStream::ReadVarint64Fallback(u     nsigned
long*)'

3037 ./libns3-dev-ndnSIM-debug.so: undefined reference to
`google::protobuf::internal::WireFormatLite::WriteUInt64(int, u     nsigned
long, google::protobuf::io::CodedOutputStream*)'


Can you suggest any solutions to this?

/anil.



On Fri, Oct 2, 2015 at 9:15 AM, Spyridon (Spyros) Mastorakis <
mastorakis at cs.ucla.edu> wrote:

> Hi Anil,
>
> the “.waf-tools” folder of ndnSIM and ndn-cxx are being loaded here:
>
> https://github.com/named-data-ndnSIM/ndnSIM/blob/master/wscript#L15-L18
>
> In the wscript of ndnSIM, functions that are included in the scripts of
> the “.waf-tools” folder are called.
>
> --
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> PhD Computer Science
> UCLA
>
>
>
>
>
> > On Oct 1, 2015, at 11:23 PM, Anil Jangam <anilj.mailing at gmail.com>
> wrote:
> >
> > Hi,
> >
> > I see that each major folder in ndnSIM 2.1 distribution e.g. ndn-cxx,
> NFD and even under ndnSIM, there is a hidden folder .waf-tools and bunch of
> python scripts in there.
> >
> > I am trying to understand how these scripts are invoked by the waf
> builder. I am particularly interested to understand how they are invoked
> (if at all they are invoked) from NFD and ndn-cxx folder.
> >
> > It will be helpful if you could point me to the specific section of the
> wscript file where these are invoked. I am tying to replicate the same with
> another module integration, which also has its own .waf-tools folder.
> >
> > I thank in advance.
> >
> > /anil.
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20151002/08ec61c1/attachment.html>
-------------- next part --------------
diff --git a/wscript b/wscript
index 71f2c9a..2577204 100644
--- a/wscript
+++ b/wscript
@@ -15,10 +15,18 @@ def required_boost_libs(conf):
 def options(opt):
     opt.load(['version'], tooldir=['%s/.waf-tools' % opt.path.abspath()])
     opt.load(['doxygen', 'sphinx_build', 'type_traits', 'compiler-features', 'cryptopp', 'sqlite3'],
-             tooldir=['%s/ndn-cxx/.waf-tools' % opt.path.abspath()])
+            tooldir=['%s/ndn-cxx/.waf-tools' % opt.path.abspath()])
+    opt.load(['default-compiler-flags', 'coverage', 'boost', 'protoc', 'openssl', 'doxygen', 'sphinx_build'],
+            tooldir=['%s/NLSR/.waf-tools' % opt.path.abspath()])
 
 def configure(conf):
-    conf.load(['doxygen', 'sphinx_build', 'type_traits', 'compiler-features', 'version', 'cryptopp', 'sqlite3'])
+    conf.load(['doxygen', 'sphinx_build', 'type_traits', 'compiler-features', 'version', 'cryptopp', 'sqlite3', 'protoc'])
+
+    conf.load(['compiler_cxx', 'gnu_dirs','boost', 'openssl','default-compiler-flags','doxygen', 'sphinx_build'])
+
+    conf.load('protoc')
+
+    conf.load('coverage')
 
     conf.env['ENABLE_NDNSIM']=False
 
@@ -76,6 +84,7 @@ def configure(conf):
 
     conf.write_config_header('../../ns3/ndnSIM/ndn-cxx/ndn-cxx-config.hpp', define_prefix='NDN_CXX_', remove=False)
     conf.write_config_header('../../ns3/ndnSIM/NFD/config.hpp', remove=False)
+    conf.write_config_header('../../ns3/ndnSIM/NLSR/config.hpp', remove=False)
 
 def build(bld):
     (base, build, split) = bld.getVersion('NFD')
@@ -88,6 +97,25 @@ def build(bld):
         VERSION=int(split[0]) * 1000000 + int(split[1]) * 1000 + int(split[2]),
         VERSION_MAJOR=split[0], VERSION_MINOR=split[1], VERSION_PATCH=split[2])
 
+    nsync_objects = bld(
+        target='nsync-objects',
+        name='nsync-objects',
+        features='cxx',
+        source=bld.path.ant_glob(['NLSR/**/*.cc', 'NLSR/**/*.proto']),
+        use='BOOST NDN_CXX OPENSSL',
+        includes='NLSR/nsync',
+        export_includes='NLSR/nsync')
+
+    (base, build, split) = bld.getVersion('NLSR')
+    bld(features="subst",
+        name="version-NLSR",
+        source='NLSR/src/version.hpp.in', target='../../ns3/ndnSIM/NLSR/version.hpp',
+        install_path=None,
+        VERSION_STRING=base,
+        VERSION_BUILD="%s-ndnSIM" % build,
+        VERSION=int(split[0]) * 1000000 + int(split[1]) * 1000 + int(split[2]),
+        VERSION_MAJOR=split[0], VERSION_MINOR=split[1], VERSION_PATCH=split[2])
+
     (base, build, split) = bld.getVersion('ndn-cxx')
     bld(features="subst",
         name="version-ndn-cxx",
@@ -121,12 +149,19 @@ def build(bld):
                                      'NFD/daemon/face/websocket*',
                                      'NFD/rib/nrd.cpp'])
 
+    nsyncSrc = bld.path.ant_glob(['%s/**/*.cc' % dir for dir in ['NLSR']])
+
+    nlsrSrc = bld.path.ant_glob(['%s/**/*.cpp' % dir for dir in ['NLSR/src']],
+                               excl=['NLSR/src/main.cpp',
+                                     'NLSR/src/nlsr-runner.cpp',
+                                     'NLSR/src/conf-file-processor.cpp'])
+
     module = bld.create_ns3_module('ndnSIM', deps)
     module.module = 'ndnSIM'
     module.features += ' ns3fullmoduleheaders ndncxxheaders'
-    module.use += ['version-ndn-cxx', 'version-NFD', 'BOOST', 'CRYPTOPP', 'SQLITE3', 'RT', 'PTHREAD']
-    module.includes = ['../..', '../../ns3/ndnSIM/NFD', './NFD/core', './NFD/daemon', './NFD/rib', '../../ns3/ndnSIM', '../../ns3/ndnSIM/ndn-cxx']
-    module.export_includes = ['../../ns3/ndnSIM/NFD', './NFD/core', './NFD/daemon', './NFD/rib', '../../ns3/ndnSIM']
+    module.use += ['version-ndn-cxx', 'version-NFD', 'version-NLSR', 'BOOST', 'CRYPTOPP', 'SQLITE3', 'RT', 'PTHREAD']
+    module.includes = ['../..', '../../ns3/ndnSIM/NFD', './NFD/core', './NFD/daemon', './NFD/rib', '../../ns3/ndnSIM', '../../ns3/ndnSIM/ndn-cxx', '../../ns3/ndnSIM/NLSR', './NLSR/src', './NLSR/nsync', './NLSR']
+    module.export_includes = ['../../ns3/ndnSIM/NFD', './NFD/core', './NFD/daemon', './NFD/rib', '../../ns3/ndnSIM', '../../ns3/ndnSIM/NLSR', './NLSR/src', './NLSR/nsync', './NLSR']
 
     headers = bld(features='ns3header')
     headers.module = 'ndnSIM'
@@ -138,11 +173,12 @@ def build(bld):
 
     module_dirs = ['apps', 'helper', 'model', 'utils']
     module.source = bld.path.ant_glob(['%s/**/*.cpp' % dir for dir in module_dirs],
-                                      excl=['model/ip-faces/*']) + ndnCxxSrc + nfdSrc
+                                      excl=['model/ip-faces/*']) + ndnCxxSrc + nfdSrc + nsyncSrc + nlsrSrc
 
-    module_dirs = ['NFD/core', 'NFD/daemon', 'NFD/rib', 'apps', 'helper', 'model', 'utils']
+    module_dirs = ['NFD/core', 'NFD/daemon', 'NFD/rib', 'apps', 'helper', 'model', 'utils', 'NLSR/src', 'NLSR/nsync', ]
     module.full_headers = bld.path.ant_glob(['%s/**/*.hpp' % dir for dir in module_dirs])
     module.full_headers += bld.path.ant_glob('NFD/common.hpp')
+    module.full_headers += bld.path.ant_glob(['%s/**/*.h' % dir for dir in ['NLSR']])
 
     module.ndncxx_headers = bld.path.ant_glob(['ndn-cxx/src/**/*.hpp'],
                                               excl=['src/**/*-osx.hpp', 'src/detail/**/*'])


More information about the ndnSIM mailing list