Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Discussion and help for Compilation problems and platform portability.

Moderator: coordinators

Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby dougal2 » Thu Mar 24, 2011 10:11 pm



Vimeo page: http://vimeo.com/21469449

Description from Vimeo page:

Title kind of says it all. I'm going to walk through compiling from scratch everything needed to run LuxRender inside Blender 2.5x.

On the day that I did this, this is roughly equal to using Blender 2.57 and LuxRender 0.8 - though neither have quite been finalised yet.

This video is in 10 chapters:

CHAPTER 1 - SET UP ENVIRONMENT AND TOOLS
CHAPTER 2 - GETTING AND BUILDING PYTHON 3.2
CHAPTER 3 - GETTING AND BUILDING BLENDER 2.5
CHAPTER 4 - GETTING ATI STREAM SDK
CHAPTER 5 - GETTING AND BUILDING BOOST 1.43
CHAPTER 6 - GETTING LUXRENDER SOURCES
CHAPTER 7 - BUILDING LUXRAYS
CHAPTER 8 - BUILDING LUXRENDER
CHAPTER 9 - CONFIGURING LUXBLEND25 AND BLENDER 2.5
CHAPTER 10 - MAKING A SCRIPT TO UPDATE EVERYTHING

I made this walkthrough in a Virtual Machine, starting from a genuinely fresh install of Linux Mint 10, 64 bit.
The only thing I did pre-install was the VirtualBox addons, which enables a much smoother VM experience.

At the end of each chapter, I reset the Terminal to enable each part to stand-alone. This means that you don't need to sit through the entire 50 minutes in one sitting if you don't want to.

There are a couple of edits in the video, I admit. This is the reason that in chapter 2, two of the commands appear to not do anything.
I remain fairly confident that if followed, this tutorial will still work, so long as you issue all the same commands that I did, and edit the files properly.
I will test it again myself soon to verify, but for now, just producing this video required so much energy that I am going to leave it as-is.



# ============================================================================================

# NOTE - this is not a 'script' in the sense of a computer script
# it's more like a verbal script, or a set of clues as to what I
# needed to do in order to successfully build everything

These notes are not totally complete though, there was one or
two things extra I needed to do in the video that I hadn't realised
when I wrote these notes.


# ==============================================
# CHAPTER 1 - SET UP ENVIRONMENT AND TOOLS
# ==============================================

# configure gedit to display line numbers

# pre-build tools
sudo apt-get install build-essential mercurial subversion cmake flex bison

# make development location
mkdir /home/doug/dev
cd /home/doug/dev


# ==============================================
# CHAPTER 2 - GETTING AND BUILDING PYTHON 3.2
# ==============================================

cd /home/doug/dev

sudo apt-get install libbz2-dev zlib1g-dev

# python 3.2
wget http://python.org/ftp/python/3.2/Python-3.2.tar.bz2
tar xjf Python-3.2.tar.bz2

# make py build location
mkdir /home/doug/dev/python32_build

cd Python-3.2
./configure --enable-shared --prefix=/home/doug/dev/python32_build
make -j4
make install



# ==============================================
# CHAPTER 3 - GETTING AND BUILDING BLENDER 2.5
# ==============================================

# blender wiki linux build
# http://wiki.blender.org/index.php/Dev:2 ... untu/Scons
# http://wiki.blender.org/index.php/Dev:2 ... leshooting

mkdir /home/doug/dev/blender
cd /home/doug/dev/blender

# blender deps
sudo apt-get install gettext \
libxi-dev libsndfile1-dev \
libpng12-dev libfftw3-dev \
libopenexr-dev libopenjpeg-dev \
libopenal-dev libalut-dev libvorbis-dev \
libglu1-mesa-dev libsdl1.2-dev libfreetype6-dev \
libtiff4-dev libsamplerate0-dev libavdevice-dev \
libavformat-dev libavutil-dev libavcodec-dev libjack-dev \
libswscale-dev libx264-dev libmp3lame-dev

# blender svn
svn co https://svn.blender.org/svnroot/bf-blen ... nk/blender
cd blender
gedit user-config.py

"""
SUFFIX = "m" # may be any combination of 'dmu'
BF_PYTHON = '/home/doug/dev/python32_build'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
BF_PYTHON_VERSION = '3.2'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}' + SUFFIX
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' + SUFFIX
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']

"""

python scons/scons.py -j4

cd /home/doug/dev/blender/install/linux2
gedit start_blender

"""
LD_LIBRARY_PATH=/home/doug/dev/python32_build/lib ./blender $*
"""

chmod +x start_blender
./start_blender

## -> verify running and quit immediately


# ==============================================
# CHAPTER 4 - GETTING ATI STREAM SDK
# ==============================================

cd /home/doug/dev

# ati stream
wget http://download2-developer.amd.com/amd/ ... -lnx64.tgz
tar xzf ati-stream-sdk-v2.3-lnx64.tgz


# ==============================================
# CHAPTER 5 - GETTING AND BUILDING BOOST 1.43
# ==============================================

cd /home/doug/dev

# boost 1.43
wget http://downloads.sourceforge.net/projec ... _0.tar.bz2
tar xjf boost_1_43_0.tar.bz2

cd /home/doug/dev/boost_1_43_0
./bootstrap.sh
gedit project-config.jam
"""
using python : 3.2
: /home/doug/dev/python32_build
: /home/doug/dev/python32_build/include/python3.2m
:
;

"""
gedit libs/python/src/converter/builtin_converters.cpp
# line 434
"""
intermediate
"""
./bjam -j4 python=3.2 stage


# ==============================================
# CHAPTER 6 - GETTING LUXRENDER SOURCES
# ==============================================

cd /home/doug/dev

# luxrender wiki
# http://www.luxrender.net/wiki/Building_on_Ubuntu_10.10

# luxrender deps
sudo apt-get install libopenexr-dev freeglut3-dev libglew1.5-dev libfreeimage-dev libqt4-dev libbz2-dev libpng12-dev

# luxrender source
mkdir /home/doug/dev/luxrender
cd /home/doug/dev/luxrender
hg clone http://bitbucket.org/luxrender/lux
hg clone http://bitbucket.org/luxrender/luxrays
hg clone http://bitbucket.org/luxrender/luxblend25
ls -l


# ==============================================
# CHAPTER 7 - BUILDING LUXRAYS
# ==============================================

cd /home/doug/dev/luxrender/luxrays

sudo apt-get install libxmu-dev

gedit CMakeLists.txt
# lines 96-97
"""
find_path(OCL_INCLUDE_PATH NAMES CL/cl.hpp OpenCL/cl.hpp PATHS /home/doug/dev/ati-stream-sdk-v2.3-lnx64/include /usr/local/cuda/include)
find_library(OCL_LIBRARY OpenCL /home/doug/dev/ati-stream-sdk-v2.3-lnx64/lib/x86_64)

"""
BOOST_ROOT=/home/doug/dev/boost_1_43_0 cmake .
make -j4


# ==============================================
# CHAPTER 8 - BUILDING LUXRENDER
# ==============================================

cd /home/doug/dev/luxrender/lux

gedit CMakeLists.txt
# lines 94-95
"""
FIND_PATH(OPENCL_INCLUDE_DIRS NAMES CL/cl.hpp OpenCL/cl.hpp PATHS /home/doug/dev/ati-stream-sdk-v2.3-lnx64/include /usr/local/cuda/include)
FIND_LIBRARY(OPENCL_LIBRARY OpenCL /home/doug/dev/ati-stream-sdk-v2.3-lnx64/lib/x86_64)
"""
# lines 865-866
"""
# Ignore this line, the python 3.2 we have is not system installed
# SET(CMAKE_USE_PYTHON_VERSION 3.1)
"""
# lines 886-887
"""
# so, FIND_PACKAGE(PythonLibs) will fail, but we'll cheat and pretend that it didn't
SET(PYTHONLIBS_FOUND 1)
"""
# lines 891-893
"""
# and then we'll set the python config manually
SET(PYTHON_LIBRARIES "-L/home/doug/dev/python32_build/lib/python3.2/config-3.2m -lpthread -ldl -lutil -lm -lpython3.2m -Xlinker -export-dynamic")
SET(PYTHON_INCLUDE_PATH "/home/doug/dev/python32_build/include/python3.2m")
"""

cd /home/doug/dev/luxrender
mkdir build
cd /home/doug/dev/luxrender/build
BOOST_ROOT=/home/doug/dev/boost_1_43_0 cmake ../lux
make -j4


# ==============================================
# CHAPTER 9 - CONFIGURING LUXBLEND25 AND RENDERING
# ==============================================

cd /home/doug/dev/luxrender/luxblend25/src/luxrender
ln -s /home/doug/dev/luxrender/build/pylux.so


cd /home/doug/dev/blender/install/linux2/2.56/scripts/addons
ln -s /home/doug/dev/luxrender/luxblend25/src/luxrender


cd /home/doug/dev/blender/install/linux2
./start_blender
# --> switch user prefs, enable luxrender, save user prefs, set internal and render :)


# ==============================================
# CHAPTER 10 - MAKING A SCRIPT TO UPDATE EVERYTHING
# AND MAKING LIFE EASIER
# ==============================================

cd /home/doug/dev
gedit rebuild_all
"""
cd /home/doug/dev

# first blender
cd blender/blender
svn up
python scons/scons.py -j4

cd /home/doug/dev

# then luxrays
cd luxrender/luxrays
hg pull -u http://src.luxrender.net/luxrays
make -j4

cd /home/doug/dev

# then luxrender
cd luxrender/lux
hg pull -u http://src.luxrender.net/lux
cd ..
cd build
make -j4

cd /home/doug/dev

# finally, luxblend25
cd luxrender/luxblend25
hg pull -u http://src.luxrender.net/luxblend25

cd /home/doug/dev
# finished

"""

chmod +x rebuild_all

# test it
./rebuild_all


# make a link to blender install dir for convenience
cd /home/doug
ln -s /home/doug/dev/blender/install/linux2 blender
cd blender
./start_blender


