Simulation upgrade (osg) OMNeT++ 5.0 to 5.1

291 views
Skip to first unread message

Thomas Dietrich

unread,
Apr 4, 2017, 12:56:34 PM4/4/17
to OMNeT++ Users
Hello everyone,

I've been developing a simulation based on the osg-earth example shipped with OMNeT++ 5.0. Today I wanted to upgrade 5.1. I went the most promising path by setting up a fresh instance and importing the old project after everything (including the newer osg-earth example) was working. My simulation sadly was welcomed with a bunch of errors. I've already tracked down a few but am still not able to compile without problems.

The release notes didn't hint that but obviously a few things considerably changed from 5.0 to 5.1.

Are there any upgrade recommendations?

Rudolf Hornig

unread,
Apr 10, 2017, 5:33:38 AM4/10/17
to OMNeT++ Users
There were no big changes related to the OSG integration. One big difference between 5.

Rudolf Hornig

unread,
Apr 10, 2017, 5:37:13 AM4/10/17
to OMNeT++ Users
There were no big changes related to the OSG integration. One big difference between 5.0 and 5.1 is that on windows we have moved from 32-bit to 64-bit. I'm intereseted in what kind of errors you see, but generally, you should not have to much effort to start using 5.1.

INET contains a lot of osg code and we had no issues building it on both 5.0 and 5.1

Thomas Dietrich

unread,
Apr 10, 2017, 1:29:12 PM4/10/17
to omn...@googlegroups.com
Thanks for your answer Rudolf.
I'll document my progress while I'm going through it again.
1. Setting up OMNeT++ 5.1 fresh
2. Importing the existing project folder into the new workspace
3. First build error, a few header files can not be found, turns out they were wrongly included via "<...h>"
4. Build error "Version mismatch! Probably this file was generated by an earlier version of nedtool" -> Clean up NED files, didn't work, had to delete generated message cpp+h files myself
5. The third build and I'm seeing thousands of these errors:

D:/omnetpp-5.1/tools/win64/mingw64/lib/libosgDB.dll.a(d000310.o):(.idata$5+0x0): multiple definition of `__imp__ZN5osgDB12ImageOptionsC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000310.o):(.idata$5+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000309.o):(.text+0x0): multiple definition of `osgDB::ImageOptions::ImageOptions()'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000309.o):(.text+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000309.o):(.idata$5+0x0): multiple definition of `__imp__ZN5osgDB12ImageOptionsC1Ev'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000309.o):(.idata$5+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000308.o):(.text+0x0): multiple definition of `osgDB::ImageOptions::ImageOptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000308.o):(.text+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000308.o):(.idata$5+0x0): multiple definition of `__imp__ZN5osgDB12ImageOptionsC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000308.o):(.idata$5+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000307.o):(.text+0x0): multiple definition of `osgDB::ImageOptions::init()'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000307.o):(.text+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000307.o):(.idata$5+0x0): multiple definition of `__imp__ZN5osgDB12ImageOptions4initEv'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000307.o):(.idata$5+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000306.o):(.text+0x0): multiple definition of `osgDB::readXmlFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, osgDB::Options const*)'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000306.o):(.text+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000306.o):(.idata$5+0x0): multiple definition of `__imp__ZN5osgDB11readXmlFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKNS_7OptionsE'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000306.o):(.idata$5+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000305.o):(.text+0x0): multiple definition of `osgDB::queryPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::list<osg::ref_ptr<osgDB::ReaderWriterInfo>, std::allocator<osg::ref_ptr<osgDB::ReaderWriterInfo> > >&)'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000305.o):(.text+0x0): first defined here
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000305.o):(.idata$5+0x0): multiple definition of `__imp__ZN5osgDB11queryPluginERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS0_4listIN3osg7ref_ptrINS_16ReaderWriterInfoEEESaISC_EEE'
D:/omnetpp-5.1/tools/win64/
mingw64/lib/libosgDB.dll.a(d000305.o):(.idata$5+0x0): first defined here
```

Rudolf Hornig

unread,
Apr 10, 2017, 2:32:07 PM4/10/17
to OMNeT++ Users


On Monday, 10 April 2017 19:29:12 UTC+2, Thomas Dietrich wrote:
Thanks for your answer Rudolf.
I'll document my progress while I'm going through it again.
1. Setting up OMNeT++ 5.1 fresh
2. Importing the existing project folder into the new workspace
3. First build error, a few header files can not be found, turns out they were wrongly included via "<...h>"
4. Build error "Version mismatch! Probably this file was generated by an earlier version of nedtool" -> Clean up NED files, didn't work, had to delete generated message cpp+h files myself

Cleanup NED does a completely different thing. It checks all the NED files and adds necessary imports if needed. "make clean" what is needed to clear the generated files.
 
5. The third build and I'm seeing thousands of these errors:

These are linker errors and show that during the build process you are linking with the libosgdb library two times. You probably add it in the model but OMNeT++ also adds it as a dependent library. You should probably remove it from the model.

Thomas Dietrich

unread,
Apr 12, 2017, 9:20:05 AM4/12/17
to omn...@googlegroups.com
Thanks for the instructions. I did some further digging and found out that the osg-earth example changed more than stated in the changelog. The main culprit was the file `makefrag`, which previously included `-losgDB`. I've now replaced the file and 1-2 others with the ones from the 5.1 osg-earth example and my simulation finally works.

I've yet another problem. Suddenly my osgb model file is not accepted anymore. The simulation is fine loading the provided `glider.osgb` but for mine I'm getting the following errors:

