Skip to content

Building appleseed on OS X

François Beaune edited this page Mar 2, 2014 · 15 revisions

This page will guide you through the steps required to build appleseed on Mac OS X.

Installing Qt (4.8 or later in the 4.x series)

Download the Qt development environment from qt-project.org/downloads and install it on your system.

Important: appleseed will not build using Qt 5.x or later, you do need a 4.x version of Qt.

Downloading and building the Boost C++ libraries (1.47.0 or later)

By default, appleseed is configured to link against a static build of Boost C++ libraries. If you have the Boost libraries already installed on your system, it's most likely as shared (dynamic) libraries.

  1. If you have Boost shared libraries available on your system, skip this section.
  2. Otherwise, download the latest stable Boost package from www.boost.org/users/download/ (prefer .tar.gz archives as these preserve file permissions) and unpack it in the directory of your choice. Then open a terminal in that directory and type:
./bootstrap.sh
./b2 link=static

Downloading third party library sources

  1. Locate the latest release of the dependency package in https://github.com/appleseedhq/appleseed-deps/releases.
  2. Download the sources:
  3. Extract the 3rdparty directory (not its contents!) of the source archive into your appleseed source directory.

Your appleseed directory should look like that:

<root>
    3rdparty
        alembic
        hdf5
        libpng
        openexr
        xerces-c
        zlib
    resources
    sandbox
    scripts
    src

Building zlib

Skip this section if you want to use the zlib shared library from your system.

Open a terminal in 3rdparty/zlib/ and type:

./configure --static
make
mkdir -p ../../build/mac-gcc4/zlib/
cp libz.a ../../build/mac-gcc4/zlib/
make clean

Building libpng

Skip this section if you want to use the libpng shared library from your system.

Open a terminal in 3rdparty/libpng/ and type:

cp scripts/makefile.darwin makefile
make
mkdir -p ../../build/mac-gcc4/libpng/
cp libpng.a ../../build/mac-gcc4/libpng/

Don't do make clean at the end since this would delete pnglibconf.h which is required by png.h.

Building OpenEXR

Skip this section if you want to use the OpenEXR shared libraries from your system.

Open a terminal in 3rdparty/openexr/ and type:

./configure --prefix=<appleseed-path>/3rdparty/openexr
make
make install
mkdir -p ../../build/mac-gcc4/openexr/
cp lib/* ../../build/mac-gcc4/openexr/
make clean

Note: gcc 4.2 and later will complain about -Wno-long-double not being a recognized option:

error: unrecognized command line option "-Wno-long-double"

To fix this problem, edit the configure file in 3rdparty/openexr/ and, on line 20744, replace

CXXFLAGS="$CXXFLAGS -Wno-long-double"

by

# CXXFLAGS="$CXXFLAGS -Wno-long-double"

and proceed with the instructions above (starting with configure).

Building HDF5

Skip this section if you want to use the Alembic shared library from your system.

Open a terminal in 3rdparty/hdf5/ and type:

mkdir build
cd build
cmake -DHDF5_BUILD_HL_LIB=1 -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=../../../build/mac-gcc4/hdf5 ..
make

Building Alembic

Skip this section if you want to use the Alembic shared library from your system.

Open a terminal in 3rdparty/alembic/ and type:

mkdir build
cd build
cmake -DBOOST_ROOT=<absolute-path-to-boost> ..
make

Building Xerces-C++

Skip this section if you want to use the Xerces-C++ shared library from your system.

Open a terminal in 3rdparty/xerces-c/ and type:

chmod +x config/install-sh
export XERCESCROOT=<appleseed-path>/3rdparty/xerces-c
./configure
make
mkdir -p ../../build/mac-gcc4/xerces-c/
cp src/.libs/*.a ../../build/mac-gcc4/xerces-c/
make clean

Building appleseed

Open a terminal in the build/ directory of your appleseed installation and type:

cmake -DBOOST_ROOT=<absolute-path-to-boost>
      -DQT_QMAKE_EXECUTABLE=<absolute-path-to-qmake-executable>
      ..
make

Add the following flags as appropriate:

  • -DUSE_STATIC_BOOST=OFF if you want to use the Boost shared libraries present in your system.
  • -DUSE_EXTERNAL_ZLIB=ON if you want to use the zlib shared library present in your system.
  • -DUSE_EXTERNAL_PNG=ON if you want to use the libpng shared library present in your system.
  • -DUSE_EXTERNAL_EXR=ON if you want to use the OpenEXR shared libraries present in your system.
  • -DUSE_EXTERNAL_ALEMBIC=ON if you want to use the Alembic shared library present in your system.
  • -DUSE_EXTERNAL_XERCES=ON if you want to use the Xerces-C++ shared library present in your system.