Difference between revisions of "FlightGear Git on Mac OS X"

From FlightGear wiki
Jump to: navigation, search
(XCode 3.2.2 on OSX10.6.4(x86_64))
(Git SimGear/FlightGear/fgdata: Switched to {{flightgear clone}}, {{simgear clone}}, and {{fgdata clone}}.)
 
(124 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{stub}}
 
 
{{FlightGearGitOn}}
 
{{FlightGearGitOn}}
 +
 
== Please read this, important! ==
 
== 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.5or 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 ;-) <span style="color:#FF0000">'''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
+
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 ;-) <span style="color:#FF0000">'''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://forum.flightgear.org/viewtopic.php?f=21&t=14175
 
'''
 
'''
 +
 +
== Before you start, move other installs out of system root ==
 +
The build system for FlightGear changed 2011 to cmake. When you want to follow this wiki and get a new clean install you should remove all former installs of plib, PLIB.Framework, OpenSceneGraph, simgear and flightgear. Depending on location where you installed FlightGear GIT version (NOT MacFlightGear!), you have to remove a lot of stuff i.e. in /usr/include, /usr/lib, /usr/local/lib, /usr/local/include etc. (depends where you installed before, but default is /usr/local/...). It is probably better NOT TO DELETE this stuff, keep the content in a safe place, but out of system root.
  
 
== Default installing locations ==
 
