HELP: Confused how to run a simulation in the terminal. How to include INET directory and own code?

1,147 views
Skip to first unread message

Michael K.

unread,
Jun 8, 2012, 10:41:18 AM6/8/12
to omn...@googlegroups.com
Hello,

I created my simulation with the IDE and tested it there but now I need to change into the Terminal to see if it performs better and to run it on a couple servers.

I'm confused by the manual chapter 8 - Building simulation program and chapter 10 - NEDPATH. I have no clue about C++ and including libraries and linking stuff. I just used the IDE until now.

After reading chapter 8 I find no starting point how to set up opp_makemake.

But before that, is it possible to use the same codefiles I use with the IDE? Because the IDE creates Makefiles and I have to do that with the Terminal too.

Some words to my directory structure. inet and my source code are in the same directory, as it uses the workspace from the IDE, i.e., my folders look like this

../workspace/inet
../workspace/mysim/simulations
../workspace/mysim/src

I have several folders under ../workspace/mysim/src to organize my code.

As far as I know from the makefiles in the IDE, the opp_makemake commands look like this:

In src folder and simulations folder:

opp_makemake -f --deep -I../../inet/src/networklayer/ipv4 -I../../inet/src/networklayer/common -I../../inet/src/networklayer/rsvp_te -I../../inet/src/networklayer/icmpv6 -I../../inet/src/transport/tcp -I../../inet/src/base -I../../inet/src/util/headerserializers -I../../inet/src/networklayer/contract -I../../inet/src/util -I../../inet/src/transport/contract -I../../inet/src/linklayer/mfcore -I../../inet/src/networklayer/ipv6 -I../../inet/src/transport/sctp -I../../inet/src/world -I../../inet/src/applications/pingapp -I../../inet/src/linklayer/contract -I../../inet/src/networklayer/arp -I../../inet/src/transport/udp -I../../inet/src/applications/tcpapp -L../../inet/out/$(CONFIGNAME)/src -linet -KINET_PROJ=../../inet

in workspace/inet:

opp_makemake -f --deep --make-so -o inet -O out

in mysim:

opp_makemake -f

I started with the one for INET (called from ../workspace/inet) and after calling make, I get several errors which is not the case when I use the IDE.

After playing around with some opp_makemake commands yesterday without using the opp_makemake commands from the IDE I had several missing files. I think this happened because I didn't include anything.

Apart from that I defined the NEDPATH, but the chapter in the documentation isn't very helpful.

It looks like this:
export NEDPATH=/Users/.../workspace/inet/src\;/Users/.../workspace/mysim/src\;/Users/.../workspace/mysim/simulations
(the ... are replaced by the whole path but I don't want to show it here)

Well, to repeat my questions:
1. Do I need a different directory for INET and my source code to run it with the terminal?
2. How do I use opp_makemake? What needs to be included, in which order do I need to make it.
3. Is the NEDPATH set correctly?
4. What else do I have to pay attention to? Is there any further reading or better examples? Couldn't find anything useful in the documentation and in this group, i.e., a full tutorial.

I appreciate every helpful advise :-)

Michael K.

unread,
Jun 9, 2012, 5:49:49 AM6/9/12
to omn...@googlegroups.com
A little follow up. After trying to get the simulation work in the Terminal, I can't get INET to work without throwing erros, like in tests/dlltest/SomeUDPApp.cc, where it says that payload->setLength(msgLength); could not be resolved.

I installed OMNeT 4.2.2 and tried to start a fresh start there, but I get the error you see below and I checked SomeUDPApp.cc and it throws the errors again.

The console output in the IDE:

Starting...

cd /Users/.../workspace/mysim

$ mysim -r 0 -u Cmdenv -c General -n simulations:src:../inet/examples:../inet/src -l ../inet/src/inet simulations/omnetpp.ini

OMNeT++ Discrete Event Simulation  (C) 1992-2011 Andras Varga, OpenSim Ltd.

Version: 4.2.2, build: 120327-7947143, edition: Academic Public License -- NOT FOR COMMERCIAL USE

See the license for distribution terms and warranty disclaimer

Setting up Cmdenv...

Loading NED files from simulations: 2

Loading NED files from src: 48

Loading NED files from ../inet/examples: 59

Loading NED files from ../inet/src: 183

Preparing for running configuration General, run #0...

Scenario: $k=4, $cl=10, $httpport=80, $ftpport=21, $repetition=0

Assigned runID=General-0-20120609-11:42:10-24267

