Here you find information about how to build Blender on modern machines and distributions.
In case you're trying to build on old distributions, chances are that your package manager doesn't provide a recent Python, 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.
- Install needed package dependencies
- Download Blender source
- Compile Blender
Install the dependencies
Automatic dependencies installation
install_deps.shscript featured with Blender sources. It currently supports Debian (and derived), Fedora, Suse and Arch distributions. When using the
install_deps.shscript, you are only required to install the following dependencies:
zypper install mc git gcc-c++
Then, get the sources and run
install_deps.sh as explained below.
To build with FFMPEG and Cycles enabled, various libraries are needed. These can be…
- Installed through your distributions repositories.
- Built manually.
- Skipped (many dependencies are optional).
- Managed by a script which checks for missing dependencies and installs them or compiles from sources.
The later solution is now the preferred one! Simply run:
cd ~/blender-git ./blender/build_files/build_environment/install_deps.sh
This script works for Debian/Redhat/SuSE based distributions, both 32 and 64 bits.
This scripts accepts some optional command lines arguments (use
--help one to get an exhaustive list), among which:
- Where to store downloaded sources for libraries we have to build (defaults to
- Where to install the libraries we have to build (defaults to
- Try to build OpenShadingLanguage. Note that this is still considered as experimental!
Some commands in this script requires sudo, so you'll be likely asked couple of times for your password.
When the script finish installing/building all the packages, it'll print which parameters for CMake and SCons you should use to use compiled libraries.
echo "/opt/lib/boost/lib" > /etc/ld.so.conf.d/boost.conf ldconfig
Manual dependencies installation
If you still want to use the “manual” way, you’ll need to install the following packages:
git, build-essential, libxi-dev, libsndfile1-dev, libopenexr-dev, libopenjpeg-dev, libpng12-dev, libjpeg-dev libopenal-dev, libalut-dev, python3.4-dev, libglu1-mesa-dev, libsdl-dev, libfreetype6-dev, libtiff4-dev, libavdevice-dev, libavformat-dev, libavutil-dev, libavcodec-dev, libswscale-dev, libx264-dev, libxvidcore4-dev, libmp3lame-dev, libspnav-dev, python3.4
As a final note, here are the key libraries that you may want to use with Blender:
- Python (3.4)
- Needed for interface scripts (building without Python is supported but not meant for general use).
- Boost (min 1.49)
- Necessary for Cycles, OSL, Audaspace, Internationalization…
- OpenColorIO (min 1.0)
- Necessary to handle color spaces.
- Necessary for Cycles and OSL (min 1.1 in this case).
- LLVM (min 3.0)
- Necessary for OSL.
- Enable custom shaders under Cycles.
- FFMPEG or libav (ffmpeg fork)
- For handling most video formats/codecs.
Get the source
The first step is to get the latest Blender source code from blender.org's GIT repository.
Copy and paste the following instructions into a terminal window. The following commands create a blender-git folder in your home directory by downloading the latest source code commonly referred to as 'master'. An Internet connection is needed.
mkdir ~/blender-git cd ~/blender-git git clone http://git.blender.org/blender.git cd blender git submodule update --init --recursive git submodule foreach git checkout master git submodule foreach git pull --rebase origin master
If you want to update your git clone checkout to the latest source do (in ~/blender-git/blender/):
git pull --rebase git submodule foreach git pull --rebase origin master
Compile Blender with CMake
From within your package manager, install:
- a cmake's configuration tool like
- ccmake (text based interface) or,
- cmake-gui (GUI configuration tool).
Automatic CMake Setup
If you're not interested in manually setting up CMake build directory, configuring, building and installing in separate steps, we provide a convenience makefile in blenders source directory which sets up cmake for you.
cd ~/blender-git/blender make
Updating blender is as simple as:
cd ~/blender-git/blender git pull --rebase git submodule foreach git pull --rebase origin master make
Once the build finishes you'll get a message like..
blender installed, run from: /home/me/blender-git/build_linux/bin/blender
There are some pre-defined build targets such as "make debug" or "make lite" - for a fast, small binary. For a full list of the optional targets type...
Manual CMake Setup
If you want to have more control over your build and have configuration, building and installation as separate steps or have multiple build directories for a single source dir. You can follow these steps.
Preparing CMake's directory
Let's suppose that you've checked out Blender's source in the folder
Please note that in some cases the "blender" directory may have a different name. Some branches are modified copies of the trunk/blender directory and are named e.g. soc-2009-name_of_participant.
Now you have to choose a location for CMake build files. In CMake you could do an "in-source" build or an "out-of-source" build, but currently in-source builds in Blender are not allowed.
By doing an "out-of-source" build you create a CMake's folder aside from
~/blender-git/blender, for example
mkdir ~/blender-git/build cd ~/blender-git/build cmake ../blender
This will generate makefiles in the build folder (
As said above, in-source-builds where you build blender from the source code directory are not supported.
If CMake finds a
If you have tried to do an in-source build, you should remove any CMakeCache.txt from the source code directory before actually running the out-of-source build:
rm -f ~/blender-git/blender/CMakeCache.txt
Editing CMake's Parameters
Note that CMake should detect correct parameters so you shouldn't need change defaults to simply to compile blender, this is only if you want to change defaults, make a debug build, disable features etc,
so you may want to skip this section for now and come back to it later if you want to make adjustments.
You can modify the build parameters in different ways:
~/blender-git/build/CMakeCache.txtfile in a text editor
- using cmake-gui if your distro supports it
- Opens a graphical interface where you can easily change parameters and re-configure things.
- using ccmake tool, with
- Opens a text interface where you can easily change parameters and re-configure things.
- cmake parameters can also be easily set on the command line, for eg.
cmake ../blender \ -DCMAKE_INSTALL_PREFIX=/opt/blender \ -DWITH_INSTALL_PORTABLE=OFF \ -DWITH_BUILDINFO=OFF \ -DWITH_GAMEENGINE=OFF
- These commands are exactly those found in
~/blender-git/build/CMakeCache.txtso you can copy commands from there and use them in the command line without running ccmake.
After changes have been done and you have generated the makefiles, you can compile using the make command inside the build folder:
cd ~/blender-git/build make make install
|For multi-core / multi processor systems you can build much faster by passing the jobs argument to make: -j(1+number_of_cores).
For example put "-j3" if you have a dual-core or "-j5" if you have a quad-core.
Note that it may build faster, but make your system lag in the meanwhile.
Also notice the install target is used, this will copy scripts and documentation into ~/blender-git/build/bin
For future builds you can simply update the repository and re-run make.
cd ~/blender-git/blender git pull --rebase git submodule foreach git pull --rebase origin master cd ~/blender-git/build make make install
Both portable & system installations are supported.
Portable installation is default where scripts and data files will be copied into the build '~/blender-git/build/bin' directory and can be moved to other systems easily.
If you want to share your build with others (for example through graphicall), you should statically link against as much libraries as possible.
Listing needed shared libs
You can see all needed shared libraries by simply running
Note: by default, Python is not static. To make it so, You'll have to edit
PYTHON_LYBRARY to something like
/usr/lib/x86_64-linux-gnu/libpython3.3m.a;/usr/lib/x86_64-linux-gnu/libexpat.a (exact paths depend on your OS).
Static Linking Each Library:
- Enable general static linking
- Set WITH_STATIC_LIBS to ON, so that CMake will try to make blender link against static libs, when available. Though not perfect, this should reduce quite nicely needed shared libs.
- Set the FFMPEG_LIBRARIES var to full paths of all needed libs (xvid, x264, etc.).
- Set (or create) Boost_USE_STATIC_LIBS to true. If you are using boost automatically built by the install_deps.sh script, you should not need to do anything else.
- But if you are using your own distro's boost package, you most likely will have to set (or create) Boost_USE_ICU to true too (and install the relevant libicu development package), to get blender linking.
TODO: other libs?
- Introduction to CMake
- Bill Hoffman presents CMake at GoogleEdu (starts at 7:41, relevant to cmake until 31:18)