Results 1 to 4 of 4

Thread: How to compile a ns-3 simulation code which uses GMP library

  1. #1
    Join Date
    Jun 2013
    Beans
    2

    How to compile a ns-3 simulation code which uses GMP library

    Hi,

    This is regarding a compilation issue in ns-3 which I have encountered. I am doing a research project in which it is required to implement PKI in AODV. GMP library is used in ns-3 to extend the
    packet sizes of AODV routing protocol packets in the process to include big integers in the packet formats. But I am clueless about
    the compilation of the code using ./waf.
    I want to ask that like a C++ code can be compiled using g++ using the command:
    g++ filename.cc -lgmpxx -lgmp

    How can I compile the ns-3 simulation code using ./waf ? Are there any
    options available ?

    Are there any other library available which can be used to implement big integers in ns-3 simulation code and can be compiled easily. Please update me.



    Thanks.

  2. #2
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 15.10 Wily Werewolf

    Re: How to compile a ns-3 simulation code which uses GMP library

    Moved to Packaging & Compiling Programs.

  3. #3
    Join Date
    Jun 2013
    Beans
    2

    Smile Re: How to compile a ns-3 simulation code which uses GMP library

    Thanks Ann

  4. #4
    Join Date
    Oct 2011
    Beans
    4

    Re: How to compile a ns-3 simulation code which uses GMP library

    I've done some work in ns-3 that required linking the Boost libraries, so perhaps the same approach will work for you. Inside the wscript for my module, I've got:
    Code:
    defbuild(bld):
        module = bld.create_ns3_module('geocron', ['core', 'network', 'internet', 'applications', 'mobility', 'nix-vector-routing', 'topology-read', 'point-to-point', 'brite',
                                                   #these only needed for Test Suite
                                                   'point-to-point-layout'
                                                   ])
        module.lib = ['boost_system', 'boost_filesystem'] #needed for scratch to use boost libs
    
    
        module.source, headers_list = get_all_sources(bld.path.relpath())
    
    
        module_test = bld.create_ns3_module_test_library('geocron')
        module_test.source = [
            'test/geocron-test-suite.cc',
            ]
        
        headers = bld.new_task_gen(features=['ns3header'])
        headers.module = 'geocron'
        headers.source = headers_list
    
    
        if bld.env.ENABLE_EXAMPLES:
            bld.add_subdirs('examples')
    
    
    # bld.ns3_python_bindings()
    Notice specifically the line:
    Code:
    module.lib=['boost_system','boost_filesystem']
    This tells waf to link these two boost libraries, so just replace them with the name of the libraries you need to link. Hope this helps!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •