FlightGear Build using cygwin - June 2006

index

A Fresh Build Of FlightGear (http://flightgear.org/) using cygwin (http://www.cygwin.com/) - 20 June 2006. My earlier attempt, while it appeared to build correctly, failed to run! This build RAN GREAT, except for some scenery anomalies! See here for latest cygwin attempt ...

1. sources update

First I did a CVS update of SimGear-0.3-cvs/source, FlightGear-0.9-cvs/source and data. I had previously installed, compiled OpenAL and PLIB, and know of no significant change in these, so left those as before ...

Then to be SURE, I changed into SimGear-0.3-cvs/source and FlightGear-0.9-cvs/source, and did -

$ make clean

in each folder ...

2. the SimGear and FlightGear builds

Much of the following is directly extracted from fgfs_cygwin.pdf - see -
 http://www.flightgear.org/Docs/Tutorials/fg_cygwin/fgfs_cygwin.pdf

Build SimGear 0.3 CVS Source

There is an additional step that wasn’t required when building the SimGear 0.3.8 release version. The SimGear 0.3 CVS version requires you to run “./autogen” from the ~/SimGear-0.3-cvs/source directory before running “configure”.

username@machine <any_path>
$ cd ~/SimGear-0.3-cvs/source
username@machine ~/SimGear-0.3-cvs/source
$ ./autogen.sh
username@machine ~/SimGear-0.3-cvs/source
$ ./configure -–prefix=/fg-cvs
username@machine ~/SimGear-0.3-cvs/source
$ make

Ran into a MINMAX problem, make error - from development board found some others had enumerated this problem.

<quote>
Hi Mathias and Jon,
 CPPFLAGS=-DNOMINMAX ./configure --xxxxxx
 removed this error.
</quote>

So tried -

$ CPPFLAGS="-DNOMINMAX" ./configure -–prefix=/fg-cvs

then

$ make

and this worked fine. This definition of NOMINMAX stops windows.h from defining min and max, since SimGear uses std::min() and std::max() ... then on with the build ...

username@machine ~/SimGear-0.3-cvs/source
$ make install

Build FlightGear 0.9 CVS Source

There is an additional step that wasn’t required when building the FlightGear 0.9.8 release version. The FlightGear 0.9 CVS version requires you to run “./autogen” from the ~/FlightGear-0.9-cvs/source directory before running “configure”.

username@machine <any_path>
$ cd ~/FlightGear-0.9-cvs/source
username@machine ~/FlightGear-0.3-cvs/source
$ ./autogen.sh
username@machine ~/FlightGear-0.9-cvs/source
$ ./configure -–prefix=/fg-cvs
username@machine ~/FlightGear-0.9-cvs/source
$ make

Ran into the same MINMAX problem, so back up a step, and try -

$ CPPFLAGS="-DNOMINMAX" ./configure -–prefix=/fg-cvs

then

$ make
username@machine ~/FlightGear-0.9-cvs/source
$ make install

3. running flightgear

First run was with the command line -

/fg-cvs/bin/fgfs.exe --log-level=debug --fg-root=/fg-cvs/data --fdm=ufo --aircraft=ufo

(a) got error

Error reading properties:
unclosed token
 at /fg-cvs/data/preferences.xml,
line 415, column 2
 (reported by SimGear XML Parser)

but continued ... Aborted on -

Reading materials from /fg-cvs/data/materials.xml
Error reading materials: no element found
Fatal error: no element found
 at /fg-cvs/data/materials.xml,
line 698, column 0
 (received from SimGear XML Parser)

Fix: Copied both files to *.org.xml, and using nano editor, opened, and saved files in *nix format (from DOS CR/LF) format ...

(b) got next abort

Reading joystick file /fg-cvs/data/Input/Joysticks/ThrustMaster/Top-Gun-Afterbur
Fatal error: unclosed CDATA section
 at /fg-cvs/data/Input/Joysticks/ThrustMaster/Top-Gun-Afterburner.xml,
line 529, column 27
 (received from SimGear XML Parser)

Fix: Again I just loaded the file in nano, had a look at the particular line, but finding nothing wrong, just saved it back to disk ...

*** AND IT RAN *** with sound - happy, happy, happy ;=)) ;=)) ***

And although the HUD would not appear with the H key, it was easy to see the frame rate was many times that of the windows port ... very much less 'jerky' ... some quick 'pauses' here and there, assume while scenery loaded, but GENERALLY RAN SMOOTHLY ...

Some quick notes to 'fix' ... on exit saw 'Deleting a sample' many times, followed by many messages of the form, after an error message -

OpenAL error (AL_ILLEGAL_COMMAND): stop (alDeleteSources)
Deleting a sample
Deleting a sample
Deleting a sample
Deleting a sample
Deleting char arrays
Deleting callback arrays
Deleting bindings
Deleting bindings for Adjust HUD Properties
Deleting bindings for Adjust LOD Ranges
Deleting bindings for Adjust View Distance
Deleting bindings for Aircraft Help

... etc - should remove some of these ...

I have recently 'updated' (I think) my ATI RADEON 9600PRO SAFFIRE drivers ... maybe I should try the windows MSVC8 version again ...

YOW!!! ALL THAT TIME I HAVE TOLERATED A STUPIDLY LOW FRAME RATE SEEMS ENTIRELY DUE TO NOT UPDATING THE ATI DRIVERS THAT CAME WITH THE MACHINE. NOW I GET 50-60 FPS RANGE IN THE NATIVE WINDOWS PORT ... SILLY ME FOR BEING SOOOOO TOLERANT ;=))

This signals a NEW ERA in my FlightGear participation ... mostly I did nothing because it all ran so SLOW, it just did not seems like the effort would be worth it ... I wonder now exactly what the 'update' did? I was not particularly looking for new drivers ... more I wanted to check the OpenAL implementation, and somewhere I recently read - go to the video card manufacturers site - but I was NOT able to find anything very specific on OpenAL there ...

But I did download, and install their ATI CATALYST (r) Control Center, and now have a small red ATI logo resting in my system tray ... This system tray application allows for quick changing of certain video parameters, instead of getting up the control page ...

Time to drop-in my two favourite patches -

(a) src/FDM/UFO.cxx

    // the velocity of the aircraft
    // double velocity = Throttle * Speed_Max->getDoubleValue(); // meters/sec
    double mps = Speed_Max->getDoubleValue();
    double velocity = Throttle * mps; // meters/sec
    if (globals->get_controls()->get_gear_down()) {
        if( mps > 10.0 ) {
            velocity = Throttle * 10;
        }
    }

Someone had kindly made a nasal script which tested the position of the flaps, and adjusted the Speed_Max setting, but unfortunately the 'flaps' are usual up when the aircraft is loaded ...

The problem is that there appears to residual value in the joystick throttle slides at start up, and by the time you see the scene, the UFO is well beyond the airport. It is possible to 'blip' the throttle during start-up, but sometimes I forget to do this, or do it at the wrong time during start-up ... this small patch makes life easier ...

(b) src/Cockpit/cockpit.cxx

Near the top of the file I put -

#define ADD_FPS_STRING

Then near the bottom of the service - void fgCockpitUpdate( void ) {, I add the following -

#ifdef ADD_FPS_STRING
    if ( fgGetBool( "/sim/hud/draw-fps", false )) {
        char buf[64];
        float fps = get_frame_rate();
        float width  = iwidth;
        sprintf(buf,"%-5.1f", fps);
  
        glMatrixMode( GL_PROJECTION );
        glPushMatrix();
        glLoadIdentity();
        gluOrtho2D( 0, iwidth, 0, iheight );
        glMatrixMode( GL_MODELVIEW );
        glPushMatrix();
        glLoadIdentity();
  
        glDisable( GL_DEPTH_TEST );
        glDisable( GL_LIGHTING );
  
        glColor3f( 0.9, 0.4, 0.2 );
 
        guiFnt.drawString( buf,
          int(width - guiFnt.getStringWidth(buf) - 10),
          10 );
        glEnable( GL_DEPTH_TEST );
        glEnable( GL_LIGHTING );
        glMatrixMode( GL_PROJECTION );
        glPopMatrix();
        glMatrixMode( GL_MODELVIEW );
        glPopMatrix();
    }
#endif // ADD_FPS_STRING

This makes the frame rate a permanent display ... With these two patched in place I am ready for my second flight -

/fg-cvs/bin/fgfs.exe --log-level=debug --fg-root=/fg-cvs/data --fdm=ufo --aircraft=ufo --enable-hud

Note, I have added enable HUD, since as mentioned, on the first flight, the 'H' key did not work? Also there is a conflict with the OpenAL DLL files ... When using my native windows build I copy - alut.dll, wrap_oal.dll, OpenAL32.dll, and pthreadVC2.dll from where I built them using MSVC8 into C:\WINDOWS\System32 ... these are NOT compatible with the cygwin build, and I have to ensure I remove them before running the cygwin binary ...

I get another error on running -

Error reading properties:
no element found
 at /fg-cvs/data/keyboard.xml,
line 677, column 2
 (reported by SimGear XML Parser)

but it is not fatal ...

UGH! NEITHER OF THESE TWO PATCH WORK AS EXPECTED ;=((

(a) The Gear will not seem to come UP - the property browser indicates there is NO GEAR, so I remove this for now, trying to remember to blip-the-throttle, and using the [ and ] flaps keys to set the maximim rate, and

(b) The frame rate does NOT appear as hoped, but with the HUD enabled, the Shift-I gives the small HUD, which does have a frame rate display ... this is probably because I have NOT set the prop:/sim/hud/draw-fps as true ... I add to my command line ...

/fg-cvs/bin/fgfs.exe --log-level=debug --fg-root=/fg-cvs/data --fdm=ufo --aircraft=ufo --enable-hud --prop:/sim/hud/draw-fps=true

I also remember to load, and write keyboard.xml in *nix format, to see if the error message will go away ... and maybe some other keys will work as expected?

Of course, on this run, I again missed the correct blip-throttle timing, and was on my way away from the airport when the scene graph becomes visible ... but am rewarded with my 'permanent' frame rate display ...

Actually I am quite disappointed that the frame rate has dropped to about 10 in this cygwin build ... what is changing here? But it is a steady 10 plus, thus still fairly smooth motion ...

With this new flaps speed control I am able to descend into stadium, (SBC or AT&T Park?), and take the UFO down to ground level inside the stadium, ONLY TO FIND THE STADIUM IS SOME TEN (10) FEET OR SO ABOVE THE LAND SURFACE - fascinating stuff ... I take a snapshot for posterity ...

San Francisco stadum stands high, off the ground!

and head off downtown SanFran to see what else I can find ;=))

Actually I note most of the building actually rest a little above the earth ... but the most amazing thing is the Golden Gate bridge is MISSING ...

Missing Golden Gate Bridge

Time to shut down for today ... this is getting too weird ... ;=))

But this is my FIRST successful cygwin build ... it all works ... except of course for the scenery aberrations ;=)) I take some snaps of the 'missing bridge', shown above, and shut down ... the shutdown is quick and neat, now that I have removed all those messages - the last 'done ...' is from my rfg.sh file I use to run fgfs ...

State == Running
Cockpit: code 1 status 0
Program exit requested.
Saving user settings to autosave.xml
Exiting FlightGear with status 0
OpenAL error (AL_ILLEGAL_COMMAND): stop (alDeleteSources)
Deleting char arrays
Deleting callback arrays
Deleting bindings ...
Done 51 bindings ...
done ...

But I can not resist re-loading my MSVC8 build just to CHECK it is still getting 50-60 fps, and the Golden Gate Bridge DOES EXIST - the answer is a resounding YES to BOTH ;=)) Now I can sleep better ...

As mentioned, my  earlier try at building FlightGear with cygwin late last year failed to run ... and my later try is still missing the bridge ...

top - index

EOF - fgfs-028.htm

Valid HTML 4.01 Transitional