From BlenderWiki
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.
- Install needed package dependencies
- Download Blender source
- Compile Blender
Install the dependencies
install_deps.sh script featured with Blender sources. It currently supports Debian (and derived), Fedora and Suse distributions. In this case, you should only install those dependencies:
zypper install mc subversion gcc-c++Then, get the sources and run install_deps.sh as explained below.
If you still want to use the “manual” way, you’ll need to install those packages:
Install Packman repository
zypper addrepo http://packman.jacobs-university.de/suse/11.3/ packman
or use Yast to install Packman repository.
Then install the dependencies:
zypper install mc subversion gcc-c++ libSDL-devel \
openal-soft-devel libffmpeg-devel \
libpng-devel libjpeg-devel python3-devel libtiff-devel OpenEXR-develAs a final note, here are the key libraries that you may want to use with Blender:
- Python (3.3)
- Nearly mandatory!
- Boost (min 1.49)
- Necessary for Cycles, OSL, Audaspace, Internationalization…
- OpenColorIO (min 1.0)
- Necessary to handle color spaces.
- OpenImageIO
- Necessary for Cycles and OSL (min 1.1 in this case).
- LLVM (min 3.0)
- Necessary for OSL.
- OpenShadingLanguage
- Enable custom shaders under Cycles.
- FFMEPG
- For handling most video formats/codecs… Please note that the so-called ffmpeg package of official Debian (& co) repositories is actually the libav fork, which is not supported by Blender!
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
NOTE: If you have never used SVN before you may get the error
Certificate verification error: signed using insecure algorithm (https://svn.blender.org)
To get around this problem, you need to add the following line to the bottom of your ~/.subversion/servers file:
ssl-trust-default-ca = no
If you want to update your svn checkout to the latest source (in ~/blender-svn/blender/)...
svn upAutomatic dependencies installation
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-svn ./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:
--source <path>- Where to store downloaded sources for libraries we have to build (defaults to
~/src/blender-deps). --install <path>- Where to install the libraries we have to build (defaults to
/opt/lib). --with-osl- 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
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.pyIf you don't have a system Python 3.2 and the package isn't available you may have to build your own and install to a custom location, 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 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.pyIf 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.