[UPDATE] 15 April 2013 – Due to some drastic code changes in the lux and the recent work by the developers into making SLG an active render engine, it is likely that these instructions will not work for latest versions of the code.
Versions 1.1 of both Luxrays and luxrender will compile however. To get these, once you have cloned the repositories use the following commands
hg update v11
hg update luxrender_v1.1
Many thanks to Carlos for running through these instructions and informing me of the code break.
So from start to finish, this is how to get both Luxrays and Luxrender working on the Raspberry Pi Computer. You should note however that performance is very very slow, however for simple scenes it is able to still produce nice results, and if a bunch of them where networked together into a cluster… dare i say ‘bush?’ a classroom could give the same output as slow modern PC. (The arm is not optimized for multiple simultaneous operations so suffers alot compared to a modern x86)
1) Open a terminal and Install *some* of the dependancies of luxrender. Some of them are the wrong version and such we will have to build those ourselves.
>sudo apt-get install mercurial build-essential bison flex libopenexr-dev libtiff4-dev libpng12-dev freeglut3-dev qt4-dev-tools libxmu-dev libxi-dev libfreeimage-dev libbz2-dev
2) Make a dev directory to keep your home area tidy, and cd into it
3) Download cmake and uncompress it and compile as the one which downloads through apt-get is too old.
>wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz .
>tar zxvf cmake-2.8.7.tar.gz
>sudo make install
4) Download and build python 3.2 once again, because the version that comes with the distribution is too old… ****This isnt strictly required as it is only required for pylux but im including it because it works.
>tar zxvf Python-3.2.2.tar.bz2
>./configure –enable-shared –prefix=/home/pi/dev/python32_build
There will be a few things that look like errors, but you can ignore them
5) Get Boost v 1.47 , make a cup of tea and drink it
>tar zxvf boost_1_47_0.tar.gz
next edit the file project-config.jam with what ever text editor you like… i used emacs
Go to the line that says
using python : 2.6 :/usr;
and add the following under
using python : 3.2
Be sure to use a ; at the end of the statement or it will not work. Now build boost as follows.
./bjam python=3.2 stage
Fingers crossed all targets should build *
6) Get and build / install libglew
> wget http://downloads.sourceforge.net/project/glew/glew/1.7.0/glew-1.7.0.tgz
>tar zxvf glew-1.7.0.tgz
7) Clone the luxrays repository and prepare the build with cmake
>hg clone http://src.luxrender.net/luxrays
8) Down to the nitty gritty
Lux and LuxRays wont compile out of the box because of the use of SSE extensions of x86 arch, which ARM does not use. So we need to do some fairly invasive modifications of the code. Unfortunately at this point, me offering a list of changes is the best I can do at the moment. This gives a few limitations, SSE is used in the qbvh accelerator, so those parts of the code need to be commented and the headers removed. If you try to make, you will get as far as the qbvhaccel and it will fail with a bunch of errors related to a missing header, “xmmintrin.h”. Essentially all the instructions below are to remove any and all references to qbvh and mqbvh from the code. First by removing SSE compiler flags, Second by making the builder ignore the corresponding headers and cpp files and finally cleaning up any references that left in the code which stops it building. Not very clean, but, no way around it (that i know of). For most of these when I remove/comment lines, they are found by searching for qbvh… so if you comment them the lines might not match with those below, but they will give you a good idea of location.
I) emacs cmake/PlatformSpecific.cmake
Line 107 and 107, remove all references to msse, msse2 etc….
The purpose of this is so all make files wont include those compiler flags, if it still complains about msse extensions, comb that file and remove all references to -msse, -msse2 etc
II) emacs src/CMakeLists.txt
Line 30 remove mqbvh and qbvh from the SET(…..
Perform a search and remove all lines that contain qbvh, including mqbvh lines too.
III) emacs src/core/dataset.cpp
Comment line 31 and 32 (headers)
Line 51 accelType = ACCEL_QBVH change to accelType=ACCEL_BVH
Search the rest of the file and remove all further lines/sections containing qbvh or mqbvh
>cmake . -DBoost_INCLUDE_DIR=/home/pi/dev/boost_1_47_0 -DLUXRAYS_DISABLE_OPENCL=1
After waiting for a while (maybe an hour or so) LuxRays will compile. I have tested this on my images and I can say that it works, if you are in the luxrays head directory, you can test this by simply running
A window will open and slg will run a standard luxball scene. Performance is slow, i would recommend if you would use it to render anything, then making sure it only uses a single thread would be an advantage, it stops the ARM waisting cycles.
So at this point we dont have to go off and grab any more dependancies just grab luxrender from the repo, make modifications and build
9) Clone the repo
>hg clone http://src.luxrender.net/lux
Make the following modifications
Search for and remove sse flags, specifically around line 309
Search for and remove references to the qbvh accelerator, just do a search for it and comment or remove lines (im assuming you remove the lines so the numbers below might not work)
>cmake . -DLUXRAYS_DISABLE_OPENCL=1 -DBOOST_INCLUDEDIR=/home/pi/dev/boost_1_47_0 -DPYTHON_LIBRARY=/home/pi/dev/python32_build/lib/libpython3.2m.so -DPYTHON_INCLUDE_DIR=/home/pi/dev/python32_build/include/python3.2m
If everything is well and you followed things reasonably well you should now have a working build of luxrender!
A few notes, if you try to run luxrender, you will get a complaint about boost, to get rid of this add the boost libraries to your LD_LIBRARY_PATH environment variable. Alternatively copy the libs to /usr/local/lib which should allow them to be picked up without any fuss.
I will update with some pictures of luxrays and luxrender working/scenes rendered on the Pi when i get chance.
Here is a scene with volumetric scattering at 25S/p rendered in about 12 hours