Board index FlightGear Support Compiling

Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Building FlightGear from source, and in the need for help?

Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Uselesslogin » Tue Jun 18, 2013 1:31 pm

Hi guys,

I tried to compile Simgear and Flightgear with the JPEG_FACTORY option. I'm using Win8/64Bit with VS12. I'm compiling only the 32Bit version.

simgear:

With VS12 and cmake-gui I ended up with a working VS solution but

test_animations.exe and
test_parseBlendFunc.exe

did not compile.
Code: Select all
Fehler   3   error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<unsigned short> > > __thiscall osg::MixinVector<unsigned short>::begin(void)" (__imp_?begin@?$MixinVector@G@osg@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@G@std@@@std@@@std@@XZ)" in Funktion ""class osg::Node * __cdecl SGOceanTile(class SGBucket const &,class SGMaterialLib *,int,int)" (?SGOceanTile@@YAPAVNode@osg@@ABVSGBucket@@PAVSGMaterialLib@@HH@Z)".   C:\fgbuild\simgear-build\simgear\scene\model\SimGearScene.lib(SGOceanTile.obj)


"Verweis auf nicht aufgelöstes externes Symbol" --> Unresolved Symbol

I found a thread in this very forum, which said I can ignore this error and continue build flightgear.

flightgear

But as it turns out, flightgear also has some troubles, resulting in build problems with

fgelev.exe and
fgviewer.exe

with exactly the same problems as for Simgear. Additionally the compiler continues its process and throws some more linker errors around, preventing fgfs.exe to be build. The errors can be traced to:
groundradar.obj [1]
FGPUIDialog.obj
property_list.obj

where also some linker errors occur.

Questions:
Is there a ready to use Windows build with a working jpeg-http option?
What is the most current manual for a successful flightgear build on a Windows machine?
What are the correct steps to compile Flightgear with jpeg-httpd support?

I need those screenshots, because I want to transfer my most current view to another machine to do stuff with it. I was also looking into NASAL (not a very helpful name when searching the internet for information about it[2]) to perform automated screenshots, but I have troubles with the filenames.

Any ideas how to force 'fgcommand("screen-capture")' to a specific filename?

Are there any other possibilities to capture the screen automatically?

Thank you.

[1]
Code: Select all
Fehler   19   error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<unsigned short> > > __thiscall osg::MixinVector<unsigned short>::end(void)" (__imp_?end@?$MixinVector@G@osg@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@G@std@@@std@@@std@@XZ)" in Funktion ""public: void __thiscall GroundRadar::updateTexture(void)" (?updateTexture@GroundRadar@@QAEXXZ)".   C:\fgbuild\flightgear-build\src\Main\groundradar.obj

[2]
And if I say 'not helpful' I mean, stupid.
Uselesslogin
 
Posts: 7
Joined: Tue Jun 18, 2013 12:48 pm

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Hooray » Tue Jun 18, 2013 2:05 pm

Hi & welcome!

See this recent discussion: http://www.mail-archive.com/flightgear- ... 40206.html
But the long-term plan is to reimplement it: http://wiki.flightgear.org/Howto:Start_ ... PEGFactory
Is there a ready to use Windows build with a working jpeg-http option?

There's been talk about adding JPEG_FACTORY build to the build server: http://flightgear.simpits.org:8080/


What is the most current manual for a successful flightgear build on a Windows machine?
What are the correct steps to compile Flightgear with jpeg-httpd support?

I think the JPEG_FACTORY option just hasn't been very welll-maintained over time.

I need those screenshots, because I want to transfer my most current view to another machine to do stuff with it.

See: viewtopic.php?f=19&t=19903
You may want to check out the following thread, the OP has made all code changes available: https://gitorious.org/~chriscalef

I was also looking into NASAL to perform automated screenshots, but I have troubles with the filenames.
Any ideas how to force 'fgcommand("screen-capture")' to a specific filename?


That isn't currently supported, but would be easy to fix, and a good enhancement, see:
https://gitorious.org/fg/flightgear/blo ... xx#line413
You will want to reimplement the fgDumpSnapshot() function to accept SGPropertyNode parameters:
https://gitorious.org/fg/flightgear/blo ... xx#line556
http://wiki.flightgear.org/Howto:Add_ne ... FlightGear

Are there any other possibilities to capture the screen automatically?


This is one of the most-common feature requests by people doing UAV/computer-vision and OpenCV-related work.
So, there's the idea of supporting a live-image server for images, as well as live-streaming (video): https://code.google.com/p/flightgear-bu ... ail?id=924
Also, somebody is looking at CIGI support: http://wiki.flightgear.org/FlightGear_CIGI_Support_(Common_Image_Generator_Interface)

Finally, note that contributors are currently busy preparing the next release, so feedback will probably be a little scarce in the upcoming weeks, see our release plan: http://wiki.flightgear.org/Release_Plan

(not a very helpful name when searching the internet for information about it-And if I say 'not helpful' I mean, stupid.)

