Skip to content

Building appleseed on Windows

Abhiram edited this page May 18, 2023 · 162 revisions

Prerequisites

Tools

The following tools are required to build appleseed and the third-party libraries it relies on:

  • Git. Git is required to retrieve the source code from GitHub. On Windows, we recommend Git Extensions, SourceTree or GitKraken.

  • Microsoft Visual Studio 2015, 2017 or 2019 with MSVC v141 (VS 2017) toolset. The free Visual Studio Community is fully supported. It may or may not work with earlier or newer versions or with the Express edition of Visual Studio. Unless stated explicitly, the instructions below assume Visual Studio 2017 (internally version 14.1): if you are using another version of Visual Studio, you will need to adapt the instructions accordingly.

  • CMake 3.11 or later.

  • Python 2.x. Python is required by LLVM's build system. Python is also required to build appleseed.python (appleseed's Python bindings) and appleseed.studio. Make sure to use a 64-bit version of Python if you are building appleseed in 64-bit mode. You will need a recent version of Python 2.7 (2.7.6 is known to cause problem, Python 2.7.14 is known to work). If you intend to build appleseed.python for Python 3.x (required if you want to build blenderseed), you will also need Python 3.x.

Important:

  • Make sure both Python and Git are in your PATH.
  • By "command prompt" we really mean Windows' Command Prompt (cmd.exe), not PowerShell! Moreover all commands below requires that you type them in a x64 Native Tools Command Prompt, i.e. a command prompt with Visual Studio's environment variables loaded.

Disk space

You will need a lot of free disk space on your machine; 50 GB is a safe upper bound if you plan to build Boost, Qt and the other third-party dependencies yourself.

Primary third-party libraries

Boost

appleseed requires Boost C++ Libraries 1.61 or later.

  • You must use Boost 1.69 if you intend to use the precompiled dependencies with Visual Studio 2015 or 2017.
  • If you are building your own dependencies, we recommend Boost 1.69 as this version compiles cleanly with Visual Studio 2015 and 2017.

You can download a particular version of Boost from the Boost Version History.

Patching older Boost versions

This is only needed if for compatibility reasons you are required to use older boost libraries and compiler versions:

  • If you are using Boost 1.66 and a newer revision of Visual Studio 2017 you may see a warning stating that 'Boost.Config is older than your compiler version'. This warning is harmless, however if you want to keep it from being displayed, you can follow these instructions.

  • If you are compiling Boost 1.66 with support for Python 3.7 (for the latest Blender builds), you will need to apply this patch. For Boost 1.67 or newer versions this is not necessary.

Preparing for building Boost

Open a Visual Studio x64 Native Tools Command Prompt in Boost's root directory and type:

bootstrap.bat
Building Boost with Python 2.7 support only
  1. Make sure that only Python 2.7 is in your PATH.

  2. Make sure there is no bin.v2 directory in Boost. Delete it if it exists.

  3. Type:

    b2 address-model=64 toolset=msvc-14.1
    

    (For VS 2015, replace msvc-14.1 by msvc-14.0.)

Building Boost with Python 2.7 and Python 3.x support

Python 3.x support for Boost and appleseed.python is needed only if you intend to develop blenderseed.

  1. Make sure that only Python 3.x is in your PATH.

  2. Make sure there is no bin.v2 directory in Boost. Delete it if it exists.

  3. Type:

    b2 address-model=64 toolset=msvc-14.1
    

    (Replace msvc-14.1 by msvc-14.0 for VS 2015.)

  4. Edit your PATH to make sure this time only Python 2.7 is present.

  5. Delete the bin.v2 directory from Boost.

  6. Build Boost.Python only with the following command:

    b2 address-model=64 toolset=msvc-14.1 --with-python
    

    (For VS 2015, replace msvc-14.1 by msvc-14.0.)

Qt

appleseed requires Qt 5.12.x. The easiest way is to download the installer for Qt 5.12.x from the Qt Downloads page.

In case you want to build Qt yourself, download the Qt distribution from Qt Downloads archive then open a Visual Studio x64 Native Tools Command Prompt in Qt's root directory and type:

configure -platform win32-msvc2017 -opensource -nomake examples -nomake tests
nmake

(For VS 2015, replace win32-msvc2017 by win32-msvc2015.)

Notes:

  • You will need Perl 5.8 or later to build Qt.
  • sh.exe must not be in your PATH.

If you encounter any issue when building Qt, please refer to the official Qt build instructions

Secondary third-party libraries

Alternative 1: Using prebuilt third-party libraries

We provide prebuild third-party libraries for Visual Studio 2015 and 2017. This is the easiest, quickest of the two alternatives.

  1. Download the latest version of the prebuilt third-party libraries package from the Releases page.

    Make sure to use prebuilt binaries that match your Boost version. At the time of writing, all prebuilt binaries are based on Boost 1.69 for VS 2015 and VS 2017 so you will need to use the exact same Boost version.

  2. Create a windows-deps\ directory in the location of your choice, and extract the zip file inside it. The windows-deps\ directory should now contain a single directory called stage\ with a vc141\ subdirectory inside it (depending on which package you downloaded).

Alternative 2: Building third-party libraries

If you want to use a compiler other than the ones for which we provide prebuilt third-party libraries (or a different Boost version), you will need to build the third-party libraries yourself.

  1. Clone this repository on your machine:

    git clone git://github.com/appleseedhq/windows-deps.git
    

    This will place everything inside an windows-deps\ directory.

  2. Open a Visual Studio x64 Native Tools Command Prompt and navigate to the windows-deps\ directory.

  3. Type:

    BuildAll.bat "Visual Studio 15 2017 Win64" C:\path\to\boost C:\path\to\qt C:\path\to\python\include C:\path\to\python27.lib
    

    (For VS 2015, replace "Visual Studio 15 2017 Win64" by "Visual Studio 14 2015 Win64".)

Building appleseed

  1. Clone the appleseed repository on your machine:

    git clone git://github.com/appleseedhq/appleseed.git
    

    This will place everything inside an appleseed\ directory.

  2. Open a Visual Studio x64 Native Tools Command Prompt and navigate to the appleseed\ directory.

  3. Type (make sure to replace placeholder paths):

    mkdir build
    cd build
    cmake -Wno-dev -G "Visual Studio 15 2017 Win64" -DWITH_EMBREE=ON -DUSE_SSE42=ON -DBOOST_ROOT=C:\path\to\boost -DCMAKE_PREFIX_PATH=C:\path\to\qt -DPYTHON_INCLUDE_DIR=C:\path\to\python\include -DPYTHON_LIBRARY=C:\path\to\python27.lib -DAPPLESEED_DEPS_STAGE_DIR=C:\path\to\windows-deps\stage\vc141 ..
    

    (For VS 2015, replace "Visual Studio 15 2017 Win64" by "Visual Studio 14 2015 Win64" and windows-deps\stage\vc141 by windows-deps\stage\vc140.)
    (For VS 2019 with MSVC v141 (VS 2017) toolset, replace "Visual Studio 15 2017 Win64" by "Visual Studio 16 2019" -T v141 )

    Building appleseed.python with support for Python 3.x: If you are interested in building appleseed.python with support for Python 3.x, add the following lines to the CMake command:

    -DWITH_PYTHON3_BINDINGS=ON -DPYTHON3_INCLUDE_DIR=C:\path\to\python3x\include -DPYTHON3_LIBRARY=C:\path\to\python3x\libs\python3x.lib
    

    (Make sure to replace python3x as appropriate, e.g. python37.)

  4. Open the solution file build\appleseed.sln.

  5. Select the configuration to build (check Build Configurations for details).

  6. Go to Build and select Rebuild Solution. If you are updating an existing build, you should choose Build Solution instead.

Configuring the Visual Studio solution

  1. Right-click on the appleseed.studio project (inside the Applications folder) and select Properties.

  2. Set Configuration to All Configurations.

  3. Make sure that Platform is set to Active(x64).

  4. In Configuration Properties -> Debugging:

    • Set Command to

      $(SolutionDir)..\sandbox\bin\vc$(PlatformToolsetVersion)\$(Configuration)\$(TargetFileName)
      
    • Set Working Directory to

      $(SolutionDir)..\sandbox\
      
    • Set Environment to

      PATH=C:\path\to\qt\bin;C:\path\to\python
      PYTHONHOME=C:\path\to\python
      PYTHONPATH=C:\path\to\appleseed\sandbox\lib\vc$(PlatformToolsetVersion)\$(ConfigurationName)\python
      

    You should end up with something like this:

    Configuring the Visual Studio solution

    Configuring the Visual Studio solution

  5. Click OK to close the Property Pages window.

  6. Right-click on the appleseed.studio project in the Solution Explorer and select Set as StartUp Project.

  7. Press F5 to start appleseed.studio.

Optional: If you want to be able to run appleseed.cli (the command line version of appleseed) or any other command line tool (at the time of writing: animatecamera, convertmeshfile, denoiser, dumpmetadata, makefluffy and projecttool) from Visual Studio:

  1. Right-click on the desired project and select Properties.

  2. Set Configuration to All Configurations.

  3. Make sure that Platform is set to Active(x64).

  4. In Configuration Properties -> Debugging:

    • Set Command to

      $(SolutionDir)..\sandbox\bin\vc$(PlatformToolsetVersion)\$(Configuration)\$(TargetFileName)
      
    • Set Working Directory to

      $(SolutionDir)..\sandbox\
      
Clone this wiki locally