Board index FlightGear Support Compiling

Help needed in compiling FlightGear

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

Help needed in compiling FlightGear

Postby fypstud » Wed Sep 22, 2010 5:54 am

Hi everyone!!

Just want to do a simple introduction of myself before I elaborate on my problem. I am currently doing my Final Year Project at my university. The main idea of the project is to incorporate wind shear conditions into Flight Gear for future pilot training and what not. Thing is, I am very very new to Flight Gear and worst still, my prof found me a Mac for this project though I have been a windows user almost all my life (but I do love Apple).

In any case, I am having difficulties building Flight Gear on Mac, I tried following the instructions given on the site and ran download.sh on Terminal but it keeps indicating that there is problems downloading the simgear component.

So I tried an alternative route to download SimGear 2.0.0 myself (since I download the latest Flight Gear 2.0.0), which I did, i figured I should just copy the files into the trunk folder?

Am I doing anything wrong so far?
Subsequently I tried to run patch.sh but when they asked me what files to patch, I am clueless.

Really hope someone can help me out here, feeling a little panicky coz I am not progressing much with my project and I only have less than half a year to finish the entire writing and testing of the code.

PLEASE HELP!!! :(
fypstud
 
Posts: 12
Joined: Wed Sep 22, 2010 5:43 am

Re: Help needed in compiling FlightGear

Postby Hooray » Fri Sep 24, 2010 8:32 am

fypstud wrote:Hi everyone!!

Just want to do a simple introduction of myself before I elaborate on my problem. I am currently doing my Final Year Project at my university. The main idea of the project is to incorporate wind shear conditions into Flight Gear for future pilot training and what not. Thing is, I am very very new to Flight Gear and worst still, my prof found me a Mac for this project though I have been a windows user almost all my life (but I do love Apple).


FlightGear is cross platform software and known to work on Macs, too.
Regarding modeling of wind shear conditions, I would encourage you to check out the "Local Weather" project: http://wiki.flightgear.org/index.php/A_ ... her_system

This is basically being developed completely in scripting space.

In any case, I am having difficulties building Flight Gear on Mac, I tried following the instructions given on the site and ran download.sh on Terminal but it keeps indicating that there is problems downloading the simgear component.

download.sh? What instructions exactly did you follow?

Really hope someone can help me out here, feeling a little panicky coz I am not progressing much with my project and I only have less than half a year to finish the entire writing and testing of the code.


I would seriously encourage you to check out the local weather project, it is being written in FlightGear's own scripting language called "Nasal": http://wiki.flightgear.org/index.php/Nasal_introduction

For people already familiar with C++ programming and concepts like OOP, Nasal is *very* easy to pick up.

It is very likely that many of things you need to do, can already be done in scripting space. For other things, one may need to enhance the FlightGear/Nasal APIs, i.e. the scripting interface. However this is very easy to do. This approach makes the whole task much more tangible.

If you have questions related to the local weather system, please see this thread: viewtopic.php?f=5&t=7358

PS: I would not even have looked at this thread, if the OSG build were not taking sooo long ;-)
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: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: Help needed in compiling FlightGear

Postby Torsten » Fri Sep 24, 2010 8:44 am

Hi and welcome to FlightGear,

there are various resources for installing and even compiling FlightGear on mac. Tat maintaines an excellent site at
http://macflightgear.sourceforge.net/home/
and he provides binaries from time to time.
We have a WIKI page containing instructions to compile FlightGear from GIT sources by yourself at
http://wiki.flightgear.org/index.php/FlightGear_Git_on_Mac_OS_X
which is the instruction, I followed to make my mac somewhat useful.
If you follow the instruction closely, you should have bleeding edge development on your machine within one day.
The code in GIT has a highly configurable environment system, which should help you a bit in your project.
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 632
Joined: Fri Feb 01, 2008 9:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Help needed in compiling FlightGear

Postby fypstud » Fri Sep 24, 2010 9:05 am

hey guys,

thanks for the suggestions! haven't got the chance to test them out yet though.

Hooray: I followed the instructions given on the flightgear site regarding building FlightGear using Mac. Just wanted to ask what is the difference between the Nasal scripting and from using Xcode which is C++ I presume?

Torsten: Thanks for the suggestion will definitely give that a try! :)
fypstud
 
Posts: 12
Joined: Wed Sep 22, 2010 5:43 am

Re: Help needed in compiling FlightGear

Postby Hooray » Fri Sep 24, 2010 10:25 am

fypstud wrote:Hooray: I followed the instructions given on the flightgear site regarding building FlightGear using Mac.

The wiki?
Just wanted to ask what is the difference between the Nasal scripting and from using Xcode which is C++ I presume?


