11187162
11187162

Reputation: 67

How to run OMNeT++ project from Ubuntu terminal

I am using OMNeT++ 5.5.1 installed in Ubuntu 19.04 and it is working fine in IDE environment.

But, I need to run an INET project from Ubuntu terminal. Can anyone suggest me what command to write in terminal if:

Thank you

Upvotes: 0

Views: 1395

Answers (1)

Jerzy D.
Jerzy D.

Reputation: 7002

To run a simulation from command line do the following:

  1. Go to directory of the example you want to start, e.g.:

    cd showcases/wireless/sensornetwork
    
  2. To see available config names in omnetpp.ini type:

    opp_run -a
    
  3. To run selected config (e.g. LMac) with GUI type the following command:

    opp_run -m -u Qtenv -n ../../../src:../..:../../../tutorials:../../../showcases -l ../../../src/INET  omnetpp.ini  -c LMac
    
  4. To see all runs for selected config type:

    opp_run -s -c LMac omnetpp.ini -q runs
    
  5. To start one selected run (e.g. 5) from config (e.g. LMac) without GUI type the following command:

    opp_run -m -u Cmdenv -n ../../../src:../..:../../../tutorials:../../../showcases -l ../../../src/INET  omnetpp.ini  -c LMac -r 5
    
  6. To start all runs in selected config (e.g. LMac) type the following command:

    opp_run -m -u Cmdenv -n ../../../src:../..:../../../tutorials:../../../showcases -l ../../../src/INET  omnetpp.ini  -c LMac
    

The main options for opp_run:

  • -u Qtenv selects graphical view of a simulation (for command environment use -u Cmdenv)
  • -n indicates directories of NED files
  • -l selects library (here: libINET.so)

For more information about running simulations look to OMNeT++ Manual.

Upvotes: 3

Related Questions