Current stable version: 0.1.1

Building YafaRay

Warning! This page is pending an update, the source code has been moved to github.

Introduction

This page is meant to give instructions on building YafaRay from the source code.

Get YafaRay source code

The YafaRay project uses a SVN repository for source code. The main repository url is:

svn://svn.yafaray.org/repo/yafaray

The repository is separated into several lines of development, with,

  • mainline containing the latest official YafaRay source code. This means you should not have any bigger problems compiling or using it. It also contains official stable version at some point.
  • One or more branches that are used by developers to keep track of experimental features and bug fixes, before being tested and moved to mainline. Keep in mind that not every revision you could get from branches will work flawlessy or even build.

Prerequisites:

Subversion or any other equivalent software. It's needed to download files from svn repositories.


To get the YafaRay official source code you need to use your subversion software and get them from svn://svn.yafaray.org/repo/yafaray/mainline
On Linux machines usually this means you have to open a console and write:
$ svn co svn://svn.yafaray.org/repo/yafaray/mainline yafaray_sources

To get the YafaRay experimental source code you need to use subversion software and get them from one of the branches.
There are currently two branches under development:

darktide branch: this is the main branch used to keep track of experimental features and bug fixes before being tested and moved to mainline.
To get darktide branch code you need to use your subversion software and get them from svn://svn.yafaray.org/repo/yafaray/branches/darktide
On Linux machines usually this means you have to open a console and write:
$ svn co svn://svn.yafaray.org/repo/yafaray/branches/darktide yafaray_sources

cmake branch: this branch is used to develop a cmake build system for YafaRay source code.
To get cmake branch code you need to use your subversion software and get them from svn://svn.yafaray.org/repo/yafaray/branches/cmake
On Linux machines usually this means you have to open a console and write:
$ svn co svn://svn.yafaray.org/repo/yafaray/branches/cmake yafaray_sources

The last argument is the name of your local directory that should be created. If you omit it, it becomes the last subdir of the path (i.e. "mainline", "darktide" or "cmake" here).

At this point you should have a folder with the whole YafaRay source code in it.

Note: The code is mainly tested on Linux (32 and 64bit) and Windows (32bit) and OS X (intel). Other platforms may require some work on configurations. For additional information about customization etc. please read the "INSTALL" in the source tree

 

Build YafaRay

The YafaRay source code provides several features:

  • YafaRay libraries and binaries
  • YafaRay python bindings

Build YafaRay libraries and binaries

YafaRay libraries and binaries could be used stand alone with YafaRay XML scenes or as a library by other software. Look at LGPL licensing for that.
They will also provide the GUI to show a render in progress.

Prerequisites:

Compiling YafaRay happens via scons. Note that you need at least scons 0.97 now, version 1.0 recommended!

The YafaRay build system gives builders the ability to customize features. All features are enabled by default, to customize them you should create a user-config.py file in your source folder and place custom settings there. Look in the config folder for examples.
For a specific example, if you don't need the Qt GUI, you need to disable it by adding WITH_YF_QT='false' in your user-config.py

On Linux, you should have no problem getting all the libraries via your package manager, as they are all used in well established linux applications. Just don't forget to install the developer versions (for headers and libraries) too.

Here we list all the dependencies needed for a build with all features enabled.

Dependencies (full list):

pthread (wrapper library for Windows)
libxml (for xml loader)
libjpeg
libpng
OpenEXR

freetype 2

zlib

Qt

 

Build:

At this point you should have the YafaRay sources and all dependencies needed to build YafaRay libraries and binaries. To do that you have to open a console and from the YafaRay source folder write:

scons build

Install:

If everything worked with no errors you can install with (you could need to be root):

scons install

By default YafaRay installs to /usr/local path, but this can be configured in user-config.py

 

Build YafaRay python bindings

YafaRay python bindings are needed to use python to access YafaRay library features (used by the YafaRay exporter for Blender 2.49 for example).

Prerequisites:

For building the Python bindings you will also need SWIG

Dependencies:

python devel

Build:

To build the bindings you should write into your console from the YafaRay source folder:

scons swig

Install:

To install the bindings you should copy the files from bindings/python into your python path.

 

TODO WIN32



  1. If you are using the Visual Studio 8 Compiler, you can now get all libraries except Qt precompiled in SVN too:
    svn co https://ssl.little-isp.de/svn/lynx/yafaray/libs

    They were all (except libjpeg, which is from the old yafray repository) compiled with MSVC8 using dynamic runtime.

    On Windows, the librariess directory is assumed to be on the same level as the directory containing the sources. To achieve this, do the checkout commands in the same directory, for example if you do it in "C:\SomeDir" it should look something like:
    C:\SomeDir\yafaray
    C:\SomeDir\libs

Python based Blender export

The YafaRay Blender exporter project uses a SVN repository for source code. The main repository url is:

svn://svn.yafaray.org/repo/yafaray-blender

The repository is separated into several lines of development, with,

  • mainline containing the latest official exporter to be used with YafaRay official source code. It also contains official stable version at some point.
  • One or more branches that are used by developers to keep track of experimental features and bug fixes, before being tested and moved to mainline. Keep in mind that not every revision you could get from branches will work flawlessy.

Prerequisites:

Subversion or any other equivalent software. It's needed to download files from svn repositories.

 

To get the official YafaRay Blender exporter you need to use your subversion software and get them from svn://svn.yafaray.org/repo/yafaray-blender/mainline
On Linux machines usually this means you have to open a console and write:
$ svn co svn://svn.yafaray.org/repo/yafaray-blender/mainline yafaray_blender

To get the YafaRay Blender exporter experimental code you need to use subversion software and get them from one of the branches.
There is currently one branche under development:

darktide branch: this is the main branch used to keep track of experimental features and bug fixes before being tested and moved to mainline.
To get darktide branch exporter code you need to use your subversion software and get them from svn://svn.yafaray.org/repo/yafaray-blender/branches/darktide
On Linux machines usually this means you have to open a console and write:
$ svn co svn://svn.yafaray.org/repo/yafaray-blender/branches/darktide yafaray_blender

 

Install:

These scripts together allow the export from Blender. The scripts should be installed like this:

  • Linux
    Copy all scripts from the above source and the Python binding modules (all files from yafaray/bindings/python -- only available after you issued scons swig, see above) into either
    ~/.blender/scripts/yafaray
    or
    /usr/share/yafaray/blender/ (for a installation for all users). In the latter case, each user should copy the script yafaray_ui.py into ~/.blender/scripts (or you install it also globally, but must then ensure that Blender reads the directory you copy the script to as its script directory).

 

More Documentation

Information on the new XML format:   YafaRay XML scene specifications

A (still incomplete) list of XML parameters the various scene elements take can be found here:   YafaRay XML scene parameters

More technical details about the blender export can be found here:  Blender export specifications