# ==============================================
# FIN
# ==============================================
User avatar
dougal2
Developer
 
Posts: 3128
Joined: Mon Jan 14, 2008 7:21 am

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby rendermagic » Thu Mar 24, 2011 10:16 pm

I'm very much looking forward to this Doug. We have a fresh install of Ubuntu 10.10 with a GPU and we are planning to start setting it up the box for development. One thing we need to know how to do is how to compile lux on the box. I would love to be a guinea pig and try a build on the box. My only problem...I'm not a developer, so I'm hoping our sys admin or developer can figure it out.
Render Magic
----------------
i7 950 - Not OC'd
24G DDR3 RAM
2 GTX 580s
rendermagic
Developer
 
Posts: 141
Joined: Wed Mar 23, 2011 2:32 pm
Location: Leading edge of a photon (California USA)

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby dougal2 » Thu Mar 24, 2011 10:25 pm

It's the most boring video... you can literally sit and watch me type every command needed to make it work. I should be easy for almost anyone to follow. :)
User avatar
dougal2
Developer
 
Posts: 3128
Joined: Mon Jan 14, 2008 7:21 am

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby rendermagic » Thu Mar 24, 2011 10:51 pm

dougal2 wrote:It's the most boring video... you can literally sit and watch me type every command needed to make it work. I should be easy for almost anyone to follow. :)


LOL...thanks for the humor at this hour. I think I might watch your video and give it a try. I'm really looking forward to it. You have such PERFECT timing Doug!
Render Magic
----------------
i7 950 - Not OC'd
24G DDR3 RAM
2 GTX 580s
rendermagic
Developer
 
Posts: 141
Joined: Wed Mar 23, 2011 2:32 pm
Location: Leading edge of a photon (California USA)

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby drBouvierLeduc » Fri Mar 25, 2011 6:04 am

Being unable to compile a working build for a while, that's exactly what I was lookign for !
Thanks so much for taking time to write this guide.
User avatar
drBouvierLeduc
 
Posts: 32
Joined: Sun Oct 14, 2007 8:42 pm

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby dougal2 » Fri Mar 25, 2011 8:09 am

Video is now up.
User avatar
dougal2
Developer
 
Posts: 3128
Joined: Mon Jan 14, 2008 7:21 am

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby SlykDrako » Fri Mar 25, 2011 8:53 am

Thank you very much!
I couldn't compile luxrender with python 3.2, now I can, thanks to you :)
SlykDrako
 
Posts: 3
Joined: Mon Oct 22, 2007 10:13 am

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby rendermagic » Sun Mar 27, 2011 9:47 pm

I think these compile instructions do not include the nVidia CUDA openCL drivers. Here's how to do it. I'm not an Linux sysadmin, so this may not be the most efficient way to do it, but it worked for me.

  • Modifications to Chapter 4

    ##Nvidia Cuda openCL
    wget http://developer.download.nvidia.com/co ... u10.04.run
    sudo sh cudatoolkit_3.2.16_linux_64_ubuntu10.04.run
    LD_LIBRARY_PATH=/usr/local/cuda/lib
    export LD_LIBRARY_PATH

    ##need to append /usr/local/cuda/bin to the end of PATH //Check with your sysadmin on how to do this

    cd /usr/local/cuda/include/CL
    sudo wget http://www.khronos.org/registry/cl/api/1.1/cl.hpp
  • Modifications to Chapter 7

    Use this line instead of the one for ATI
    find_library(OCL_LIBRARY OpenCL /usr/lib)
  • Modifications to Chapter 8

    Use this line instead of the one for ATI
    find_library(OCL_LIBRARY OpenCL /usr/lib)

Hope this helps anyone who wants to use nVidia instead of ATI.

@Doug...please feel free to verify and reformat this
Render Magic
----------------
i7 950 - Not OC'd
24G DDR3 RAM
2 GTX 580s
rendermagic
Developer
 
Posts: 141
Joined: Wed Mar 23, 2011 2:32 pm
Location: Leading edge of a photon (California USA)

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby TimoK » Sat Apr 02, 2011 8:15 am

Thank you for this great tutorial. Everything compiles fine using Ubuntu Natty (11.04) and Nvidia but when I try to enable luxrender from blender it says: ImportError: No module named zlib. I have the zlib1g-dev installed but do I need something more?
TimoK
 
Posts: 2
Joined: Wed Feb 03, 2010 11:42 am

Re: Walkthrough: Building on Linux Mint 10 and Ubuntu 10.10

Postby dougal2 » Sat Apr 02, 2011 8:27 am

TimoK wrote:Thank you for this great tutorial. Everything compiles fine using Ubuntu Natty (11.04) and Nvidia but when I try to enable luxrender from blender it says: ImportError: No module named zlib. I have the zlib1g-dev installed but do I need something more?

Was zlib1g-dev installed before you built python, blender, boost and luxrender ?
User avatar
dougal2
Developer
 
Posts: 3128
Joined: Mon Jan 14, 2008 7:21 am

Next

Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 2 guests