Nasal wasn't specifically developed for FlightGear, it was merely integrated - as such, its name is not directly related to FlightGear. Just consider it "FlightGear Scripting" for now. For FlightGear/Nasal scripting docs, you should see: http://wiki.flightgear.org/Nasal

PS: @UselessLogin: This is almost certainly the most helpful response you are going to see in a long time, until you adjust your tone such that your frustration doesn't dominate your postings any longer ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11285
Joined: Tue Mar 25, 2008 8:40 am

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby chriscalef » Tue Jun 18, 2013 5:12 pm

Hi,

I'm the guy who's using flightgear to generate images for my FPS game, mentioned in above links... also building on windows. Just wanted to chime in here, you can check out my code (warning, it's a barely working prototype, *not* cleaned up for official submission), but I didn't use JPEG_FACTORY, I just took over the fgDumpSnapshot function for my own purposes.

Re: your linker errors, however, it looks to me like you might be compiling against a slightly wrong version of OpenSceneGraph - I got errors very similar to that and had an extremely difficult time resolving them, but I eventually found the right version on the Jenkins build server, see following thread to share the pain with me and another budding flightgear windows developer:

http://www.flightgear.org/forums/viewto ... 45&t=19203

Unfortunately, the link I posted in there for the final working version of OSG that I found on the build server seems to be dead now, but at least it might provide you some clues. I don't recommend ignoring the error, at least for me my problems with MixinVector were showstoppers.

Good luck!
chriscalef
 
Posts: 234
Joined: Wed Feb 20, 2013 9:28 pm

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Uselesslogin » Wed Jun 19, 2013 8:34 am

Thanks for the warm welcome.

@Hooray
I will take a look into the links you recommended. Thank you.

And I apologize for the fact my tone sounds rude. I understand this is Open-Source and people spending their free time to improve Flightgear/ Simgear. As a suggestion maybe it is possible do provide build instructions with the library versions used in the build. I can imagine, even the developers will compile them for test purposes, which means there have this kind of information. And if this information could be integrated into one of the manuals on the wiki, it could eliminate a great deal of uncertainty in the build process.

@chriscalef
I will take a look into the changes you provided. With some luck, I can understand your changes and incorporate them for my needs. Thank you.

I figured OpenSceneGraph could be the issue. I had similar issues with the boost libraries (took 1.44 instead of the most current 1.53). I took my copy from AlphaPixel.com but I'll give Jenkins a try.
Uselesslogin
 
Posts: 7
Joined: Tue Jun 18, 2013 12:48 pm

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Uselesslogin » Fri Jun 21, 2013 3:46 pm

Hello again,

I got it working.

@chriscalef:
You were right; there are slightly differences between OSG includes and the actual libs. And, like you, the Jenkins binaries never worked out for me (and neither did alphapixel.org binaries), meaning I had to compile OSG, simgear and flightgear from scratch. I took only the 3rd-party stuff from the Jenkins build server and added stuff cmake was complaining about. I'll make a list about that. One additionally noteworthy thing; I had to recompile my zlib. There seem to be a toolset issue with Microsoft Visual Studio 10 / 12 preventing also a successful build.
Bad news is; I have to recompile again. I took the most current source code from gitorious.org and now I have not a valid data folder. I'm not really comfortable with changing data/version to 2.11. So just for funnies I will recompile again. During that, I will also make a list of my steps and include used software and the most current place to grab that stuff. Maybe this will help somebody.

So, there that. I'm going now into weekend mode.
Uselesslogin
 
Posts: 7
Joined: Tue Jun 18, 2013 12:48 pm

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Hooray » Fri Jun 21, 2013 4:51 pm

Hi again, thanks for taking the time to provide feedback, that's really useful and appreciated!

And yes, please DO add your findings to the wiki, let us know if you need help using the wiki.

I'm not really comfortable with changing data/version to 2.11.

Actually, you should simply use fgdata from git - remember, the next release will be based on the same code, too.
So if you're already using git, it's a piece of cake to switch between different versions - obviously that would require fgdata to be checked out from git in the first place, but it's definitely worth it.

You already accomplished the tricky stuff, fgdata is a no-brainer in comparison - we have dozens of people here who don't manage to build FG from source, but who still regularly pull the latest fgdata via git.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11285
Joined: Tue Mar 25, 2008 8:40 am

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Uselesslogin » Mon Jun 24, 2013 1:16 pm

Hello again,

there seems to be some more issues. When I try to run fgfs.exe, Flightgear freezes. Oh, and I reverted, just for testing purposes, to 2.10.

The console gives me:
Code: Select all
Logging priority is bulk
fg_root = e:/working/data
Reading global preferences
Finished Reading global preferences
Reading user settings from C:/Users/mp/AppData/Roaming/flightgear.org/autosave.xml
aircraft = Dragonfly
Loading aircraft -set file from:e:/working/data/Aircraft/Dragonfly/Dragonfly-set.xml
Detected locale's language setting: de
System language: de_DE
Searching language resource for locale: de_DE
Found language resource for: de_DE
Reading localized strings for 'en' from e:/working/data/Translations/en/sys.xml
Reading localized strings for 'de' from e:/working/data/Translations/de/sys.xml
Setting geometry to 800x600

Logging priority is bulk
initializing cloud layers


That’s it. Flightgear freezes now and eats 20 % of my CPU, but nothing happens. Obviously, there is something wrong with my build, but since Flightgear compiles fine, I am running out of ideas. There is also a problem in fgrun, but unfortunately, it provides no output. It just starting, doing nothing. I am assuming both problems are somewhat related, but I can't figure out how.

Are there some switches I might miss? I am using these options [1] for cmake when creating VS solutions for OSG, Simgear and Flightgear.

[1]
http://wiki.flightgear.org/Building_usi ... _-_Windows
Uselesslogin
 
Posts: 7
Joined: Tue Jun 18, 2013 12:48 pm

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby chriscalef » Mon Jun 24, 2013 5:14 pm

I may not be the most useful one to respond since I'm a FG newb myself and know very little of what's going on internally, but

a) can you run it in debug mode? It might tell you exactly where it's crashing or hanging up, and

