Skip to main content

History: Building Ogre on Mac OS X (2013)

Source of version: 2

Copy to clipboard
            !Intro
This is an attempt to provide an up to date guide on how to build Ogre from scratch on a recent Mac platform. We will be using Xcode 4.6, and Mac OS X 10.7.5. Tested on a Mac mini 2011, if that matters.
The motivation for this guide was the result of general frustration of the difficulty of building Ogre the Mac platform.

For simplicity, directories will be created in the home directory, although that may not be generally desirable.

Because of my requirements (32 bit only third party library), we will build a static version for i386 only, although it should be easy to identify and tweak those options for your own use.

!!Building Boost for Ogre
Although not strictly necessary, Boost is nice for cross platform stuff, and I feel it makes me more productive. However, you sacrifice compile times and binary sizes.
Hopefully the negatives will eventually disappear in the future as compilers get better.
{CODE(wrap="1")}
# Download Boost on the official website, at the time this was written, it is 1.53.0
cd
tar -xjvpf ~/Downloads/boost_1_53_0.tar.bz2
mv boost_1_53_0 boost           # I chose to do this so I don't have to update directories every time in other projects

# install the b2 / bjam to ~/boost.build, this is like make and cmake, but for boost
cd boost/tools/build/v2
./booststrap.sh
mkdir ~/boost.build
(NOTE that ~ doesn't work below to specify home)
./b2 install --prefix=/home/USERNAME/boost.build

# make sure you are using the latest compilers, and they refer to the ones inside /Applications/Xcode.app
# this is important if you have Xcode 3 and Xcode 4 simulataneously installed
$ /usr/bin/g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

/usr/bin/clang --version
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

# building Boost
cd ~/boost
~/boost.build/bin/b2 --layout=versioned --build-type=minimal toolset=darwin link=static architecture=x86 address-model=32 stage
{CODE}
        

History

Information Version
Tue 15 of Jan, 2019 16:51 GMT-0000 paroj 6
Wed 27 of Feb, 2013 20:43 GMT-0000 kokonut All the instructions 5
Wed 27 of Feb, 2013 19:50 GMT-0000 kokonut 4
Wed 27 of Feb, 2013 19:43 GMT-0000 kokonut add CMake 3
Wed 27 of Feb, 2013 19:38 GMT-0000 kokonut Instructions for compiling Boost 2
Wed 27 of Feb, 2013 19:15 GMT-0000 kokonut initial commit with Intro 1