# Installing Mac OS X Third-Party Development Software

Need docs for unix and windows.
Include docs for downloading and installing XCode from Apple.

# Version Control System

## Subversion

Requirements:

None.

Installation:

Download and run the Subversion installer for OS X via http://devolab.cse.msu.edu/subversion-client-1.1.3.dmg

Where things are installed:

Java libraries into `/System/Library/Frameworks/JavaVM.framework`.
Everything else into `/usr/local`.

Usage:

Basic instructions for use with Avida can be found on the Devolab's web site.

That link looks temporary. When it breaks, ask David for the new link.

Read more detailed instructions at red-bean.com's online Subversion pages.

# Build System

## CMake

Requirements:

None.

Installation:

Download and run the CMake installer for OS X via http://www.cmake.org/files/v2.0/cmake-2.0.5-osx.dmg

Where things are installed:

Everything into `/usr/local`.

Usage:

Basic instructions for use with Avida can be found in the file "`README`" in the top-level Avida source code directory. Read more detailed instructions at CMake's online documentation pages.

# Avida-Ed interactive GUI requirements

## GNU Readline (optional but recommended)

What is it?

The GNU Readline library provides command-line editing, tab-completion, and history capabilities not strictly required by the Avida-Ed GUI; but they're useful when developing Avida-Ed using its interactive version.

Requirements:

None.

Installation:

Download and unpack the GNU Readline source archive http://www.hmug.org/pub/MacOS_X/BSD/Libraries/System/readline/readline-5.0-2-osx3.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://www.hmug.org/pub/MacOS_X/BSD/Libraries/System/readline/readline-5.0-2-osx3.tar.gz`
`$ tar xvfz readline-5.0-2-osx3.tar.gz`

Configure, build, and install (beneath `/usr/local`, automatically):

`$ cd readline-5.0`
`$ mkdir build`
`$ cd build`
`$ ../configure`
`$ make`
`$ sudo make install`

Where it installs:

Everything into `/usr/local`.

## Python

What is it?

Python is an interpreted, interactive, object-oriented programming language. It permits rapid experimentation with and design of new parts of the Avida-Ed GUI without recompilation of c++ parts of Avida. Our Python code is then embedded in the double-clickable Avida-Ed application, along with a Python interpreter, and is run when Avida-Ed is launched.

Requirements:

Readline is suggested but not required. Using the Python interpreter without Readline's command-line editing, tab-completion, and history is pretty tedious. There are no other requirements.

Installation:

Download and unpack the Python source archive http://www.python.org/ftp/python/2.4/Python-2.4.tgz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://www.python.org/ftp/python/2.4/Python-2.4.tgz`
`$ tar xvfz Python-2.4.tgz`

Configure, build, and install the OS X Framework version of Python:

`$ cd Python-2.4`
`$ mkdir build`
`$ cd build`
`$ ../configure --enable-framework`
`$ sudo make frameworkinstall`
`$ sudo make frameworkinstallextras`

Where things are installed:

A version-2.4 Python Framework is installed at `/Library/Frameworks/Python.framework`, distinct from the built-in default version-2.3 Python Framework `/System/Library/Frameworks/Python.framework` in OS X 10.3. (The two Python Frameworks operate independently.)

Some developer and demonstration applications are installed in `/Applications/MacPython-2.4`.

The remaining software is installed in `/usr/local/bin`. In particular, `/usr/local/bin/python2.4` is a Python interpreter.

Usage:

Oodles of instruction can be had at Python's documentation pages.

## Qt/Mac

Download and unpack the Qt/Mac source archive ftp://ftp.trolltech.com/qt/source/qt-mac-free-3.3.4.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O ftp://ftp.trolltech.com/qt/source/qt-mac-free-3.3.4.tar.gz`
`$ tar xvfz qt-mac-free-3.3.4.tar.gz`

Qt/Mac and some of the third-party software that depends on Qt/Mac require that certain environment variables be set. For example, if you use `bash` as your shell:

`$ cd qt-mac-free-3.3.4`
`$ QTDIR=`pwd``
`$ PATH=$QTDIR/bin:$PATH`
`$ DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH`
`$ export QTDIR PATH DYLD_LIBRARY_PATH`

Or if you use `csh` or `tcsh` as your shell:

`$ cd qt-mac-free-3.3.4`
`$ setenv QTDIR `pwd``
`$ setenv PATH $QTDIR/bin:$PATH`
`$ setenv DYLD_LIBRARY_PATH $QTDIR/lib:$DYLD_LIBRARY_PATH`

Record the value of `$QTDIR`. These settings of `$QTDIR`, `$PATH`, and `$DYLD_LIBRARY_PATH` will be required later by other third-party software. To determine the value of `$QTDIR`, for example:
`$ echo $QTDIR`
`/Users/kaben/Projects/Software/qt-mac-free-3.3.4`

