Build YafaRay on Windows

Build environment

First of all you need to set up the build environment which will give you tools to properly compile YafaRay from source code.

 

Build system

YafaRay uses CMake and Swig as build system. The build system is common between 32bit and 64bit binaries compilation.

YafaRay Windows Build Cmake installation

CMake

There is only a 32bit version but it's fine, it will compile both 32bit and 64bit code as well.
Get the latest version from the official website: http://www.cmake.org/cmake/resources/software.html

YafaRay Windows Build Swig installation

Swig

You will need official 2.0.6 version in order to compile YafaRay code.
Previous versions might need a patch to pyslice and pycapsule.
If you want to use 2.0.7 version you need to apply a patch you can find here because of a bug in swig itself.

There is only a 32bit version but it's fine, it will compile both 32bit and 64bit code as well.
Get it from official swig repository at http://sourceforge.net/projects/swig/files/swigwin/swigwin-2.0.6/
Uncompress the zip file under C:\ and rename it to swigwin, short you will end up with a C:\swigwin folder.

NOTE: Video needs to be updated.

Compiler

Choose the compiler you prefer between MinGW 32bit and MinGW 64bit

YafaRay Windows Build Swig installation

MingW 32bit

YafaRay use a modified MinGW from megasoft78 github
(you will need both 32bit and 64bit if you want to compile for both archs): https://github.com/megasoft78/Core/downloads (mingw64_4.4.6.exe, mingw32_4.4.6.exe)

YafaRay Windows Build Swig installation

MingW 64bit

YafaRay use a modified MinGW from megasoft78 github
(you will need both 32bit and 64bit if you want to compile for both archs): https://github.com/megasoft78/Core/downloads (mingw64_4.4.6.exe, mingw32_4.4.6.exe)

Git client

In order to obtain YafaRay sources you will need a git client.

Git

GIT

Download and Install GIT client for windows from http://msysgit.github.com/

Dependencies

Download and extract YafaRay dependencies from github: https://github.com/megasoft78/Core/downloads (win64libs.exe, win32libs.exe)

 

Compile YafaRay

 

Obtain source code

YafaRay Windows Build Swig installation Create a folder C:\YafaRay, open a terminal and type from that folder:
git clone https://github.com/YafaRay/Core.gitgit clone https://github.com/YafaRay/Blender-Exporter.git

Configuration

In order to compile YafaRay on your environment you need to configure the build system. To do it you have to copy/rename UserConfig.template to UserConfig.txt inside CMakeConfig directory and change the next parameters:

Windows 32bit Windows 64bit
set(WITH_QT OFF)
set(USER_INSTALL_PREFIX "C:/Yafaray/YafarayBuild-32bit")
set(YAF_USER_INCLUDE_DIRS "C:/Yafaray/win32libs/include")
set(YAF_USER_LIBRARY_DIRS "C:/Yafaray/win32libs/bin;C:/Yafaray/win32libs/lib")
set(YAF_USER_SWIG_BIN_DIR "C:/swigwin")
set(YAF_USER_EXTRA_DEFS -DOPENEXR_DLL)
set(YAF_PY_VERSION 3.2)
set(WITH_QT OFF)
set(USER_INSTALL_PREFIX "C:/Yafaray/YafarayBuild-64bit")
set(YAF_USER_INCLUDE_DIRS "C:/Yafaray/win64libs/include")
set(YAF_USER_LIBRARY_DIRS "C:/Yafaray/win64libs/bin;C:/Yafaray/win64libs/lib")
set(YAF_USER_SWIG_BIN_DIR "C:/swigwin")
set(YAF_USER_EXTRA_DEFS -DOPENEXR_DLL -DMS_WIN64)
set(YAF_PY_VERSION 3.2)

Prepare

Explain here cmake usage.

Compile

From inside C:\YafaRay\Core\build run the following commands:

Windows 32bit Windows 64bit
C:\mingw32_4.4.6\bin\mingw32-make
C:\mingw32_4.4.6\bin\mingw32-make install
C:\mingw64_4.4.6\bin\mingw32-make
C:\mingw64_4.4.6\bin\mingw32-make install