From BlenderWiki

Jump to: navigation, search

Here you find information about how to build Blender on modern machines and distributions.

Troubleshooting
In case you're trying to build on old distributions, chances are that your package manager doesn't provide Python 3.2, Collada, etc: in those special cases please have a look at the troubleshooting page


To have latest Blender successfully running on Linux system you follow few simple steps.

This is not as hard as most people would think if you follow these instructions.

  1. Install needed package dependencies
  2. Download Blender source
  3. Compile Blender

Install the dependencies

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 \
 libspnav-dev

Get the source

The first step is to get the latest Blender source code from blender.org's SVN repository.

Copy and paste the following instructions into a terminal window. This creates a blender-svn folder in your home directory by downloading the latest source code commonly referred to as 'trunk'. An Internet connection is needed.

cd ~
mkdir blender-svn
cd blender-svn
svn co https://svn.blender.org/svnroot/bf-blender/trunk/blender

If you want to update your svn checkout to the latest source (in ~/blender-svn/blender/)...

svn up

Dependencies from SVN

To build with FFMPEG and Cycles enabled, various libraries are needed. These can be built manually or installed through repositories, but it is often easiest to get the precompiled libraries from our svn, since this ensures the right version is used. Once these are checked out, they will be automatically picked up and used by the build system.

Run this for 64bit linux:

cd ~/blender-svn
svn co https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux64 lib/linux64

For 32bit linux:

cd ~/blender-svn
svn co https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux lib/linux

Similar to the source code, this can be updated by going into ~/blender-svn/lib/<platform>, and running:

svn up

Compile Blender with Scons

Do I need to install Scons?

No, currently scons is embedded in Blenders' source code.

How do I configure Scons?

By default, Scons will pickup the right configuration file depending on your operating system (Linux, Mac, Windows, etc...) and architecture (32/64bit, etc). In the Blender source (see #Get the source above) these files are located in blender/build_files/scons/config/:

aix4-config.py
darwin-config.py
irix6-config.py
linux2-config.py
linuxcross-config.py
openbsd3-config.py
sunos5-config.py
win32-mingw-config.py
win32-vc-config.py
win64-vc-config.py

For example, if you are working on a 32bit machine with Linux, Scons will pickup linux2-config.py to setup the Blender build.

If all the parameters in that file work for you, just start building Blender (see below).

user-config.py
Chances are that you don't have a system Python 3.1 hence you have to build your own in a certain folder, or you want to build your own FFMPEG, or maybe you don't want to build the Game Engine, or the Blender Player, and so on.

In such a situation, you have to create a file called user-config.py in the root directory of the Blender source.

All the configuration in this file will override the ones in your Scons config file (in our example, linux2-config.py).


If you don't know what to put in user-config.py, please have a look at Scons default options to see their meaning.

In general, you have to copy some line from the default config file (in our example, linux2-config.py) and change the parameters that you want to override.

Building Blender

Note: since you intend to use Blender, you probably have a modern multi-core computer, so you should use the parallel build option to speed up the build. If you have a 2-core machine without hyperthreading, append -j 2 to the scons command. If you have a quad-core machine with hyperthreading, append -j 8 to the scons command.

cd ~/blender-svn/blender
python scons/scons.py

At the end of the build process you will have a blender binary and a message...

Install file: "/home/myname/blender-svn/blender/build/linux2/bin/blender" as
 "/home/myname/blender-svn/blender/install/linux2/blender"
scons: done building targets.
*** Success ***

to run blender from the root path "~/blender-svn/blender" you can create a symlink to the binary here... (the following example assumes you want the linux2 version)

cd ~/blender-svn/blender
ln -s ../install/linux2/blender ./blender

Now you can run by typing (in ~/blender-svn/blender)...

 ./blender

Rebuild after changing any files (in ~/blender-svn/blender/ )...

 python scons/scons.py

If you have a multi-core CPU you can compile with multi-threading using the following:

 python scons/scons.py -j 2

The number stands for the number of jobs, so if you have a quad-core CPU you could put "-j 4".

Scons options

For completeness, please check these scons options.