b) have you triple checked everything having to do with cloud layers, like is all the necessary data there, have you tried turning them off temporarily, etc? Dont' know exactly how you'd do that but it would be in the XML setup files somewhere I'm sure.
chriscalef
 
Posts: 234
Joined: Wed Feb 20, 2013 9:28 pm

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Gijs » Mon Jun 24, 2013 5:34 pm

The links at http://wiki.flightgear.org/Building_usi ... _-_Windows are supposed to give you everything you need. I've updated them not so long ago and they match my (working) workflow. You shouldn't need to compile OSG yourself.

Gijs
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9306
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Uselesslogin » Tue Jun 25, 2013 8:25 am

Thanks for hanging in here with me.

@Gijs:
I tried that before, but it did not work out. But this was last week, in the meantime I got a little more experience on how to use that tools, so maybe I was overlooking something in the beginning. Worth a shoot. Thanks.

@chriscalef:
I was also thinking about compiling in debug-mode, it could not hurt, right? I have a working Flightgear installation on my disk and that installation had no trouble to use that data. I will look over the XML files; maybe there is a switch for disabling clouds. Thanks again.

So, the files Gijs suggested, are almost downloaded. I am proceeding with fingers crossed :).
Uselesslogin
 
Posts: 7
Joined: Tue Jun 18, 2013 12:48 pm

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Uselesslogin » Tue Jun 25, 2013 1:22 pm

Hello again,

@Gijs:
Well it worked - flying with jpeg-httpd support. Can't explain why it did not work out in the first place. Maybe a library mix-up. I had them from different places and I may lost track about them. Also, I guess I needed just a little more experience to overcome potential error messages. This time I used VS10 instead of VS12 (but with the V100 toolset); don't know if this might be an issue here. I will double check and provide feedback on that.

@Hooray:
Guess there is no need to update the wiki. The only thing I can think of is: "If it not worked out - try again".

So, now I have to test if the screen update is fast enough for my application (its UAV related). Are there some options to improve jpeg-compression, maybe in the property tree?

Thanks to all of you for your valuable feedback.
Uselesslogin
 
Posts: 7
Joined: Tue Jun 18, 2013 12:48 pm

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Hooray » Tue Jun 25, 2013 3:19 pm

you will probably need to edit the C++ code to speed-up JPEG stuff, there are a bunch of options for also creating screen shots and putting them into a buffer that is served asynchronously, i.e. to run parts of the network code in a background thread. But that will require C++ edits.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11285
Joined: Tue Mar 25, 2008 8:40 am

Re: Compiling Simgear / Flightgear with DJPEG_FACTORY=ON

Postby Uselesslogin » Fri Jun 28, 2013 11:42 am

Hello again,

@Hooray
Yep, that is what I did. I found the correct option in the Simgear source (jpegfactory.cxx). In that very file I found a call to the jpeg_set_quality() function. It was an easy modification. I changed:

Code: Select all
Old: jpeg_set_quality(cinfoPtr, (100 * 90) >> 8, TRUE);
New: jpeg_set_quality(cinfoPtr, 95, TRUE);


As a result, compression artifacts are almost gone. I do have now an impact on my game performance, which I had not in the first place. Every time I grab such a shot with my program, the performance went down. Nothing serious and I expect with a more powerful machine to overcome that issue. File size also increased from 30 kb up to 115 kb. However, quality is much better.

My Flightgear knowledge is of course limited to that very file. How difficult would it be to create a property node, which controls that value? I assume that this could help some people. I really like that jpeg-factory support. It has a very handy http-interface and is fast enough for my purposes. Good work here!

Another question I have is; (100*90) >> 8 --> that equals 35. I am aware this is not Flightgear but Simgear related; is there a reason to write it that way? That is something that puzzles me.

Have a sunny weekend!
Uselesslogin
 
Posts: 7
Joined: Tue Jun 18, 2013 12:48 pm


Return to Compiling

Who is online

Users browsing this forum: chriscalef and 3 guests