Setting up network `mysim'...

<!> Error in module (cCompoundModule) mysim.pods[0].racks[0] (id=12) during network setup: Class "EdgeIPConfig" not found -- perhaps its code was not linked in, or the class wasn't registered with Register_Class(), or in the case of modules and channels, with Define_Module()/Define_Channel().

End.

Simulation terminated with exit code: 1

Working directory: /Users/.../workspace/mysim

Command line: mysim -r 0 -u Cmdenv -c General -n simulations:src:../inet/examples:../inet/src -l ../inet/src/inet simulations/omnetpp.ini

...


Michael K.

unread,
Jun 12, 2012, 2:30:02 AM6/12/12
to omn...@googlegroups.com
I'm just pushing this, maybe today, someone can help me here.

Best regards,

Michael

Jonas Eymann

unread,
Jun 12, 2012, 4:14:33 AM6/12/12
to omn...@googlegroups.com
Hello Michael,

here is part of a guide I give to our students to simulate via SSH
access on a server, maybe that helps...

In your local OMNeT++ IDE, goto project properties -> OMNeT++/Makemake,
select your source folder and click "Export"

On the command line, go to your project directory and create the
Makefile (with gcc-release ore gcc-debug):

make CONFIGNAME=gcc-release -f makemakefiles

Compile (N is number of parallel jobs):

make MODE=release -jN

Display configurations and number of runs:

./<executable> -a

Run simulation with configuration "configname" and the runs "runs":

./<executable> -u Cmdenv -c <configname> -r <runs> -n
.:../inet/src/ omnetpp.ini (leave out -r <runs> for all runs)

To simulate N runs in parallel (on a multicore machine)

opp_runall -jN ./<executable> -u Cmdenv -c <configname> -r <runs>
-n .:../inet/src/ omnetpp.ini

Regards
Jonas
> --
> Sent from the OMNeT++ mailing list. To configure your membership,
> visit http://groups.google.com/group/omnetpp


Rudolf Hornig

unread,
Jun 12, 2012, 6:32:01 AM6/12/12
to omn...@googlegroups.com
See comments below.


On Friday, June 8, 2012 4:41:18 PM UTC+2, Michael K. wrote:
Hello,

I created my simulation with the IDE and tested it there but now I need to change into the Terminal to see if it performs better and to run it on a couple servers.

I'm confused by the manual chapter 8 - Building simulation program and chapter 10 - NEDPATH. I have no clue about C++ and including libraries and linking stuff. I just used the IDE until now.

After reading chapter 8 I find no starting point how to set up opp_makemake.

But before that, is it possible to use the same codefiles I use with the IDE? Because the IDE creates Makefiles and I have to do that with the Terminal too.

Yes, its possible. 


Some words to my directory structure. inet and my source code are in the same directory, as it uses the workspace from the IDE, i.e., my folders look like this

../workspace/inet
../workspace/mysim/simulations
../workspace/mysim/src

I have several folders under ../workspace/mysim/src to organize my code.

As far as I know from the makefiles in the IDE, the opp_makemake commands look like this:

In src folder and simulations folder:

opp_makemake -f --deep -I../../inet/src/networklayer/ipv4 -I../../inet/src/networklayer/common -I../../inet/src/networklayer/rsvp_te -I../../inet/src/networklayer/icmpv6 -I../../inet/src/transport/tcp -I../../inet/src/base -I../../inet/src/util/headerserializers -I../../inet/src/networklayer/contract -I../../inet/src/util -I../../inet/src/transport/contract -I../../inet/src/linklayer/mfcore -I../../inet/src/networklayer/ipv6 -I../../inet/src/transport/sctp -I../../inet/src/world -I../../inet/src/applications/pingapp -I../../inet/src/linklayer/contract -I../../inet/src/networklayer/arp -I../../inet/src/transport/udp -I../../inet/src/applications/tcpapp -L../../inet/out/$(CONFIGNAME)/src -linet -KINET_PROJ=../../inet

in workspace/inet:

opp_makemake -f --deep --make-so -o inet -O out

in mysim:

opp_makemake -f

I started with the one for INET (called from ../workspace/inet) and after calling make, I get several errors which is not the case when I use the IDE.


An unmodified INET must compile fine after:
$ make makefiles
$ make
 
If this is not the case then you have modified something already in INET and the build process somehow broke...

After playing around with some opp_makemake commands yesterday without using the opp_makemake commands from the IDE I had several missing files. I think this happened because I didn't include anything.

Apart from that I defined the NEDPATH, but the chapter in the documentation isn't very helpful.

It looks like this:
export NEDPATH=/Users/.../workspace/inet/src\;/Users/.../workspace/mysim/src\;/Users/.../workspace/mysim/simulations
(the ... are replaced by the whole path but I don't want to show it here)

Well, to repeat my questions:
1. Do I need a different directory for INET and my source code to run it with the terminal?

No, compiling from command line or IDE can use the same source tree without problem. In fact INET it set up in a way that you can either compile it from ide or command line. Both work correctly.
 
2. How do I use opp_makemake? What needs to be included, in which order do I need to make it.

The best tip is: Build your project from IDE once and then take a look at the src/Makefile (generated by the IDE). The
header comment should contain the opp_makemake command required to create the given makefile from the command line.

 
3. Is the NEDPATH set correctly?

Figuring out the correctl command line... Again, just start your simulation from the IDE. Before starting, it will dump the command line you should use in the eclipse console window. Just copy/paste that command line. It will contain all the required flags (including NED path)
 
4. What else do I have to pay attention to? Is there any further reading or better examples? Couldn't find anything useful in the documentation and in this group, i.e., a full tutorial.

I appreciate every helpful advise :-)

Rudolf 

Michael K.

unread,
Jun 13, 2012, 6:38:27 AM6/13/12
to omn...@googlegroups.com
Thank you both, for the advice. Nothing could really help me though. But I did something I have already done before. I created a new workspace, a new project and copied my code files into it. Now it's complied correctly and it's also executed.

Ali Balador

unread,
Jul 9, 2014, 9:00:29 AM7/9/14
to omn...@googlegroups.com
I have exactly the same problem. Before i did the simulations in IDE mode and now when I want to compile veins in command line I have problem to do that.

Could you give me an idea how to do that.
Reply all
Reply to author
Forward
0 new messages