FlightGear Git on Mac OS X

From FlightGear wiki
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. The difference is that the Nightly Build is an up to date code for the developers to ensure their latest changes are operable on it without problems for future releases. It is a way to have the most up to date code, yet not entire GIT items. But be aware that the build server itself or developers do not check for "flightgear bugs" in nightly builds, it is only checked if recent configuration and compilation of the source works, or not.

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

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 How to get older dev tools versions
for OSX 10.6 (x86_64) you can use Dev Tools 3.2.6

http://developer.apple.com/technologies/xcode.html
ipad 2 dock

Note that apple charges for version 4.0 and later and it is hard to find the links for older versions. However you can still use the required version for flightgear [3.2 or later] for free and you don’t need Dev Tools >= 4 How to get older dev tools versions

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

Download and Install GIT

There are different possibilities to install GIT.

Option 1: Download and install GIT for OSX. Grab the latest version from Google Code:
http://code.google.com/p/git-osx-installer/
Option 2: install via MacPorts in Terminal with "sudo port install git-core"

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)

For OSX 10.5.8 just install plib via MacPorts

sudo port install plib

For OSX 10.6.6 compile and install plib yourself

You need to compile plib yourself instead of macports usage. Download plib 1.8.5 source and after that apply this two patches to the source.
Got to folder plib and run configure and make with
./configure CXXFLAGS="-arch i386"
make
sudo make install

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

OSX 10.5.8/OSG 2.9.7: change directory to the new one and type

cd OpenSceneGraph
./configure
make
sudo make install

For OSX >= 10.6 checkout OpenSceneGraph OpenSceneGraph 2.9.9

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

OSX 10.6.6/OSG 2.9.9: change directory to the new one and type

cd OpenSceneGraph
./configure
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk -DCMAKE_OSX_ARCHITECTURES=i386 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5
sudo make install

Remark: Compiling OpenSceneGraph can take more than 30 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 4 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 (OSX 10.6.6: ./configure CXXFLAGS="-arch i386" CFLAGS="-arch i386")
make
sudo make install

Install FlightGear

./autogen.sh
./configure (OSX 10.6.6: ./configure CXXFLAGS="-arch i386" CFLAGS="-arch i386")
make
sudo make install

Finish and Testrun

You can use fgfs --fg-root=/path/to/fgdata and --fg-scenery=/path/to/scenery

fgfs --option1 --option2 ...
type in terminal "fgfs --help -v" to get all current command line options

Other resources