Error reading file quadcopter_v3.osgb: read error (InputStream: Failed to read from stream. At osg::Node )
Subfile "quadcopter_v3.osgb" could not be loaded
Error reading file quadcopter_v3.osgb.12e-1.scale: file not handled
Subfile "quadcopter_v3.osgb.12e-1.scale" could not be loaded
Error reading file quadcopter_v3.osgb.12e-1.scale.0,0,90.rot: file not handled

The file was working with OMNeT 5.0. Would you be able to check it out? The file: https://www.dropbox.com/s/em0fdlpaselnk5w/quadcopter_v3.osgb?dl=0 (generated with osgexport in Blender)

Thanks!

Attila Török

unread,
Apr 13, 2017, 4:24:29 PM4/13/17
to OMNeT++ Users
Hi Thomas!

We've also had some difficulties with loading .osgb files even within one of the built-in sample projects. I don't remember which model was it, but we had a file which could be loaded on half of our Linux machines, and couldn't on the other, nor the Windows machines, etc. The key was that there are considerably different versions of pre-built OSG packages available on different OS-es / distros.

I think the error is because the OSGB format and its [de]serializers in OSG have changed from one version to another in a not-entirely-compatible way, and OSG being a community-maintained open-source project (AFAIK?), this might not have been handled in the most graceful way possible. I don't know for sure though...

So if you still have a version of OSG at hand that can load the model, or you have it in some other format, you could try converting/exporting it to a few different formats, and look at how well they work using different versions of OMNeT++/OSG.
If you have a simple static mesh with some colors/normals/UV maps/textures, I think you have a fair chance of getting at least a few to work, but with any more advanced stuff, like animations and object hierarchies, maybe not so much.

The osgconv utility can help you with this, also take a look at this table here: http://trac.openscenegraph.org/projects/osg//wiki/Support/UserGuides/Plugins
Again, I have no idea how accurate and up-to-date it is.

I'm excited to see the awesome 3D visualizations you (and anyone else) will create using OSG in OMNeT++!

Attila

2017-04-12 15:20 GMT+02:00 Thomas Dietrich <thdiet...@gmail.com>:
Thanks for the instructions. I did some further digging and found out that the osg-earth example changed more than stated in the changelog. The main culprit was the file `makefrag`, which previously included `-losgDB`. I've now replaced the file and a 1-2 others with the ones from the 5.1 osg-earth example and my simulation finally works.


I've yet another problem. Suddenly my osgb model file is not accepted anymore. The simulation is fine loading the provided `glider.osgb` but for mine I'm getting the following errors:

Error reading file quadcopter_v3.osgb: read error (InputStream: Failed to read from stream. At osg::Node )
Subfile "quadcopter_v3.osgb" could not be loaded
Error reading file quadcopter_v3.osgb.12e-1.scale: file not handled
Subfile "quadcopter_v3.osgb.12e-1.scale" could not be loaded
Error reading file quadcopter_v3.osgb.12e-1.scale.0,0,90.rot: file not handled

Clearly a parsing error. The file was working with OMNeT 5.0. Would you be able to check it out? The file: https://www.dropbox.com/s/em0fdlpaselnk5w/quadcopter_v3.osgb?dl=0

Thanks!

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

Thomas Dietrich

unread,
Apr 18, 2017, 7:32:58 AM4/18/17
to omn...@googlegroups.com
Hello Attila, thanks for your response!

I've done some conversion (OpenSceneGraph-3.1.0-VS9.0.30729-x64-release-12752) and tried modifying a few options.

One working version of my model is the non-binary version after converting 'osgb' to 'osg'. That's something but with 10x the size and longer loading times not a good option. Based on this file I've tried a couple of parameterized conversions to osgb but these could not be loaded by OMNeT++ 5.1. I'm afraid without a clearer error description than the one posted above, I can not solve this issue. Any suggestions which options or conversion steps could make a difference?

Thanks for your help and all the best! Thomas

Attila Török

unread,
Apr 21, 2017, 6:30:27 AM4/21/17
to OMNeT++ Users
I suggest to try converting the model into a format other than .osgb, as that seems to be the problematic one.
I don't have a definite solution though, sorry, but you could even try to use the .osg file itself. Or the .ive format, as that is an other OSG native format (IIRC). Another common one are the .obj/.mtl (a.k.a. Wavefront) files.
Basically, all I can say is: keep trying with different formats, and you should find some that work. I know this is not much help, but OSG itself is not really under our control.

Best of luck,
Attila

2017-04-18 13:32 GMT+02:00 Thomas Dietrich <thdiet...@gmail.com>:
Hello Attila, thanks for your response!

I've done some conversion (OpenSceneGraph-3.1.0-VS9.0.30729-x64-release-12752) and tried modifying a few options.

One working version of my model is the non-binary version after converting 'osgb' to 'osg'. Based on this file I've tried a couple of parameterized conversions to osgb but these could not be loaded by OMNeT++ 5.1. I'm afraid without a clearer error description than the one posted above, I can not solve this issue. Any suggestions which options or conversion steps could make a difference?


Thanks for your help and all the best! Thomas

--

Thomas Dietrich

unread,
Jun 7, 2017, 5:32:24 AM6/7/17
to OMNeT++ Users
Hey Attila, it was not clear that obj is also supported. That makes the whole modelling process way easier. I've reduced the model complexity and am now using obj+mtl as the  export format.
Thanks for your help!
Best Regard, Thomas

Attila Török

unread,
Jun 7, 2017, 6:05:17 AM6/7/17
to OMNeT++ Users
Hi!

Sorry for not making this completely clear. I'm glad you could make it work!
Again, just out of pure personal curiosity, it would be great if you could show a little demonstration of your work with OSG in OMNeT++ once you feel like the project is ready for it (and there are no other limiting factors).
And as always, any feedback regarding usability, stability or anything else is much appreciated!

Attila

--
Reply all
Reply to author
Forward
0 new messages