Darwin  1.10(beta)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Mac OS X Installation Instructions

Getting the Code

Download

Select the appropriate stable release from here or check out directly from the repository by following the instructions below.

Repository

For the development branch use:

git clone https://github.com/sgould/drwn.git $DARWIN

or

svn co https://github.com/sgould/drwn $DARWIN

For a stable release (e.g., <x>.<y>) use:

svn co https://svn.anu.edu.au/AI/drwn/release/<x>.<y> $DARWIN

Here $DARWIN refers to the name of the base Darwin directory.

Projects

After downloading or checking out the main Darwin codebase third-party projects can be installed in $DARWIN/projects along with the released Darwin projects. They will then be automatically built when you build the Darwin projects.

Building the Code

Thanks to James Bornholt and Chris Claoue-Long for assisting with these instructions.

The following instructions assume that you have downloaded or checked out the code and have changed to the base Darwin directory (i.e., $DARWIN). Before building Darwin you will need to install a number of external libraries that are required by the main Darwin libraries or optionally used by the specific projects you'd like to compile.

Before attempting to build the code you will need to ensure that a number of essential software packages are installed. See Essential Software below.

The required libraries can be installed using a script included in the $DARWIN/external directory. The commands to install them are:

cd external
./install.sh Eigen
cd ..

The optional libraries can be installed with:

cd external
./install.sh zlib
./install.sh OpenCV
./install.sh wxWidgets
./install.sh lua
cd ..

Make sure you update your DYLD_LIBRARY_PATH variable to avoid runtime errors:

export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${DARWIN}/external/opencv/lib

Here ${DARWIN} refers to the full path to your Darwin directory. This can be added to your .bash_profile file to have it automatically defined whenever you start a new shell.

After the external libraries are installed, you can build the Darwin libraries, applications and projects. See make.local (in Linux Installation Instructions) for how to control the build process.

Note
You can force static (instead of dynamic) linking of the Darwin libraries by setting DRWN_SHARED_LIBS = 0 in your make.local file.
make
make drwnprojs

You can also build specific projects using

cd project/<PROJECTNAME>
make
cd ../..

Essential Software

The following packages need to be installed on your system:

The macosx.sh script in the external directory will install some of these tools. Note that you will need to enter your password a couple of times during installation. If downloading via brew doesn't work immediately after installing, cancel the script via Control-C and run "brew doctor" before typing Control-C once more and then rerunning the script.

You will need to install the Xcode developer tools manually.

Matlab

Building the Matlab project requires Matlab to be installed on the system and a symbolic link setup in the external directory, e.g.,

ln -s /Applications/MATLAB_R2014a.app/ external/matlab

The default compiler on Mac OS X is clang++. The compiler can link against two different C++ libraries. To control which one use either:

CXXFLAGS="$CXXFLAGS -stdlib=libc++"
CXXLIBS="$CXXLIBS -lc++"

or

CXXFLAGS="$CXXFLAGS -stdlib=libstdc++"
CXXLIBS="$CXXLIBS -lstdc++"

This is usually only an issue when linking against other libraries, such as OpenCV.

See Also
Compiling Mex Projects