"Nasal" is a "scripting language" (see wikipedia: scripting language), as such it is meant for extending an existing application, without requiring recompilation, or a working build environment. So you can basically open a text file in an editor and add instructions to it to change FlightGear behavior, or even to create completely new systems or applications WITHIN FlightGear.

C++ on the other hand it s programming language for creating programs that are compiled, this requires a working build environment (compiler, libraries etc).
FlightGear is written in C++ (and some C). FlightGear provides a way for allowing non c++ programmers to add code that is run WITHIN FlightGear. FlightGear on the other hand is run within your operating system. As such, FlightGear is the operating system for Nasal scripts. In other words, Nasal is a programming language that is relatively specific to FlightGear, especially the APIs provided by FG. C++ on the other hand is a general purpose programming language.

If you don't know C++ already, you will probably really want to look into Nasal.
If you do know C++ already, Nasal may still be an interesting option because it is a very high level programming language, C++ is a more low level language.
Anything that you create in C++ space requires a complete rebuild of the FG source code, Nasal scripts on the other hand are just plain text files that are stored in $FG_ROOT/Nasal - for making your changes take effect you only need to restart the simulator, no recompilation needed.

For the development of the local weather system, a hybrid approach is being used, the majority of the code is written in Nasal, while performance criticial parts are implemented in C++ space and made available to Nasal in the form of FlightGear specific extension functions.

These extension functions can then be called from Nasal scripts.
I encourage you to check out your $FG_ROOT/Nasal directory and see for yourself if you find the language intuitive or not: http://gitorious.org/fg/fgdata/trees/master/Nasal

All files with a *.nas extension are Nasal files.
The language itself is pretty well documented at the wiki, I posted the link already.

If you have Nasal specific questions, there is a dedicated Nasal sub forum: viewforum.php?f=30
We also have a development forum here: viewforum.php?f=18
Questions related to fgfs core development are handled through the developers mailing list: http://www.flightgear.org/mail.html

Basically, imagine the relationship between FlightGear and Nasal like the relationship between a browser (firefox) and JavaScript.

For more explanations, you may want to refer to this posting: viewtopic.php?f=18&t=8346&p=87037#p87037

Are you required to write your code in C++?
Or is it also acceptable to use other programming languages (Java, Python etc).
If you need to turn in your project as C++ source code, you will inevitably also need a working FG build environment.
However, using a combination of C++ and Nasal together is pretty powerful, as you'll see for yourself once you run the latest "local weather" code.

I am sure your wind shear project could be very interesting for fellow FlightGear users and developers.
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: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: Help needed in compiling FlightGear

Postby fypstud » Fri Sep 24, 2010 2:26 pm

Hooray: I'm not certain if I need to submit my work in C, will have to double check but I think the Nasal does sound pretty awesome, especially I don't need to recompile or even use Xcode, saves me some time learning the software, heh.

I've only done some C++ programming and VBA programming before this, so I am hoping I won't have too much problems understanding Nasal.

Once I've figured out how to build the FG environment, I will shift my queries to the thread you mentioned with regards to constructing my wind shear condtions :)

Oh by the way, I just wanted to ask if I would required administrator priviledges if I wanted to build FG? I have a feeling that's why I am not successful so far.
fypstud
 
Posts: 12
Joined: Wed Sep 22, 2010 5:43 am

Re: Help needed in compiling FlightGear

Postby Hooray » Fri Sep 24, 2010 2:41 pm

- C and C++ are two different programming languages (see wikipedia)
- FlightGear is mostly written in C++
- if you haven't had a lot of exposure to C++ so far, it is quite an undertaking to learn C++ AND get to know FlightGear, especially if you have to meet a deadline (even with 6 months time)
- Nasal is meant to be used by non programmer, it is for example used by many aircraft or scenery developers who have very little programming experience
- Nasal will not necessarily be suitable for everything, but it can surely be used for prototyping most things
- still, being able to build FG from source is good and useful, especially for using the latest development code
- there are things that you may at some point move into C++ space, e.g. due to performance reasons
- other things may currently only be possible in C++, because there is no API provided for the scripting language
- then, you'll need to be able to build FG from source for adding new APIs, i.e. for exposing internals to Nasal that are currently not exposed
- as Torsten mentioned already, there is now very useful code available in the development version that simplifies weather related projects like your's
- Nasal is easy to pick up for anybody familiar with C or C++, in fact anything that is "C like", Java or even JavaScript experience would also be useful
- Nasal is largely ECMAscript oriented, so it is really pretty close to JavaScript from a syntax point of view
- the wiki contains lots of documentation (or links) on Nasal, the forum is also a good place for getting started
- Nasal really is a very powerful tool for prototyping things, still you may want to move some parts into C++ later on
- we are seeing this in the local weather system at the moment, which is largely implemented in Nasal, but which can benefit from C++ additions
- so being able to build FG from source is also useful for testing patches
- no, you should normally not need admin privileges for building FG, only for installing dependencies in a system-wide location, obviously
- once you start your project, you'll probably want to clone the official repository and maintain your work over at gitorious: http://gitorious.org/fg
- you can get a lot of good help from fellow FG users and developers
- regardless of the programming languages being used, you'll probably need to come up with a mathematical/physical model for wind shear
- this sort of content can be easily maintained using the wiki: http://wiki.flightgear.org
- the local weather system development was also spawned by a forum discussion and a corresponding wiki page
- you will probably want to really look into the local weather code to see if and how it could be leveraged/adjusted for your own needs
- the local weather system is meanwhile a pretty well commented piece of code, and has also very extensive developer documentation: http://www.phy.duke.edu/~trenk/files/RE ... ather.html
- apart from that, if you haven't had a lot of previous exposure to C++, it is possible that you are expected to complete your assignment using Matlab/Simulink!?
- if your professor hesitates regarding Nasal use for your FYP, let him know that you won't be able to do all of your project in Nasal, a feature such as wind shear will definitely require additions to the C++ source code at some point, even if it's just for the sake of improving runtime performance.

