Building Blender with Cycles in Ubuntu 11.10 (with CMake)

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
Posts: 1
Joined: Mon Apr 16, 2012 9:43 pm

Building Blender with Cycles in Ubuntu 11.10 (with CMake)

Post by marunowskia » Tue Apr 17, 2012 12:09 am

I had a heck of a time getting blender 2.62 ...(r45704)... to build in Ubuntu, and figured I would post the steps I took to finally get it working.

Again, these steps are targeted at users who want to build blender with gpu the new rendering engine.

These steps are basically a combination of
1) ... s/Building
2) ... untu/CMake

As following the steps in order on each page individually resulted in build failure.

Before you get started, if you want CUDA support, be sure to download the latest CUDA drivers from NVidia's CUDA webpage. To test that you have installed the drivers correctly, go ahead and download the CUDA SDK, and verify that you can compile and run some of the CUDA SDK samples. (If you don't want CUDA, or don't have an NVidia card, just ignore this paragraph)


sudo apt-get update; sudo apt-get install subversion build-essential 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 libavdevice-dev \
libavformat-dev libavutil-dev libavcodec-dev libjack-dev \
libswscale-dev libx264-dev libmp3lame-dev python3.2-dev \

sudo apt-get install git-core

cd ~

mkdir blender-cycles
cd blender-cycles
mkdir boost
cd boost

download ... z/download to your ~/boost directory

Note that several of the following commands can require super-user access. If you get a permission denied error, just prefix the command with "sudo ".

(More steps)
cd ~
cd boost
tar xzf boost_1_47_0.tar.gz
cd boost_1_47_0/
sudo ./bjam -j4 variant=release link=static threading=multi --with-filesystem --with-thread --with-regex --with-system --with-date_time stage install --prefix=../

cd ~
cd blender-cycles
sudo git clone git://
cd oiio
sudo git checkout RB-0.10
mkdir -p build/linux
cd build/linux
sudo cmake ../../src/ -DBUILDSTATIC=1 -DBOOST_CUSTOM=1 -DBoost_INCLUDE_DIRS=`pwd`/../../../boost/include/ -DBoost_LIBRARY_DIRS=`pwd`/../../../boost/lib -DBoost_LIBRARIES="boost_date_time;boost_filesystem;boost_thread;boost_regex;boost_system" -DCMAKE_INSTALL_PREFIX=`pwd`/../../dist/linux
sudo make -j4 install

Here's where I had the most problems. One of the times I tried running the command "svn co ... k/blender/ blender", I ended up with a blender directory that was seemingly incomplete, and was missing many of the CMakeLists.txt files. For whatever reason, when i tried just plain old "svn co ... nk/blender" it worked correctly. Therefore, that's what I'm suggesting you to do here.

If you find cmake is complaining that it can't find the CMakeLists.txt files, try downloading the blender source again, that helped for me.

(Last steps)

svn co ... k/blender/ blender
mkdir build

cd build

sudo cmake ../blender -DOPENIMAGEIO_ROOT_DIR=../oiio/dist/linux -DBOOST_ROOT=../boost -DBOOST_CUSTOM=1 -DBoost_INCLUDE_DIRS=`pwd`/../boost/include/ -DBoost_LIBRARY_DIRS=`pwd`/../boost/lib -DBoost_LIBRARIES="`pwd`/../boost/lib/libboost_date_time.a;`pwd`/../boost/lib/libboost_filesystem.a;`pwd`/../boost/lib/libboost_thread.a;`pwd`/../boost/lib/libboost_regex.a;`pwd`/../boost/lib/libboost_system.a"

sudo make -j4 install

You should now be able to run blender by running the following command:

I can't guarantee that this is the simplest series of steps needed to build blender 2.62 with cycles, but I can tell you... " It works on my machine :) "

Hope this helped.

Keep up the awesome.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests