Skip to content

Building appleseed on macOS

François Beaune edited this page Oct 16, 2018 · 67 revisions

Prerequisites

Tools

Homebrew

Homebrew is a popular package manager for macOS. We'll use Homebrew to install most dependencies.

You may already have Homebrew installed on your system. If brew help returns something, you already have it. If instead it returns brew: command not found, you need to install Homebrew by opening Terminal and running this command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

CMake

CMake 2.8.12 or later is required. You can install it with Homebrew:

brew install cmake

Python

Python 2.7.11 or a newer version of Python 2.7 is required. Start by checking the version of Python currently installed in your system:

python --version

If this returns anything older than Python 2.7.11 then install the latest version of Python 2.7:

brew install python@2

In case you already have a recent version of Python but it just needs to be linked:

brew link python@2

We assume in the remaining of this document that Python 2.7.15 is installed in /usr/local/Cellar/python@2/2.7.15. If you installed Python via Homebrew, you can check where it is installed:

brew info python@2

Adjust instructions if a different version of Python is installed in your system.

Libraries available through Homebrew

Let's start by installing as many dependendies as we can with Homebrew:

brew install boost --without-single --without-static
brew install boost-python
brew install zlib
brew install xerces-c
brew install [email protected]
brew install openimageio

brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt@4
brew install pyqt@4

mkdir -p $HOME/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> $HOME/Library/Python/2.7/lib/python/site-packages/homebrew.pth

OpenShadingLanguage

OpenShadingLanguage (OSL in short) is an advanced shading language for production renderers developed by Sony Pictures Imageworks. OSL is the shading language of appleseed.

Move to the directory of your choice, then clone the OSL repository and switch to the correct branch:

git clone https://github.com/imageworks/OpenShadingLanguage.git
cd OpenShadingLanguage
git checkout Release-1.8.12

Edit the file CMakeLists.txt and change line 25 from

# cmake_policy (SET CMP0042 OLD)

to

cmake_policy (SET CMP0042 OLD)

Then build and install OSL:

mkdir build
cd build
cmake -Wno-dev -DLLVM_DIRECTORY=/usr/local/opt/[email protected]/ -DLLVM_STATIC=ON -DENABLERTTI=ON -DUSE_LIBCPLUSPLUS=ON ..
sudo make install

SeExpr

SeExpr is a simple expression language developed by Walt Disney Animation Studios. SeExpr is required by appleseed to combine layers in the Disney material (and may be used more pervasively in the future).

Move to the directory of your choice, then retrieve, build and install SeExpr by running the following commands:

git clone https://github.com/wdas/SeExpr
cd SeExpr
git checkout db9610a24401fa7198c54c8768d0484175f54172
mkdir build
cd build 
cmake -Wno-dev -DCMAKE_POLICY_DEFAULT_CMP0042=OLD ..
sudo make install

Building appleseed

You can finally clone appleseed's repository and build appleseed. Move to the directory of your choice, then retrieve and build appleseed by running the following commands:

git clone https://github.com/appleseedhq/appleseed.git
cd appleseed
mkdir build
cd build
cmake -Wno-dev -DWITH_DISNEY_MATERIAL=ON -DUSE_STATIC_BOOST=OFF -DUSE_EXTERNAL_ZLIB=ON -DUSE_EXTERNAL_PNG=ON -DUSE_EXTERNAL_EXR=ON -DUSE_EXTERNAL_XERCES=ON -DUSE_EXTERNAL_SEEXPR=ON -DUSE_EXTERNAL_OIIO=ON -DUSE_EXTERNAL_OCIO=ON -DUSE_EXTERNAL_OSL=ON -DZLIB_INCLUDE_DIR=/usr/local/opt/zlib/include -DZLIB_LIBRARY=/usr/local/opt/zlib/lib/libz.dylib -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/include/python2.7/ -DPYTHON_LIBRARY=/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib -DBoost_PYTHON_LIBRARY_RELEASE=/usr/local/lib/libboost_python27.dylib ..
make

This will install appleseed binaries under the sandbox/bin/Ship/ directory.

Running appleseed

appleseed.studio needs to find a Python 2.7 installation at startup. Official releases of appleseed embed Python 2.7 and thus work out of the box, but developer builds don't.

You can instruct appleseed.studio to use a given Python 2.7 installation via the PYTHONHOME environment variable:

export PYTHONHOME=/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/

You can then start appleseed.studio from sandbox/bin/Ship/ normally by running:

./appleseed.studio
Clone this wiki locally