One of the most important (and also most powerful) concepts when working with FlightGear is the so called "property tree", which is a built-in tree representation of runtime state variables that can be easily accessed and modified dynamically. There are hundreds of variables exposed using this "property tree", andit is VERY easy to expose additional ones, too.

You will want to check out $FG_ROOT/README.introduction, README.properties and README.xmlsyntax
Also see: http://wiki.flightgear.org/index.php/Property_tree

The property tree can be inspected at runtime, using the built-in "property browser", as well as external tools like a web browser or telnet client.

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: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: Help needed in compiling FlightGear

Postby fypstud » Tue Sep 28, 2010 2:06 am

Thanks for the information on Nasal, I will definitely be working with that for my project if it is easier to pick up like you guys said. Checked with my prof and he is okay with alternate scripting languages.

BUT! I still have problems with my first time building of FlightGear

I followed the instructions on : http://macflightgear.sourceforge.net/ho ... -unix-way/

Installed Git 1.7.2.3 and cmake 2.8.2 before I ran the download.sh and patch.sh, everything went well till I had to run build.sh and got these error messages

Building OpenSceneGraph ver. 2.9.8...
~/Desktop/trunk/OpenSceneGraph ~/Desktop/trunk
Building OSG frameworks using cmake...
Error: OSG is capable of building frameworks, but you don't have cmake installed. Please install cmake first!
~/Desktop/trunk/SimGear/SimGear ~/Desktop/trunk
Host info: Darwin i386
-n automake: 1.10
(110)


Continued for a while more before this appeared

You *must* have the OpenThreads library installed on your system
to build this version of SimGear!
Maybe you need to specify --with-osg=DIR.
Maybe you need to specify some LDFLAGS to help the linker.

LIBS: ''
LDFLAGS: ''
CPPFLAGS: ' -I/Users/deborah/Desktop/trunk/boost_1_41_0/include -F/Library/Frameworks -F/Users/deborah/Desktop/trunk/build/OpenSceneGraph'

Please see README.OSG for more details.


any idea what is going on?

Hooray: Do I still need to know how to build the FG environment even if I were to work with Nasal coz this building process is taking forever...zzz...
fypstud
 
Posts: 12
Joined: Wed Sep 22, 2010 5:43 am

Re: Help needed in compiling FlightGear

Postby Hooray » Sun Oct 03, 2010 6:23 pm

fypstud wrote:Hooray: Do I still need to know how to build the FG environment even if I were to work with Nasal coz this building process is taking forever...zzz...


Being able to build FG from source is a very good thing and idea, especially for any educational/projects that could leverage experimental/recent developments.

As previously mentioned already, there are some very useful features in git that would seem to be pretty instrumental ...
I would suggest to start a new thread detailing your build problems, most of this seems to be related to cmake/OSG.

I think it should be fairly easy to get these things sorted, you may need to install some packages.

Once you'll take a look at the local weather system and the corresponding source code, you'll see that there is a lot that can be done in Nasal, but at some point it will probably be a significant advantage to be able to build FG yourself, like I mentioned previously - it could be very helpful to expose additional FG internals, so that you can access those from Nasal scripts. There is a wiki article somewhere detailing the exact steps needed for adding new commands, it's a pretty straightforward procedure. And there are other users who can provide help.

So, I would suggest to start a new thread for getting help with building FG and all its dependencies from source, while it's not necessarily always straightforward to do, it's definitely a worthwhile thing ... It may normally take about one day or maybe a weekend to get everything set up and configured properly. But once this has been done, it's easy to reuse everything and simply update and rebuild FG and all its dependencies within 2-3 minutes.
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: 11309
Joined: Tue Mar 25, 2008 8:40 am


Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest