-
Notifications
You must be signed in to change notification settings - Fork 332
Building appleseed on Windows
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.
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.
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.
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.
Open a Visual Studio x64 Native Tools Command Prompt in Boost's root directory and type:
bootstrap.bat
-
Make sure that only Python 2.7 is in your PATH.
-
Make sure there is no
bin.v2
directory in Boost. Delete it if it exists. -
Type:
b2 address-model=64 toolset=msvc-14.1
(For VS 2015, replace
msvc-14.1
bymsvc-14.0
.)
Python 3.x support for Boost and appleseed.python is needed only if you intend to develop blenderseed.
-
Make sure that only Python 3.x is in your PATH.
-
Make sure there is no
bin.v2
directory in Boost. Delete it if it exists. -
Type:
b2 address-model=64 toolset=msvc-14.1
(Replace
msvc-14.1
bymsvc-14.0
for VS 2015.) -
Edit your PATH to make sure this time only Python 2.7 is present.
-
Delete the
bin.v2
directory from Boost. -
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
bymsvc-14.0
.)
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
We provide prebuild third-party libraries for Visual Studio 2015 and 2017. This is the easiest, quickest of the two alternatives.
-
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.
-
Create a
windows-deps\
directory in the location of your choice, and extract the zip file inside it. Thewindows-deps\
directory should now contain a single directory calledstage\
with avc141\
subdirectory inside it (depending on which package you downloaded).
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.
-
Clone this repository on your machine:
git clone git://github.com/appleseedhq/windows-deps.git
This will place everything inside an
windows-deps\
directory. -
Open a Visual Studio x64 Native Tools Command Prompt and navigate to the
windows-deps\
directory. -
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"
.)
-
Clone the appleseed repository on your machine:
git clone git://github.com/appleseedhq/appleseed.git
This will place everything inside an
appleseed\
directory. -
Open a Visual Studio x64 Native Tools Command Prompt and navigate to the
appleseed\
directory. -
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"
andwindows-deps\stage\vc141
bywindows-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
.) -
Open the solution file
build\appleseed.sln
. -
Select the configuration to build (check Build Configurations for details).
-
Go to Build and select Rebuild Solution. If you are updating an existing build, you should choose Build Solution instead.
-
Right-click on the
appleseed.studio
project (inside theApplications
folder) and select Properties. -
Set Configuration to
All Configurations
. -
Make sure that Platform is set to
Active(x64)
. -
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:
-
-
Click OK to close the Property Pages window.
-
Right-click on the
appleseed.studio
project in the Solution Explorer and select Set as StartUp Project. -
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:
-
Right-click on the desired project and select Properties.
-
Set Configuration to
All Configurations
. -
Make sure that Platform is set to
Active(x64)
. -
In Configuration Properties -> Debugging:
-
Set Command to
$(SolutionDir)..\sandbox\bin\vc$(PlatformToolsetVersion)\$(Configuration)\$(TargetFileName)
-
Set Working Directory to
$(SolutionDir)..\sandbox\
-