Building appleseed on Linux

François Beaune edited this page Nov 26, 2018 · 104 revisions

appleseed has many dependencies, some of them not usually included in common Linux distributions. The recommended method to build appleseed on Linux is to use precompiled dependencies. This is the method documented here.

As mandated by the VFX Reference Platform, gcc 4.8 is the only version officially supported to build appleseed.

You may however use a more recent version of gcc (5.x, 6.x or 7.x) to compile appleseed against the precompiled dependencies by using a special flag documented below. While this will usually work, we do not officially support this scenario.

Required Dependencies

There is a repository containing most of appleseed dependencies compiled with gcc 4.8 here: https://github.com/appleseedhq/prebuilt-linux-deps

They are the same dependencies used to build appleseed on Travis, our continuous integration server.

You might also need to install the zlib and zlib-devel packages if they are not already installed (they usually are).

Optional Dependencies

You will need Qt 4.8 (or later in the 4.x series) if you want to build appleseed.studio, the graphical user interface to appleseed.

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

Building appleseed

  1. Download the prebuilt dependencies package and unpack it:
    https://github.com/appleseedhq/prebuilt-linux-deps/releases/download/binaries/appleseed-deps-shared-2.0.tgz

  2. Clone the appleseed repository:

    git clone https://github.com/appleseedhq/appleseed.git
    cd appleseed
    
  3. If you are using gcc 5.x or newer:

    1. Edit the top-level CMakeLists.txt file.
    2. Locate the Platform-specific settings section.
    3. Add the following line:
      add_definitions (-D_GLIBCXX_USE_CXX11_ABI=0)
      
  4. Prepare the environment (make sure to replace placeholder paths):

    cd /directory/with/appleseed/code
    
    export APPLESEED_DEPENDENCIES=/directory/with/precompiled/dependencies
    export CMAKE_INCLUDE_PATH=$APPLESEED_DEPENDENCIES/include
    export CMAKE_LIBRARY_PATH=$APPLESEED_DEPENDENCIES/lib
    export LD_LIBRARY_PATH=$APPLESEED_DEPENDENCIES/lib
    
  5. Build appleseed:

    mkdir build
    cd build
     cmake \
       -Wno-dev \
       -DWITH_EMBREE=ON \
       -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 \
       -DUSE_EXTERNAL_EMBREE=ON \
       -DBOOST_INCLUDEDIR=$APPLESEED_DEPENDENCIES/include/boost_1_61_0 \
       -DBOOST_LIBRARYDIR=$APPLESEED_DEPENDENCIES/lib/ \
       -DBoost_ATOMIC_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_atomic-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_CHRONO_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_chrono-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_DATE_TIME_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_date_time-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_FILESYSTEM_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_filesystem-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_PYTHON_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libboost_python-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_PYTHON_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_python-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_REGEX_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_regex-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_SYSTEM_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_system-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_SERIALIZATION_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_serialization-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_THREAD_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_thread-gcc48-mt-1_61.so.1.61.0 \
       -DBoost_WAVE_LIBRARY_RELEASE=$APPLESEED_DEPENDENCIES/lib/libboost_wave-gcc48-mt-1_61.so.1.61.0 \
       -DSEEXPREDITOR_INCLUDE_DIR=$APPLESEED_DEPENDENCIES/include \
       -DSEEXPREDITOR_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libSeExprEditor.so \
       -DOSL_COMPILER=$APPLESEED_DEPENDENCIES/bin/oslc \
       -DOSL_MAKETX=$APPLESEED_DEPENDENCIES/bin/maketx \
       -DOSL_QUERY_INFO=$APPLESEED_DEPENDENCIES/bin/oslinfo \
       -DOPENIMAGEIO_OIIOTOOL=$APPLESEED_DEPENDENCIES/bin/oiiotool \
       -DEMBREE_INCLUDE_DIR=$APPLESEED_DEPENDENCIES/include \
       -DEMBREE_LIBRARY=$APPLESEED_DEPENDENCIES/lib/libembree3.so \
       ..
    make
    

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

A note regarding compiler warnings

The default build configuration (or build type in CMake's terminology) is Ship (check Build Configurations for details). In Ship and Profile configurations, warnings emitted by the compiler don't cause builds to fail.

However, if you decide to build appleseed in Debug or Release configurations, any compiler warning will be treated as an error and will cause builds to fail.

We always make sure that the master branch of appleseed builds cleanly (without any warning) on all platforms and with all supported compiler and compiler versions. However your compiler may emit new warnings which will cause builds to fail.

Ideally, we would appreciate that you investigate the cause of these warnings and submit a pull request that fix them. Alternatively, you can add -DWARNINGS_AS_ERRORS=OFF to CMake's command line, then run make again. Warnings will still be emitted by the compiler but they won't cause builds to fail anymore.

Running appleseed

appleseed binaries, appleseed.studio in particular, need an "environment" with a specific directory structure and a number of support files in order to run properly. We call this environment the sandbox. The appleseed repository comes with a fully configured sandbox in the sandbox/ directory.

When appleseed is built, binaries get automatically deployed to sandbox/bin/<config> where <config> is the build configuration you selected with CMake's CMAKE_BUILD_TYPE option.

To start appleseed.studio, navigate to sandbox/bin/<config> (e.g. sandbox/bin/Release) and type ./appleseed.studio.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.