OSX Install ~ Mountain Lion

Louis Charette edited this page Oct 8, 2013 · 4 revisions

From source


As of Xcode5, Apple doesn't include gcc-4.2 in the command line tools. To successfully build APE on OSX, you need a copy of Xcode 4! You can find old version of Xcode and command line tools from Apple Developer center.

First steps

To install APE Server from source on OSX, you must install the latest version of XCode from the Mac App Store. Installing Xcode will allow you to easily install the necessary tools. Once Xcode is installed, goto Xcode -> Preferences -> Downloads and install the Command Line Tools.


Spidermonkey requires gcc-4.2 and g++-4.2 commands to compile, but Xcode install them simply as "gcc" and "g++". Run those two lines as root to create a symlink to the right files:

ln -s /usr/bin/gcc /usr/bin/gcc-4.2
ln -s /usr/bin/g++ /usr/bin/g++-4.2

MySQL Support

In order to enable MySQL support in APE Server, you first need to install the latest version of MySQL. You'll find a DMG package on the official MySQL website.

Once installed, you need to copy or link some libraries where MySAC will be able to find it. As root, do:

mkdir /usr/include/mysql/
ln -s /usr/local/mysql/include/* /usr/include/mysql
ln -s /usr/local/mysql/lib/libmysqlclient_r.* /usr/lib

You can omit these step if you don't wish to build Ape with MySQL support.

Compile APE

You should now be able to compile APE using ./build.sh command inside the APE Server source folder.

Note: If you get the fallowing error: ld: warning: ignoring file /usr/lib/libmysqlclient_r.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /usr/lib/libmysqlclient_r.dylib

You installed MySQL 32 bits on a 64 Bits system.

From binaries

For MySQL support, Ape requires the libmysqlclient_r.* libraries. First, copy dist/mysql_lib/* to /usr/local/mysql/lib/ or install MySQL using the DMG from the MySQL website. Run the same command as described in the MySQL Support section of this page.

Ape can then be run as usual using the ./aped command inside ./bin. If the library is missing, errors will be thrown and Ape won't be able to work.