Why are the 'results' folder and the executable inside the 'src' folder?

1,063 views
Skip to first unread message

Alberto Cortés

unread,
Sep 17, 2010, 7:56:14 AM9/17/10
to omn...@googlegroups.com
Hello OMNeT++ fans.

While trying to come up with a nice way to backup my OMNeT++ projects,
I have notice something odd:

Projects created with the template "Empty project with 'src' and
'simulations' folders", when compiled and run:

- the executable of the simulation is also created inside this src dir
- the 'results' dir is created inside the src dir


This seems rather odd to me. I only use Eclipse to work with OMNeT++
so it may be an Eclipse thing, but I would have expect something like
this instead (ASCII art follows):

my-project/
src/
source.cc
omnet.ini
network.ned
bin/
executable
results/
foo.elog
foo.sca
foo.vec

In the "Create, manage and run configurations' window (<Run> -> Run
Configurations...) I have notice there is a 'Working directory' with
the value of 'my-project/src/', maybe it should get change to just
'my-project' and then use suffixes for 'src/', 'results/', 'bin/' when
needed...

What do you think?

--
Alberto Cortés
Telematic Engineering Dept. at UC3M

Rudolf Hornig

unread,
Sep 17, 2010, 8:39:01 AM9/17/10
to omn...@googlegroups.com
Actually the executable is created at

out/gcc-debug or out/gcc-release

and for convenience a symbolic link is created in the src directory that points to the executable. This is done, because usually the simulation executable expects the ini file and the root of ned folder in the current working directory (unless you specify otherwise). i.e. if you start the executable it will work as expected without adding extra command line parameters.

Unfortunately on windows (at least on XP and Vista) soft linking is not working, so the build process does the best it can and copy the whole executable there :( (On windows 7 it would be possible to create a soft link)

You can reconfigure your project to place the the results somewhere else, but you are on your own to set up all directories correctly...

- Project Properies / OMNeT++ / Makemake 
- select the src directory in the tree and click "Options" and you can change the Output directory from 'out' to 'bin' but in this case you have to give the INI and NED file directories each time you start the simulation.

The place of the 'result' directory ca be also customized by the 'result-dir' INI file option.

Rudolf


--
You received this message because you are subscribed to the Google Groups "omnetpp" group.
To post to this group, send email to omn...@googlegroups.com.
To unsubscribe from this group, send email to omnetpp+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/omnetpp?hl=en.


Alberto Cortés

unread,
Sep 17, 2010, 11:44:51 AM9/17/10
to omn...@googlegroups.com
On Fri, Sep 17, 2010 at 2:39 PM, Rudolf Hornig <rudolf...@gmail.com> wrote:
> Actually the executable is created at
> out/gcc-debug or out/gcc-release
> and for convenience a symbolic link is created in the src directory that
> points to the executable.

You are right, I didn't notice it was actually a link (I use Linux).

> This is done, because usually the simulation
> executable expects the ini file and the root of ned folder in the current
> working directory (unless you specify otherwise). i.e. if you start the
> executable it will work as expected without adding extra command line
> parameters.

I see. The link looks convenient for the command line invocation.

I use to run OMNeT++ using the command line and I remember having to
pass that parameters by hand: I use to had directories for everything
to easily backup only the necessary files to recreate the simulations
and I thought the src-simulations templete was designed just for that.

If the link is a way to have the executable in the same dir as the ini
and NED files, What is the purpose of the simulation dir then?


> Unfortunately on windows (at least on XP and Vista) soft linking is not
> working, so the build process does the best it can and copy the whole
> executable there :( (On windows 7 it would be possible to create a soft
> link)

:(

> You can reconfigure your project to place the the results somewhere else,
> but you are on your own to set up all directories correctly...
> - Project Properies / OMNeT++ / Makemake
> - select the src directory in the tree and click "Options" and you can
> change the Output directory from 'out' to 'bin' but in this case you have to
> give the INI and NED file directories each time you start the simulation.
> The place of the 'result' directory ca be also customized by the
> 'result-dir' INI file option.

Thank you, somehow I miss that in the Configuration Options appendix
of the OMNeT++ manual.

I have succesfully use 'result-dir = ../results' to create a new
results dir at the project root dir.

I have also successfully edit (by hand) the input section of my .anf
files to use the new results dir instead of the old src/results dir.

There is still one problem, though: When I open (by clicking) one of
the result files, the IDE automatically builds an .anf file for it if
there is none already. It looks that the new .anf file is created in
the parent directory of the result dir: If the results dir is
/'my-project/src/results', then the .anf file is created at
'my-project/src', fine, but if the results dir is
'/my-project/results', the .anf file is created at '/my-project'.

It may be a good idea to automatically create all the .anf files in
the 'src' dir, instead of in 'results/..'

Alberto.

Rudolf Hornig

unread,
Sep 17, 2010, 3:37:56 PM9/17/10
to omn...@googlegroups.com
On Fri, Sep 17, 2010 at 5:44 PM, Alberto Cortés <alco...@it.uc3m.es> wrote:
On Fri, Sep 17, 2010 at 2:39 PM, Rudolf Hornig <rudolf...@gmail.com> wrote:
> Actually the executable is created at
> out/gcc-debug or out/gcc-release
> and for convenience a symbolic link is created in the src directory that
> points to the executable.

You are right, I didn't notice it was actually a link (I use Linux).

> This is done, because usually the simulation
> executable expects the ini file and the root of ned folder in the current
> working directory (unless you specify otherwise). i.e. if you start the
> executable it will work as expected without adding extra command line
> parameters.

I see. The link looks convenient for the command line invocation.

I use to run OMNeT++ using the command line and I remember having to
pass that parameters by hand: I use to had directories for everything
to easily backup only the necessary files to recreate the simulations
and I thought the src-simulations templete was designed just for that.

If the link is a way to have the executable in the same dir as the ini
and NED files, What is the purpose of the simulation dir then?

The intention with the two directories was, that with bigger projects that aim to be reusable,
you would put your (reusable) model components into the src directory (all C++ and NED files 
(except top level networks) go there) and you would use the simulation directory to store your 
files that are related to your experiments (top level network, and INI files). This way if someone 
wants to use your model to do a different experiment, he would not be confused which files are
part of the model and which files are not... In general, you are not supposed to put C++ code into 
the simulation dir...

If you take a look at the INET it is organized similarly. Components are under the 'src' dir while
all examples are under the 'examples' directory... (ok. it's called examples not simulation, but
the pattern is the same :)

 


> Unfortunately on windows (at least on XP and Vista) soft linking is not
> working, so the build process does the best it can and copy the whole
> executable there :( (On windows 7 it would be possible to create a soft
> link)

:(



> You can reconfigure your project to place the the results somewhere else,
> but you are on your own to set up all directories correctly...
> - Project Properies / OMNeT++ / Makemake
> - select the src directory in the tree and click "Options" and you can
> change the Output directory from 'out' to 'bin' but in this case you have to
> give the INI and NED file directories each time you start the simulation.
> The place of the 'result' directory ca be also customized by the
> 'result-dir' INI file option.

Thank you, somehow I miss that in the Configuration Options appendix
of the OMNeT++ manual.

if in doubt try:
opp_run -h config

Alberto Cortés

unread,
Sep 18, 2010, 5:54:29 AM9/18/10
to omn...@googlegroups.com
On Fri, Sep 17, 2010 at 9:37 PM, Rudolf Hornig <rudolf...@gmail.com> wrote:
> The intention with the two directories was, that with bigger projects that
> aim to be reusable,
> you would put your (reusable) model components into the src directory (all
> C++ and NED files
> (except top level networks) go there) and you would use the simulation
> directory to store your
> files that are related to your experiments (top level network, and INI
> files). This way if someone
> wants to use your model to do a different experiment, he would not be
> confused which files are
> part of the model and which files are not... In general, you are not
> supposed to put C++ code into
> the simulation dir...
> If you take a look at the INET it is organized similarly. Components are
> under the 'src' dir while
> all examples are under the 'examples' directory... (ok. it's called examples
> not simulation, but
> the pattern is the same :)

Thank you very much for the explanation, Rudolf. It's indeed a nice
way to improve the re-usability of projects.


> if in doubt try:
> opp_run -h config

That's *very* useful, thanks again. It's time for me to re-read the
user manual again :)

ehsan jeyhani

unread,
Sep 1, 2015, 10:51:16 AM9/1/15
to omn...@googlegroups.com
Rudolf Hornig thank you for your answer . actually my problem was that the files like binaries and .exe were missing.
this was the error
"C:../.../lab lab lab .../myproject.exe"
"CreateProcess error=2, The system cannot find the file specified"

selected myproject and going to properties->omnet++->makemake and cheking custom makefile every things apears and project was correctly run.
ex me for bad english.  

Reply all
Reply to author
Forward
0 new messages