../ned
../router
../component_1
../component_2
.....
In each folder I've created the Makefile having care of specifying also the related folders with the command
"opp_makemake -n -I../ned" etc...
in the main folder finally I've created the main makefile with "opp_makemake -r -w ". Everything compiles and looks perfect.
In the ned files I have defined a number of different scenarios where the modules are connected in different ways.
I switch between the scenarios by changing the "network" parameter in the omnet.ini file.
The problem is that when I run a simulation
Omnet does not find the network I've defined!!! moving back the ned files on the main directory the same problem
happens with the classes defined in the other folders! what is going on??
does anybody have an idea of what is happening on and how to solve it?
thanks a lot,
Nicola
_______________________________________________
OMNeT++ Mailing List
options: http://lists.omnetpp.org/mailman/listinfo/omnetpp-l
archive: http://www.omnetpp.org/listarchive/index.php
Regards,
Michele
thanks for replying!
So first of all...I' m working under a Linux environment. Ned is loaded dynamically or, at least by the default settings of the "./configure" file which I have not touched.
I have a project made of many different components that already works perfectly. As it starts getting big to fit in a single folder I've decided to divide it in many .
Following the manual (that is really poor on this point) I've created the folders separating each independent part and creating the per-folder Makefiles with the command "opp_makemake -n -I../ned -I../common....". For the ned files I've created a unique directory "ned" that all the other Makefiles refers to (with the -I../ned option).
Problems come out when I create the main Makemake. Using only "opp_makemake -r -o sim" I get a Makefile
with folders considered in alphabetical order...which is a bad thing.
So as documentation is bad and time is little I've just changed the folder order in the Makefile's SUBDIRS variable and now it compiles.
The simulator though does not work as I get the following error:
---------------
RUNTIME ERROR. A cRuntimeError exception is about to be thrown....
....
...
<!> Error in module (Node_Nps) noc.node[0]: Module type definition Router_ZeroFirst not found (Define_Module() missing from C++ code?).
---------------
Where "Router_ZeroFirst" is a simple component whose type is a parameter. In the Router_ZeroFirst.cc file I define the class with the command
Define_Module_Like( Router_ZeroFirst, Router ); where Router is the the ned definition simple component.
Note that now "Router_ZeroFirst.cc" is in the folder "sim/router" and Router.ned is in "sim/ned" and the ./router dir has a Makefile referring to ./ned.
It's strange...as I said the model works when everything is in the same folder and now it does not...
any idea? or at least any info about how to divide the files and use the "makefrag" thing?
Thanks a lot, ciao,
Nicola
Andras
To resolve your compilation problem:
Try and write a 'makefrag' file in your $SIMROOT directory (being the
root of your project, like INET-$BUILD/ is for INET). If you have no
clue, copy/paste the makefrag file in the INET root. One of its
sections is used to specify additional dependencies in between the
files, using the following syntax:
$(TARGET): Needed stronglyNeeded Need
This solves your ordering problem so that you don't have to re-edit the
automatically generated Makefile every time. 'makefrag' is
automatically read by 'Makefile' when you issue a make. I believe there
is a couple of lines in the documentation that explain this, even if it
might sound 'not-that-clear'.
Furthermore, if the final executable will be created in your $SIMROOT
folder, then you will need to specify '.tstamp' among the requirements
for the $(TARGET); that instead not necessary if you perhaps build the
executable in separated folder (e.g. bin/).
Andras, it might be worth thinking about extending a little that section
of the documentation and/or publicize a typical
walkthrough/troubleshoot.
About your dynamic builder options, instead, Andras told you already
everything you need. I personally keep .ned files and code related to
the same module in the same directory. Unfortunately that comes with
the drawback that GNED is not working properly anymore. I've always
used the GNED tool very little anyway, despite its dowries.
Give it a try, I hope it'll help,
Cheers,
That make system is a thing of the past already. In OMNeT++ 4.0, a single
"opp_makemake --deep; make" command will generate a single unified makefile
that compiles and links all source files in the whole subdirectory tree.
Stay tuned. Betas will be out in weeks.
Did you solve your "directories" problem? I faced a similar problem. I
read this topic, but didn't see a clear workaround.
Regards,
Illidan.modeler
2008/5/13 Nicola Concer <twi...@yahoo.com>:
--
Northern Capital, the Republic of Pandaria
http://illidan.cublog.cn
Regards,
Andras
> -----Original Message-----
> From: omnetpp-...@omnetpp.org [mailto:omnetpp-...@omnetpp.org]
> On Behalf Of Illidan Modeler
> Sent: Wednesday, June 25, 2008 5:37 AM
> To: OMNeT++ Discussion List
> Subject: Re: [omnetpp] Folders
>