== 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.
+
This guide installs the software with default paths on your system, in /usr and /usr/local. '''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 ==
 
== Requirements ==
System Requirements: OSX 10.5.8 (Leopard) or higher, and an Intel Mac. (PPC may work using the same instructions)
+
System Requirements: OSX 10.5.8 (Leopard) or higher, and an Intel Mac.
Other requirements: Basic knowledge of using Terminal on OSX, Xcode Dev Tools 3.1.4, MacPorts 1.8.2
+
Other requirements: Basic knowledge of using Terminal on OSX, Xcode Dev Tools
 
  You are going to install:
 
  You are going to install:
  Xcode Dev Tools, MacPorts, boost, cmake, plib, ALUT.framework, OpenSceneGraph, git, SimGear and finally FlightGear
+
  Xcode Dev Tools, boost, cmake, plib, OpenSceneGraph, git, SimGear and finally FlightGear
  
 
'''This action will take more than 2 hours!'''
 
'''This action will take more than 2 hours!'''
 +
Update December 2014 with newer Macs this now compiles usualy under 1 hour.
  
 
== Install ==
 
== Install ==
  
 
=== Install Xcode Developer Tools ===
 
=== Install Xcode Developer Tools ===
Download and install Xcode Tools for OSX (for OSX 10.5.8 you need Dev Tools 3.1.4).<BR>
+
Download and install Xcode Dev Tools for OSX<br />
[http://developer.apple.com/technologies/xcode.html http://developer.apple.com/technologies/xcode.html]<BR>
+
for OSX 10.5.8 (i386) you can use Tools 3.1.4 [http://meandmark.com/blog/2009/10/downloading-older-versions-of-xcode How to get older dev tools versions]<br />
'''Note:''' for OSX 10.6.4 (x86_64) you need Dev Tools (XCode) 3.2.2<br>
+
for OSX 10.6 (i386, x86_64) you can use Dev Tools 3.2.6<br />
--[[User:T3r|T3r]] 10:03, 4 July 2010 (UTC)
+
[http://developer.apple.com/technologies/xcode.html http://developer.apple.com/technologies/xcode.html]
 +
Newer Xcode 4.0 is free but is installed with Apple's appstore now. When you want to install flightgear with SDK 10.5 and target 10.5 you need Dev Tools/Xcode <= 3.2.6
  
 
=== Download and Install GIT ===
 
=== Download and Install GIT ===
Download and install GIT for OSX. Grab the latest version from Google Code:
+
Download and install GIT for OSX. Grab the latest version from
[http://code.google.com/p/git-osx-installer/ http://code.google.com/p/git-osx-installer/]
+
[http://code.google.com/p/git-osx-installer/ http://code.google.com/p/git-osx-installer/]
  
=== Install MacPorts ===  
+
=== Install ''ICU'' and ''boost'' ===
Download and install [http://www.macports.org/install.php MacPorts 1.8.2]<BR>
+
Download ICU source from here
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.
+
http://site.icu-project.org/download
 +
then
 +
cd icu/source
 +
chmod +x runConfigureICU configure install-sh
 +
./runConfigureICU MacOSX
 +
make
 +
sudo make install
  
=== Update MacPorts ===
+
Download recent boost from here:
In terminal type
+
http://www.boost.org/users/download/  
sudo port selfupdate
+
CD into the boost directory , run:
sudo port upgrade outdated
+
./bootstrap.sh --with-python=/usr/bin/python
When you run into problems with synchronizing go here: http://trac.macports.org/wiki/howto/SyncingWithSVN
+
sudo ./bjam architecture=combined address-model=32_64 install
  
=== Install ''boost'' (1.42.0) with MacPorts ===
+
Note: this step can take more than 1 hour! Boost is made for drinking more tea.
sudo port install boost
+
Note: this step can take more than 30 minutes! Boost is made for drinking more tea.
+
  
=== Install ''cmake'' (2.8.1) with MacPorts ===
+
=== Install ''cmake'' ===
sudo port install cmake
+
Download and install cmake from here:
 +
http://www.cmake.org/cmake/resources/software.html
  
=== Install '''plib''' (1.8.5) with MacPorts ===
+
When you want to compile against SDK 10.5 and target 10.5 you will need the
sudo port install plib
+
"Mac OSX 32-bit Universal (for Intel or PPC, Tiger/10.4 or later)" version.
  
=== Install the ALUT.framework ===
+
=== Install '''plib''' (1.8.5/trunk) ===
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).
+
Checkout plib trunk with:
Download here '''(temporary location!)''': [[http://files.goneabitbursar.com/fg/alut-osx-universal.zip]]<BR>
+
svn checkout https://plib.svn.sourceforge.net/svnroot/plib/trunk
Unzip and move the ALUT.framework folder to /Library/Frameworks
+
Then run (for target OSX 10.9/i386 i.e.):
 
+
./autogen
=== Download and install OpenSceneGraph 2.9.7 ===
+
./configure --disable-pw --disable-sl --disable-psl --disable-ssg --disable-ssgaux \
Checkout OpenSceneGraph source with
+
--prefix=/usr/local CXXFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ \
  svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.9.7 OpenSceneGraph<BR>
+
  -mmacosx-version-min=10.9" CFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ \
cd to the new directory and type
+
  -mmacosx-version-min=10.9"
  ./configure
+
and finally:
make
+
 
  sudo make install
 
  sudo make install
  
'''Remark:''' OSG-2.9.7 did not compile for X86_64, so I used
+
=== Download and install OpenSceneGraph trunk ===
svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk OpenSceneGraph
+
--[[User:T3r|T3r]] 21:08, 27 June 2010 (UTC)
+
  
=== Git SimGear/FlightGear/fgdata ===
+
Checkout OpenSceneGraph trunk with
Create a directory where you want to place your new FlightGear code.
+
{{#tag:syntaxhighlight
git clone git://gitorious.org/fg/flightgear.git
+
|{{openscenegraph co|post=OpenSceneGraph}}
git clone git://gitorious.org/fg/simgear.git
+
| lang = "sh"
git clone git://mapserver.flightgear.org/fgdata/
+
}}
  
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. When you run into problem Last but not least there is also another GIT repo for months: http://mapserver.flightgear.org/git/.
+
Make a copy of the "OpenSceneGraph" folder you get, maybe you need a fresh clone again when it fails.
  
'''Plase note:''' Gitorious apparently can't handle the initial <tt>git clone</tt>. Please, clone from mapserver and pull (update) from Gitorious:
+
cd OpenSceneGraph
  
  git pull git://gitorious.org/fg/fgdata.git
+
  mkdir build && cd build
 +
 
 +
For compiling with imageio/'''cocoa''', target architecture '''i386 AND x86_64''':
 +
cmake .  -G Xcode -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
 +
-DCMAKE_OSX_SYSROOT='''/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/''' -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
 +
-DCMAKE_OSX_DEPLOYMENT_TARGET='''10.9''' -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF \
 +
-DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
 +
-DOSG_WINDOWING_SYSTEM=Cocoa -DJASPER_LIBRARY= -DOSG_USE_QT=0 -Wno-dev
 +
 
 +
Finally:
 +
  xcodebuild -target ALL_BUILD -configuration Release
 +
  sudo xcodebuild -target install -configuration Release
 +
 
 +
'''Remarks:''' Compiling OpenSceneGraph often takes more than 30 minutes.
 +
 
 +
=== Git SimGear/FlightGear/fgdata ===
 +
Create a directory where you want to place your new FlightGear code.
 +
{{#tag:syntaxhighlight
 +
|
 +
{{flightgear clone}}
 +
{{simgear clone}}
 +
{{fgdata clone}}
 +
| lang = "sh"
 +
}}
 +
 
 +
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 GIT Repos.
  
 
=== Install SimGear ===
 
=== Install SimGear ===
cd to the directory and type
+
cd to the simgear directory and type
./autogen.sh
+
./configure
+
make
+
sudo make install
+
  
'''Remark:''' My plib went into /opt/local, so I used
+
  cmake . -G Xcode -DENABLE_TESTS=1 -DENABLE_RTI=0 -DCMAKE_OSX_ARCHITECTURES="i386" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
./configure --with-plib=/opt/local
+
  -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ \
for SimGear
+
  -DJPEG_FACTORY=0 -DCMAKE_INSTALL_PREFIX=/usr/local
 +
 
 +
  xcodebuild -target ALL_BUILD -configuration Release
 +
  sudo xcodebuild -target install -configuration Release
  
 
=== Install FlightGear ===
 
=== Install FlightGear ===
./autogen.sh
+
cd to the flightgear directory and type
./configure
+
make
+
sudo make install
+
  
=== Finish and Testrun ===
+
  cmake . -G Xcode -DENABLE_TESTS=1 -DENABLE_RTI=0 -DCMAKE_OSX_ARCHITECTURES="i386" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9  \
 +
  -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ \
 +
  -DJPEG_FACTORY=0 -DCMAKE_INSTALL_PREFIX=/usr/local \
 +
 
 +
  xcodebuild -target ALL_BUILD -configuration Release
 +
  sudo xcodebuild -target install -configuration Release
  
Testrun of FlightGear via terminal, first export FG_ROOT to the fgdata folder
 
  
export FG_ROOT=/Users/joe/where/is/my/fgdata
+
=== Using Xcode for compilation ===
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''
+
Open the created .xcodeproj files and build it using ⌘ + B or choosing the menu Product=>Build. You may need to set the build target "ALL_BUILD>My Mac 64-bit" or what ever your target is and the configuration in the menu Product=>"Edit Scheme" where you can set the build configuration to "Debug" or "Release" under the "Run" tab. Once successfully compiled you need to install the build on the terminal since the standard target location of the files need root privileges. So change directory to your osg, simgear or flightgear git directory containing the .xcodeproj file and execute the command "sudo xcodebuild -target install -configuration Release". The -configuration depends on what you last built usually Release though. Choose -target uninstall to uninstall all related files.
 +
 
 +
=== Notes
 +
Check that you are using the proper versions of OSG and simgear with flightgear. Use git checkout to get the correct version. You can list them with the "git tag" command.
 +
Some problems occure when compiling speex when you have an installed a version in /opt/local/include/speex that is not compatible with the current used in fg. One solution is to change the <speex/...h> to \"speex/...h\" to pickup the local files delivered with the fg git repository.
 +
 +
=== Finish and Testrun ===
  
 +
You can use ''fgfs --fg-root=/path/to/fgdata'' and ''--fg-scenery=/path/to/scenery''
 
  fgfs --option1 --option2 ...
 
  fgfs --option1 --option2 ...
 +
type in terminal "fgfs --help -v" to get all current command line options
  
== Other resources ==
+
[[Category:Core developer documentation]]
Look here directly into OSX and FlightGear related compiling, configuration, terminal output, logs: '''James’ Hudson Server''' http://zakalawe.ath.cx:8080/
+
  
* GIT Magic [http://www-cs-students.stanford.edu/~blynn/gitmagic/ch03.html]
+
[[fr:FlightGear Git sur Mac OS X]]
 +
[[de:FlightGear Git on Mac OS X]]

Latest revision as of 17:21, 27 February 2016

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://forum.flightgear.org/viewtopic.php?f=21&t=14175

Before you start, move other installs out of system root

The build system for FlightGear changed 2011 to cmake. When you want to follow this wiki and get a new clean install you should remove all former installs of plib, PLIB.Framework, OpenSceneGraph, simgear and flightgear. Depending on location where you installed FlightGear GIT version (NOT MacFlightGear!), you have to remove a lot of stuff i.e. in /usr/include, /usr/lib, /usr/local/lib, /usr/local/include etc. (depends where you installed before, but default is /usr/local/...). It is probably better NOT TO DELETE this stuff, keep the content in a safe place, but out of system root.

Default installing locations

This guide installs the software with default paths on your system, in /usr and /usr/local. 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. Other requirements: Basic knowledge of using Terminal on OSX, Xcode Dev Tools

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

This action will take more than 2 hours! Update December 2014 with newer Macs this now compiles usualy under 1 hour.

Install

Install Xcode Developer Tools

Download and install Xcode Dev Tools for OSX
for OSX 10.5.8 (i386) you can use Tools 3.1.4 How to get older dev tools versions
for OSX 10.6 (i386, x86_64) you can use Dev Tools 3.2.6

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

Newer Xcode 4.0 is free but is installed with Apple's appstore now. When you want to install flightgear with SDK 10.5 and target 10.5 you need Dev Tools/Xcode <= 3.2.6

Download and Install GIT

Download and install GIT for OSX. Grab the latest version from

http://code.google.com/p/git-osx-installer/

Install ICU and boost

Download ICU source from here http://site.icu-project.org/download then

cd icu/source
chmod +x runConfigureICU configure install-sh
./runConfigureICU MacOSX
make
sudo make install

Download recent boost from here:

http://www.boost.org/users/download/ 

CD into the boost directory , run:

./bootstrap.sh --with-python=/usr/bin/python
sudo ./bjam architecture=combined address-model=32_64 install

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

Install cmake

Download and install cmake from here: http://www.cmake.org/cmake/resources/software.html

When you want to compile against SDK 10.5 and target 10.5 you will need the "Mac OSX 32-bit Universal (for Intel or PPC, Tiger/10.4 or later)" version.

Install plib (1.8.5/trunk)

Checkout plib trunk with:

svn checkout https://plib.svn.sourceforge.net/svnroot/plib/trunk

Then run (for target OSX 10.9/i386 i.e.):

./autogen
./configure --disable-pw --disable-sl --disable-psl --disable-ssg --disable-ssgaux \
--prefix=/usr/local CXXFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ \
-mmacosx-version-min=10.9" CFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ \
-mmacosx-version-min=10.9"

and finally:

sudo make install

Download and install OpenSceneGraph trunk

Checkout OpenSceneGraph trunk with

svn co http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk OpenSceneGraph

Make a copy of the "OpenSceneGraph" folder you get, maybe you need a fresh clone again when it fails.

cd OpenSceneGraph
mkdir build && cd build

For compiling with imageio/cocoa, target architecture i386 AND x86_64:

cmake .  -G Xcode -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF \
-DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
-DOSG_WINDOWING_SYSTEM=Cocoa -DJASPER_LIBRARY= -DOSG_USE_QT=0 -Wno-dev

Finally:

 xcodebuild -target ALL_BUILD -configuration Release
 sudo xcodebuild -target install -configuration Release

Remarks: Compiling OpenSceneGraph often takes more than 30 minutes.

Git SimGear/FlightGear/fgdata

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

git clone git://git.code.sf.net/p/flightgear/flightgear/
git clone git://git.code.sf.net/p/flightgear/simgear/
git clone git://git.code.sf.net/p/flightgear/fgdata/

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 GIT Repos.

Install SimGear

cd to the simgear directory and type

 cmake . -G Xcode -DENABLE_TESTS=1 -DENABLE_RTI=0 -DCMAKE_OSX_ARCHITECTURES="i386" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ \
 -DJPEG_FACTORY=0 -DCMAKE_INSTALL_PREFIX=/usr/local
 
 xcodebuild -target ALL_BUILD -configuration Release
 sudo xcodebuild -target install -configuration Release

Install FlightGear

cd to the flightgear directory and type

 cmake . -G Xcode -DENABLE_TESTS=1 -DENABLE_RTI=0 -DCMAKE_OSX_ARCHITECTURES="i386" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9  \
 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ \
 -DJPEG_FACTORY=0 -DCMAKE_INSTALL_PREFIX=/usr/local \
 
 xcodebuild -target ALL_BUILD -configuration Release
 sudo xcodebuild -target install -configuration Release


Using Xcode for compilation

Open the created .xcodeproj files and build it using ⌘ + B or choosing the menu Product=>Build. You may need to set the build target "ALL_BUILD>My Mac 64-bit" or what ever your target is and the configuration in the menu Product=>"Edit Scheme" where you can set the build configuration to "Debug" or "Release" under the "Run" tab. Once successfully compiled you need to install the build on the terminal since the standard target location of the files need root privileges. So change directory to your osg, simgear or flightgear git directory containing the .xcodeproj file and execute the command "sudo xcodebuild -target install -configuration Release". The -configuration depends on what you last built usually Release though. Choose -target uninstall to uninstall all related files.

=== Notes Check that you are using the proper versions of OSG and simgear with flightgear. Use git checkout to get the correct version. You can list them with the "git tag" command. Some problems occure when compiling speex when you have an installed a version in /opt/local/include/speex that is not compatible with the current used in fg. One solution is to change the <speex/...h> to \"speex/...h\" to pickup the local files delivered with the fg git repository.

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