FlightGear Git on Mac OS X

From FlightGear wiki
Revision as of 12:06, 26 March 2011 by Liam (talk | contribs)
Jump to navigation Jump to search

Please read this, important!

This page is under heavy developement! It shows how you can probably succeed with installing your own FlightGear Developement Version on OSX 10.5 or 10.6, on a Intel-based Mac. This page is experimental and this building should not be used unless you know what you do with your computer. Keep in mind that installing developer versions of software can crash your computer ;-) Please do not start to mail to the FlightGear- or SimGear Devel-Mailinglist with FlightGear OSX installing problems related to this Wiki, ask your questions or report errors in the forum in postings/threads related to this page! --> http://www.flightgear.org/forums/viewtopic.php?f=21&t=8134

As an alternative to compiling the code manually, consider downloading a nightly build - assuming of course
that you aren't planning to hack on the source code.

Default installing locations

This guide installs the software with default paths on your system (MacPorts in /opt/local/ - other parts in /usr and /usr/local). There is only one framework (to be placed manually) in /Library/Frameworks. Use your own configuration options to get your preferred locations!. Do not post linking errors in the forum or the lists when you decide to use your own search paths.

Requirements

System Requirements: OSX 10.5.8 (Leopard) or higher, and an Intel Mac. (PPC may work using the same instructions) Other requirements: Basic knowledge of using Terminal on OSX, Xcode Dev Tools, MacPorts 1.8.2

You are going to install:
Xcode Dev Tools, MacPorts, boost, cmake, plib, ALUT.framework, OpenSceneGraph, git, SimGear and finally FlightGear

This action will take more than 2 hours!

Install

Install Xcode Developer Tools

Download and install Xcode Dev Tools for OSX
for OSX 10.5.8 you need Dev Tools 3.1.4
for OSX 10.6 (x86_64) you need Dev Tools 3.2.2

http://developer.apple.com/technologies/xcode.html

Note that apple charges for version 4.0 and later, however you can still use the required version for flightgear [3.2 or later] for free which should have a link on that same page.

Download and Install GIT

Download and install GIT for OSX. Grab the latest version from Google Code: http://code.google.com/p/git-osx-installer/

Install MacPorts

Download and install MacPorts 1.9.2
Note: With already installed MacPorts it could be a good idea to first decactivate all other ports for this whole guide. More information: http://guide.macports.org/#installing.macports.upgrade.

Update MacPorts

In terminal type

sudo port selfupdate

When you run into problems with synchronizing go here: http://trac.macports.org/wiki/howto/SyncingWithSVN

Install boost (1.45.0) with MacPorts

sudo port install boost 

Note: this step can take more than 30 minutes! Boost is made for drinking more tea.

Install cmake (2.8.4) with MacPorts

sudo port install cmake

Install plib (1.8.5) with MacPorts

sudo port install plib

Install the ALUT.framework

Note: This framework is provided by James T. This is not official! James posted this download link in the develist and the link to the framework can change. Linking to the OpenAL/alut.h header and compilation of official freealut fails on my OSX 10.5.8 with FlightGear, and there is also no port avaiable at the moment. Big thanks to James for providing this framework (universal). Download here (temporary location!): [1]
Unzip and move the ALUT.framework folder to /Library/Frameworks

Download and install OpenSceneGraph

For OSX <= 10.5.8 Checkout OpenSceneGraph 2.9.7 source with

svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.9.7 OpenSceneGraph

For OSX >= 10.6 and X86_64 checkout OpenSceneGraph OpenSceneGraph 2.9.9

svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.9.9 OpenSceneGraph

cd to the new directory and type

./configure
make
sudo make install

Remark: Making OpenSceneGraph takes > 45 minutes!

Git SimGear/FlightGear/fgdata

Create a directory where you want to place your new FlightGear code.

git clone git://gitorious.org/fg/flightgear.git
git clone git://gitorious.org/fg/simgear.git
git clone git://mapserver.flightgear.org/fgdata/ 
or git clone git://gitorious.org/fg/fgdata.git

The fgdata is about 2 GB! You can clone this repo once and later you use git pull. There is other page FlightGear and Git about using the FlightGear Gitorious GIT Repos. There is also an alternate GIT repo on mapserver.flightgear.org: http://mapserver.flightgear.org/git/.

Install SimGear

cd to the directory and type

./autogen.sh
./configure
*Remark: When SimGear does not find your MacPorts plib installation you might set path to /opt/local with
./configure --with-plib=/opt/local
make
sudo make install

Install FlightGear

./autogen.sh
./configure
make
sudo make install

Finish and Testrun

Testrun of FlightGear via terminal, first export FG_ROOT to the fgdata folder

export FG_ROOT=/Users/joe/where/is/my/fgdata 

or whereelse your /fgdata is located ;-) But of course you can also use --fg-root=/path/to/fgdata or --fg-scenery=/path/to/scenery with fgfs

fgfs --option1 --option2 ...

Other resources