FlightGear and cygwin

back

This build was started: 15 November through to 22 November 2005. Note this particular build FAILED to run, however the latest effort did SUCCEED!

FlightGear and cygwin

FlightGear is a FREE flight simulator, which requires a number of components, or dependencies, to be able to run, including OpenAL, a sound library, PLIB, a portable 'game' library, SimGear, a collection of simulator 'gear', as well as the FlightGear source and base data ... all will combine to produce a powerful, beautiful, flight simulator.

This is a story of my first impressions of trying to compile, and run FlightGear using cygwin (http://cygwin.com/) - As the site proclaims, cygwin is - GNU + Cygnus + Windows - GNU (http://www.gnu.org/), as that site states is 'a recursive acronym for "GNU's Not UNIX" ... Cygnus, not sure ... Windows is for sure, Microsoft WINDOWS ... WIN32 ...

When downloaded and installed on Windows, it offers a unix, *nix like, user interface ... for example, to close the window, you enter 'logout' ... few of your command prompt commands work, like 'dir', which is more like 'dir /w', but not the same ... if you want a more detailed listing of files, and folders, try 'dir -all' ... or 'ls -all' ...

Change directory, 'cd ..', 'cd <folder-name>', works like you would expect, but you are limited in how many 'cd ..' you can enter - it severely restricts you to the cygwin root folder; 'cd ~' will put you back in your (cygwin) HOME folder, which, if you installed it in C:\cygwin folder, will be C:\cygwin\home\username ...

You can view other folder, outside the cygwin folder, but you must use, say 'ls /cygdrive/c/foldername -all' to get there ... in other words, cygwin does not support a drive designation, like c: ...

To proceed further, you really MUST learn some of the *nix commands - like 'md fg-0.9.9' must be 'mkdir fg-0.9.9' ... a listing of the cygwin bin folder, will list over 800 exe files ... each does its thing ... running some of them in the cygwin windows quickly teaches you that 'q' often means quit; ctrl+c will often get you out of some things ... but there is just so much to learn ...

FlightGear has recently hosted a sort of 'quick-start' PDF - go to -
http://www.flightgear.org/Docs/Tutorials/fg_cygwin/fgfs_cygwin.pdf
This document, authored by Kevin Jones, takes you through downloading and installing cygwin, some of the development cygwin environment, and downloading and installing the dependant components of FlightGear, OpenAL (sound library), PLIB, portable library, SimGear, and, of course, FlightGear source and data itself ...

Having begun to explore this path myself, I would add the following 'caveats' to that document ...

Windows User Name, and cygwin Home Directory:

Like perhaps most of us, my USERNAME, in the command prompt environment, is my actual name, split with a space character ... This is BAD for cygwin, a *nix like environment. A space, in *nix, is a delimiter ... in WINDOWS, we have got used to big paths, with spaces, like -
C:\Documents and Settings\user name.machine name
which is the folder where 'My Documents' points ... These spaces will cause grief in a *nix like environment, like cygwin is!

So the first thing is, to CHANGE, or choose a ONEWORD user name, obviously still with administrator privileges ... BEFORE you install cygwin into your system ... luckily, this is easy through the control panel, user accounts ... and such a change, does NOT seem to effect 'My Documents' ...

It is possible to change this AFTER-THE-FACT, but there are lots of MANUAL steps involved ... the cygwin FAQ at - http://cygwin.com/faq.html - touches on this - "11. My Windows logon name has a space in it, will this cause problems?" It goes on to immediate state "Most definitely yes! ...", and gives help on how to change this ...

Windows Stability - Error Exit:

Many of you, who have been following windows evolution, will have had problems during a windows SHUTDOWN ... In some of my older systems, particularly with Windows 98, the one I am most familiar with, my ONLY real shutdown, in some systems, was to hold the power button down for more than 5 seconds ... that is, CUT THE POWER ... ;=/

You may have been pleased that the latest incarnation, Windows XP SP2, seemed to have SOLVED much of this problem ... but, TAKE CARE, some of this can return with cygwin installed ... Thankfully, not so far, as DRASTIC as cutting the power, but sometimes now, on exit, I must click on this or that ERROR dialog, to achieve a full shutdown ...

So while entering the world of cygwin, you gain a FREE entry into a *nix simulation, in a windows system, and all the facilities, utilities that brings, be aware that there are some COSTS ... as a fellow programmer, I am SURE the dedicated, and knowledgeable programmer group of cygwin are working on such 'problems', and will solve it in the course of time ... but you must knowingly choose this path ...

Thankfully, this error does not actually appear often ... it appears it depends on what actions I have taken while in the shell before logging out ... to date, it has only happened 2 or 3 times, but it was a shock each time, since I was beginning to trust Windows to politely shut down when requested ;=)) It seems I am leaving certain processes running, in the background, like vim, but unsure how to stop them ... could use $ kill PID if I knew the process number ... getting there though!!!

Ok, the command $ ps -a will list all the cygwin running processes ... actually $ ps -W will list ALL the processes running in the system - a big, confusing, list ... It seems important that if you have started a process, that is still running in the background, a $ logout, which closes the cygwin shell window, does NOT necessarily 'kill' all such processes, and if you then exit windows, that is close down the machine, that process can cause this error! Simple solution, but takes time to understand the process ;=))

Before $ logout, if a $ ps -a lists MORE than the 'bash' shell, and 'ps' itself, then you can have a windows error exit on full shutdown! Stands to reason ... be aware ...

Version Numbers:

If you ever thought windows was PLAGUED with ever changing versions of DLL's, libraries, software, then get over it - I can only describe the *nix world as WORSE ... EVERY LITTLE PIECE OF SOFTWARE INVOLVED HAS A VERSION ... some will work, and some will NOT ...

This includes the components necessary to run FlightGear ... you will read in the above mentioned cygwin guide WHICH VERSION to install ... read this carefully ... just installing the latest, which in the *nix world might be described as the 'development' version, will NOT do ... ;=))

Take OpenAL - you must download this binary for FlightGear 0.9.8, but a different binary for FlightGear 0.9-plus - sometimes, as in this case, this is just exactly where the library will be installed ... or take PLIB - to be able to compile and install it using cygwin, you must choose the plib-1.8.4 tar ball, and NOT the latest 'development' version from a CVS download ... while most of the time, the LATEST will be ok, there are times you MUST download a SPECIFIC, older version ... sometimes referred to as the 'stable' version ...

In windows, I had become used to, even like, CVS - Concurrent Versions System - After an initial big download of each of the project sources, it has a simple interface to UPDATE that source a regular intervals ... by changing into the original download folder of project, a simple command, 'cvs up -dP', would compare the local files with those currently online, and just download the difference - FAST and EFFICIENT ...

PLIB thus provided my first understanding as to how VERSION SPECIFIC cygwin can be. I was easily able to CVS update my PLIB, and use Microsoft Visual Studio, MSVC7.1, to compile, and install the LATEST. But try as I might, I could NOT get this so called 'development' version to compile and install under cygwin ... I had NO PROBLEM downloading the plib-1.8.4.tar.gz tar ball, the latest 'stable' version, and compiling, and installing this under cygwin ...

Maybe it is just that I do not yet fully understand the ./autogen.sh step, which creates the 'configure' script, the ./configure step, which creates the 'makefile' set, and the make, and make install steps, which reads and processes the generated 'Makefile' set, the utilities provided and used under cygwin ...

For those who understand the 'Makefile' format, for some reason the 'configure' file generates by the autogen utility, wrote a Makefile which contains lines not associated to a 'target:', and thus the make utility would abort, where as, in the 'stable' version, a 'configure' script was provided, thus the ./autogen.sh step was skipped, and the 'Makefile' set were correctly generated ... It is clear this problem is related to the "EXTRA_DIST = ..." items in the Makefile.am ...

Just be warned, the VERSION is IMPORTANT ... Of course, I eventually hope I will 'understand' what went wrong with my attempt at compiling the CVS version of PLIB ... it may be as simple as some missing parameter that I need to feed in at some point ... but for now, I am extra specially CAREFUL of the VERSION I am using ...

Delete Key is NOT delete:

If you are used to using the Delete key for deletion, at least in the shell, it is NOT delete! Thankfully, Backspace deletion still works ;=)) Given the high configurability of *nix, and thus perhaps the cygwin environment, maybe it is probably possible to re-map the key back to the delete function. In my system the Delete key produces the '~' character, which, as you may know, has the special meaning of HOME, in this 'funny' world ...

No Right Mouse Button Context Menu:

If you have ever found the right mouse button context menu useful, then forget it, in the cygwin shell window. No context menu appears! I had gotten used to using it for mark, copy and paste in the command prompt window, but had to revert to using the system button, then down to edit, then choosing the action. Just a matter of re-training the hand and mind ...

Of course, this is a DEFAULT action of the shell window created ... If you click on the top left system menu icon, and choose 'Properties' ... then, in the '"cygwin" Properties' dialog that opens, if you select the 'Options' tab, and check, in the 'Edit Options' section, the item 'Quick Edit Mode', and click OK, you can use the left mouse button to 'select' any text in the shell window, and after selection, the <Enter> key will copy the selected text to the clipboard, and then you can 'paste' it to other applications ... 

Also note, once this 'Quick Edit Mode' mode is selected, and on 'Ok', selection of the radio button 'Modify shortcut that started this window', a right mouse click will 'paste' the clipboard text contents to the shell windows, with whatever consequences that brings ;=)) be careful the 'clipboard' does NOT contain, say 'rm -r /*', or some such, very destructive, iterative, shell command ...

Width of Bash Shell Prompt Window:

When the cygwin opened, after double clicking on the cygwin ICON on the desktop, the width of the window is one or two characters too small, thus a bottom scroll bar is established. Clicking, and dragging wider, on the right side of the window, removes this bottom scroll bar. Maybe there is a way to alter the process that establishes this window, to fully correctly open with this new size ...

By clicking on the top left system icon, and opening 'Properties', and selecting the 'Layout' tab, I note the Screen Width value is 113 ... I altered this to 114, and on clicking OK, selecting the radio button 'Modify the shortcut that started this window' ... now when I establish the window, using the desktop icon, there is no bottom scroll bar ... it is all easy stuff ... if you know a bit of stuff ;=))

Missing Integrated Development Environment (IDE):

I suppose some would argue that unix itself IS an 'integrated development environment' ;=)) but what I miss is an application that 'knows' all the source files in any particular project, sports a fancy, colour code editor, with auto-indenting, has dynamic class, structures, and system call help, compiles, runs and allows debugging of the project, all from the same application - here I refer to Visual Studio ... so far, I have discovered 3 editors - vim, nano and emacs ... but there are probably MORE ;=))

That is probably where I should start next - create a small console application, within the cygwin folders, and then see if I can compile it using all the *nix tools ... lots of work to try to sort out what has to be HANDCRAFTED, and what can be automatically GENERATED ... some successes, but mainly FAILURE ... try another day ...

TO BE CONTINUED, as I tread further into this world of 'simulated' unix, cygwin, on a windows XP system ... As mentioned, by latest effort - FlightGear build with cygwin, June 2006, ran well ...

EOF - fgfs-019.htm

index

Valid HTML 4.01 Transitional