Personal tools

From LuxRender Wiki

ATTENTION: THIS TUTORIAL WAS WRITTEN IN LATE 2010 AND SOME THINGS HAVE CHANGED IN THE MEANTIME; CONSEQUENTLY THE DESCRIBED PROCESS GIVES AN IDEA OF HOW TO COMPILE LUXRENDER BUT SOME DETAILS ARE NOT UP TO DATE.

This wiki will demonstrate how to build a working copy of Luxrender 0.8 dev on Ubuntu 10.10 Maverick Meerkat 64-bit. The method to compile on Ubuntu 32-bit is very similar, but some of the package names are different.

I will also show how to get Blender 2.55 up and working with both SLG and Luxrender, though the programs compiled here can be used standalone or with any other exporter.

You will be prompted to additionally install a lot of related extra packages that the above are dependent on. Go ahead and press Y to continue. Depending on how many you don't already have and the speed of your internet connection, this may take a little while.

Getting the Source Code

Next let's create a folder to keep all the source code and our compiled work in.

cd ~
mkdir lux-src
cd lux-src

Now we'll use the Mercurial source code management system to clone a current copy of the source code.

Due to some limitations of the current web hosting system, you may get an error message while downloading the source code. If that happens, simply try the command again. It will usually complete succesfully after a couple of tries. If you still can't get through, there is a mirror of the host that is much more reliable, though a few hours behind in the latest updates. To use the mirror instead, copy/paste the following instead of the above.

Getting OpenCL

The Luxrays library uses the relatively new OpenCL language, which allows the GPU to be utilized.
If you are using an NVIDIA card, all the required OpenCL libraries are already included in the NVidia driver installer, but you may need to install CUDA.

If you are using an ATI card, in addition to the Catalyst display driver, you will need to separately install the ATI Stream SDK to get the needed OpenCL libraries. You can either download and install it yourself, or use Nou's pre-packaged version.

Save and close the file. There is one more variable to edit, LD_LIBRARY_PATH, but due to some security changes in Ubuntu, it's not as easy to set as it used to be. Just type the following to take care of it (again be sure to put in your actual username in place of <username>):

Getting Boost 1.47.0

As of this writing, Ubuntu 10.10 only has boost 1.42.0 in it's repositories, so you'll need to manually build and install version 1.47.0 instead.
Note that later versions (currently up to 1.45.0) are available and should also work, but 1.47.0 is the "officially" tested/used version for LuxRender so I recommend using it to avoid any unforeseen issues.

By default, this version of Boost uses Python 2.6. However, to make use of all of LuxRender's special features (namely Pylux) we'll need to build it with Python 3.1 instead. Don't worry, you already installed Python 3.1 at the beginning of this wiki. Now we just need to change the Boost config to compile using it instead.

gedit ./project-config.jam

Change the line

using python : 2.6 : /usr ;

to

using python : 3.1 : /usr ;

Save and close the file. Now time to build the boost libraries (this may take a little while):

Make (both ATI & NVidia)

You shouldn't get any errors if you followed everything OK up to here. If all is well, you are ready to compile.

make

Or if you have multiple CPU's, you can use the -j parameter to speed things up. For a quad core, you might use:

make -j 4

If all goes well, it should count up to 100% without any errors. You can test it by typing:

bin/slg

You should see the familiar Luxball begin to render (at awesome GPU-enhanced speeds). The last section of this wiki will cover how to set up the exporter with Blender. In the meantime, let's continue with building the full LuxRender.

Building LuxRender

First we'll want to modify the build instructions to make use of Python 3.1 instead of 2.6. This will allow us to create a usable Pylux.so and all its goodness (such as material previews in Blender!)

gedit ~/lux-src/lux/CMakeLists.txt

Insert

SET(CMAKE_USE_PYTHON_VERSION 3.1)

before

FIND_PACKAGE(PythonLibs)

If you are using a NVidia card, you will need to change the OpenCL paths like before in the CMakeList.txt for LuxRay

Save the file and quit gedit.

We're just about ready to begin, but we don't want to make a mess and compile our build in the same folder as our source, so let's make a new place to build it.