Configure and build:

`$ ./configure -thread -verbose`
`$ make symlinks src-qmake src-moc sub-src sub-tools`

Finally, some of the third-party software we will use wants two of the Qt/Mac libraries produced above to be accessible in the standard location `/usr/lib`, so symlink the libraries accordingly:

`$ ln -sf $QTDIR/lib/libqt.3.dylib /usr/lib`
`$ ln -sf $QTDIR/lib/libqui.1.dylib /usr/lib`

## SIP

SIP requires that the `$QTDIR`, `$PATH`, and `$DYLD_LIBRARY_PATH` environment variables point to your Qt/Mac installation, so set them accordingly if they aren't already set. For example, if you use `bash` as your shell:

`$ QTDIR=/Users/kaben/Projects/Software/qt-mac-free-3.3.4`
`$ PATH=$QTDIR/bin:$PATH`
`$ DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH`
`$ export QTDIR PATH DYLD_LIBRARY_PATH`

Or if you use `csh` or `tcsh` as your shell:

`$ setenv QTDIR /Users/kaben/Projects/Software/qt-mac-free-3.3.4`
`$ setenv PATH $QTDIR/bin:$PATH`
`$ setenv DYLD_LIBRARY_PATH $QTDIR/lib:$DYLD_LIBRARY_PATH`

Download and unpack the SIP source archive http://www.river-bank.demon.co.uk/download/sip/sip-4.1.1.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://www.river-bank.demon.co.uk/download/sip/sip-4.1.1.tar.gz`
`$ tar xvfz sip-4.1.1.tar.gz`

Configure, build, and install:

`$ cd sip-4.1.1`
`$ /usr/local/bin/python2.4 ./configure.py`
`$ make`
`$ sudo make install`

## PyQt

PyQt requires that the `$QTDIR`, `$PATH`, and `$DYLD_LIBRARY_PATH` environment variables point to your Qt/Mac installation, so set them accordingly if they aren't already set. For example, if you use `bash` as your shell:

`$ QTDIR=/Users/kaben/Projects/Software/qt-mac-free-3.3.4`
`$ PATH=$QTDIR/bin:$PATH`
`$ DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH`
`$ export QTDIR PATH DYLD_LIBRARY_PATH`

Or if you use `csh` or `tcsh` as your shell:

`$ setenv QTDIR /Users/kaben/Projects/Software/qt-mac-free-3.3.4`
`$ setenv PATH $QTDIR/bin:$PATH`
`$ setenv DYLD_LIBRARY_PATH $QTDIR/lib:$DYLD_LIBRARY_PATH`

Download and unpack the PyQt source archive http://www.river-bank.demon.co.uk/download/PyQt/PyQt-mac-gpl-3.13.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://www.river-bank.demon.co.uk/download/PyQt/PyQt-mac-gpl-3.13.tar.gz`
`$ tar xvfz PyQt-mac-gpl-3.13.tar.gz`

Configure, build, and install:

`$ cd PyQt-mac-gpl-3.13`
`$ /usr/local/bin/python2.4 ./configure.py`
`$ make`
`$ sudo make install`

## Numeric

Download and unpack the Numeric Python package source archive for OS X http://stochastic.net/~kaben/for_devolab/Numeric-23.6-osx3.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://stochastic.net/~kaben/for_devolab/Numeric-23.6-osx3.tar.gz`
`$ tar xvfz Numeric-23.6-osx3.tar.gz`

Build and install:

`$ cd Numeric-23.6-osx3`
`$ /usr/local/bin/python2.4 ./setup.py build`
`$ sudo /usr/local/bin/python2.4 ./setup.py install`

## PyQwt

PyQwt requires that the `$QTDIR`, `$PATH`, and `$DYLD_LIBRARY_PATH` environment variables point to your Qt/Mac installation, so set them accordingly if they aren't already set. For example, if you use `bash` as your shell:

`$ QTDIR=/Users/kaben/Projects/Software/qt-mac-free-3.3.4`
`$ PATH=$QTDIR/bin:$PATH`
`$ DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH`
`$ export QTDIR PATH DYLD_LIBRARY_PATH`

Or if you use `csh` or `tcsh` as your shell:

`$ setenv QTDIR /Users/kaben/Projects/Software/qt-mac-free-3.3.4`
`$ setenv PATH $QTDIR/bin:$PATH`
`$ setenv DYLD_LIBRARY_PATH $QTDIR/lib:$DYLD_LIBRARY_PATH`

Download and unpack the PyQwt-4.1 Python package source archive http://stochastic.net/~kaben/for_devolab/PyQwt-4.1.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://stochastic.net/~kaben/for_devolab/PyQwt-4.1.tar.gz`
`$ tar xvfz PyQwt-4.1.tar.gz`

Download and apply the bug fixes and upgrades patch for PyQwt-4.1 from http://stochastic.net/~kaben/for_devolab/PyQwt-4.1a.patch using the following commands:

`$ curl -O http://stochastic.net/~kaben/for_devolab/PyQwt-4.1a.patch`
`$ patch -p0 -b -z .upgrade < PyQwt-4.1a.patch`

While you're at it, make the ErrorBarDemo.py example executable:

`chmod +x PyQwt-4.1/examples/ErrorBarDemo.py`

Build and install:

`$ cd PyQwt-4.1/configure`
`$ /usr/local/bin/python2.4 ./configure.py`
`$ make`
`$ sudo make install`

## ElementTree

Download and unpack the ElementTree Python package source archive http://effbot.org/downloads/elementtree-1.2.4-20041228.zip into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://effbot.org/downloads/elementtree-1.2.4-20041228.zip`
`$ unzip elementtree-1.2.4-20041228.zip`

Build and install:

`$ cd elementtree-1.2.4-20041228`
`$ /usr/local/bin/python2.4 ./setup.py build`
`$ sudo /usr/local/bin/python2.4 ./setup.py install`

## GCC-XML

Download and unpack the GCC-XML source archive http://www.gccxml.org/files/v0.6/gccxml-0.6.0.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://www.gccxml.org/files/v0.6/gccxml-0.6.0.tar.gz`
`$ tar xvfz gccxml-0.6.0.tar.gz`

Configure, build, and install:

`$ cd gccxml-0.6.0`
`$ mkdir build`
`$ cd build`
`$ /usr/local/bin/cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/local`
`$ make`
`$ sudo make install`

## Boost.Python

Download and unpack the Boost source archive http://www.stochastic.net/~kaben/for_devolab/boost_1_32_0-osx3.tgz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://www.stochastic.net/~kaben/for_devolab/boost_1_32_0-osx3.tgz`
`$ tar xvfz boost_1_32_0-osx3.tgz`

Build Boost.Jam, the Boost Build system:

`$ cd boost_1_32_0-osx3`
`$ pushd tools/build/jam_src`
`$ ./build.sh`
`$ popd`

Copy `bjam`, the Boost build tool, to the top level of the Boost source directory:

`$ cp tools/build/jam_src/bin.macosxppc/bjam ./`

Build Boost.Python (warning -- because Boost is a big package, most of which we don't need and would take a long time to compile, we disable most of Boost, resulting in a big and ugly command):

`$ ./bjam -sTOOLS=darwin \`
`"-sBUILD=release <runtime-link>shared <threading>multiple framework bundle-loader" \`
`--prefix=/usr/local \`
`--without-serialization \`
`--without-test \`
`--without-date_time \`
`--without-filesystem \`
`--without-regexp \`
`--without-signals \`
`--without-program_options \`
`--with-python-root=/Library/Frameworks/Python.framework/Versions/2.4 \`
`-sPYTHON_VERSION=2.4`

Install Boost.Python (again, a big and ugly command -- essentially the same as the previous, but prepended with "`sudo`" and appended with "`install`"):

`$ sudo ./bjam -sTOOLS=darwin \`
`"-sBUILD=release <runtime-link>shared <threading>multiple framework bundle-loader" \`
`--prefix=/usr/local \`
`--without-serialization \`
`--without-test \`
`--without-date_time \`
`--without-filesystem \`
`--without-regexp \`
`--without-signals \`
`--without-program_options \`
`--with-python-root=/Library/Frameworks/Python.framework/Versions/2.4 \`
`-sPYTHON_VERSION=2.4 \`
`install`

## py2app

You may be tempted to download the py2app metapackage installer for Mac OS X from `http://undefined.org/python/py2app-0.1.7.mpkg.zip`.
Don't do it. It will by default install itself into the built-in version-2.3 of Python instead of the special version-2.4 of Python we've built for Avida-Ed, rendering it useless to us.

Download and unpack the py2app package source archive for OS X http://undefined.org/python/py2app-0.1.7.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://undefined.org/python/py2app-0.1.7.tar.gz`
`$ tar xvfz py2app-0.1.7.tar.gz`

Build and install:

`$ cd py2app-0.1.7`
`$ /usr/local/bin/python2.4 ./setup.py build`
`$ sudo /usr/local/bin/python2.4 ./setup.py install`

## IPython (optional but recommended)

Download and unpack the IPython package source archive for OS X http://ipython.scipy.org/dist/ipython-0.6.11.tar.gz into the directory of your choice using Terminal.app; for example:

`$ cd ~/Projects/Software`
`$ curl -O http://ipython.scipy.org/dist/ipython-0.6.11.tar.gz`
`$ tar xvfz ipython-0.6.11.tar.gz`

Install:

`$ cd ipython-0.6.11`
`$ sudo /usr/local/bin/python2.4 ./setup.py install`