Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 80 (modified by ahedges, 8 years ago) (diff)

macOS

TracNav(TracNav/TOC_Development)?

Here's how to get Orxonox up and running (compiling, currently you can't play the game) on macOS. It should build on anything from 10.8 (Mountain Lion) upwards (64-bit binaries for Intel processors only). The following procedure was tested on Mac OS X 10.12 (Sierra).

Current Status (as of December 5, 2016)

It should compile with LLVM/Clang on the supported OS versions. Just follow the directions in the following sections. The problem is that you can't play the game right now due to loader errors.

Currently the dependencies are updated to use the right c++ standard library and are built for the x86-64 platform. The problem is that currently the CEGUILuaScriptModule framework from CEGUI references it's symbols from the wrong library (it looks for tolua symbols in the lua dylib). This results in a run-time loader error at startup so you can't play the game right now. If you want to get it to run you have to compile the CEGUI dependencies yourself.

Nice To Know

Porting Orxonox to Mac OS X has taken very long now and it wouldn't have been possible without the help of the community (1337?, x3n?, Mozork? and many others). Although you can play Orxonox very well on the Mac, there is still a myriad of things that can and do go wrong - we'll be fixing those as we progress. One of the nicer new features is the addition of Cg shaders to Orxonox - maybe someone will manage to make a tutorial on that matter.

Prerequisites

Lets assume you have a more recent installation of OS X (i.e. whatever we support: ≥ 10.8). To get you started, we first need to set up your development environment:

  • Xcode (version 4.4 or higher) it's free.
  • Cmake (You need at least 2.8.4. Get the prebuilt dmg-Image for Mac OS X Cmake or a command-line version with Homebrew)

Source Files

Important Note: Currently, you CANNOT place your orxonox files on a path with white-spaces in it! Due to the fact that the entire Orxonox build structure will not tolerate whitespaces, we will not try to implement it at all. Sorry - you'll just have to build Orxonox in folders without spaces. ;-)

Once you have your Xcode set up, you need to check out the source files and the dependency package. There are two possibilities to get the source files, either via Xcode or by using subversion in the terminal (/Applications/Utilities/Terminal). To get the files via subversion in the terminal follow these directions Subversion, or enter the following into your Terminal (without the dollar sign!):

$ mkdir -p ~/Development/Orxonox
$ cd ~/Development/Orxonox
$ svn co https://svn.orxonox.net/game/code/trunk
$ svn co https://svn.orxonox.net/game/data/trunk data_extern
$ mkdir trunk/build

Xcode automatically integrates with our svn repo. Do a "Checkout" of code/trunk and data/trunk. That's it, you can quit Xcode once the downloads are done.

Dependencies

Orxonox has a pretty impressive list of dependencies and very few of them are pre-installed on our Macs. When building with cmake they are automatically downloaded. The following link is just for reference.

Dependency Package Version Size Notes
Mac OS X 3.0 23M Package for anything beyond kicklib2

Building the dependencies on your own

For the suicidal ones, here's the dependency list, if you want to compile them yourself (files are preferentially dynamically linked): Please note though: Apple uses an "install name" for its libraries. Follow the CocoaDev guide to set these install names appropriately: Application Linking. You can find a little help at Dependencies for Mac OS X.

Library name Minimum Version Recommended Version Notes
OGRE 3D Graphics Engine 1.4 1.8.2
CEGUI (Crazy Eddie's GUI System) 0.5 0.7.9 We need: CEGUI.framework, CEGUILuaScriptModule.framework and ceguitolua++.framework. Plus, disable all ppc architectures
Boost libraries 1.35 1.49 Hint: Use MacPorts
Lua (scripting language) 5.0 or 5.1 5.1.4 Hint: Use the patchfile located in the Tools directory of the dependency package. ($patch -p1 -i patchfile) inside source dir. But preferentially use the Lua version shipped with CEGUI
Tcl (shell script language) 8.4 or 8.5 - Use Apple system version
OpenAL (audio) (not yet specified) - Use Apple system version
ALUT (audio) (not yet specified) - Can't be compiled on Apple. Use the package included in dependency package or consult Flight Gear. Sadly, I do not know how they compiled this framework.
LibOgg (not yet specified) 1.2.1
LibVorbis (not yet specified) 1.3.2
LibVorbisFile (not yet specified) 1.3.2 Comes with LibVorbis
ZLib (compression) (not yet specified) - Use Apple system version

LLVM/Clang (the default Xcode compiler) uses a different standard c++ library than gcc (libc++ instead of libstdc++, they are not binary compatible). So make sure that all dependencies are linking against libc++.

Apple Mac OS X uses the following library paths:

  • /usr
  • /usr/local
  • /opt/local (MacPorts source distribution: MacPorts)
  • /sw (Fink binary distribution: Fink)
  • /Library/Frameworks (for Apple frameworks; dynamically linked and self-contained structures. See CFBundles for information.)
  • ~/Library/Frameworks
  • /System/Library/Frameworks
  • /Developer/Library/Frameworks

Building Orxonox

If you choose to use the Cmake gui to build it, fire up Cmake and choose your source and build directories (if you followed the tutorial to the point its ~/Development/Orxonox/trunk for the source directory and ~/Development/Orxonox/trunk/build for the build directory). Click "Configure" and choose either Xcode or Makefiles as build mode, whichever suits your preferences. Once you have everything in place, check the correct locations and then click "Configure", followed by "Generate". With the CLI Cmake simply type:

cd build
cmake .. -G Xcode # or without "-G Xcode" if you want makefiles.

In case you're using Makefiles as build mode, you can just follow the normal steps to compile Orxonox: Buildsystem. Otherwise switch to Xcode, open up the "Orxonox.xcodeproj" file inside your build directory and hit "Run".

Playing Orxonox

I'll assume you have done the appropriate of the above sections. Run Orxonox by double-clicking on the Orxonox.app in the build directory.

Debugging Orxonox

Apple includes its own crash reporter that collects the call stack and additional information upon the crashing of an application.