So I’ve been itching to get my fingers on the development build of Blender 2.5. Mainly because I want to start becoming familiar with the new features and interface, and I want to start experimenting with some of the source code. So I began by following the directions from the Blender developer site. The build process was not that hard for me even though it took about 3 hours for me to resolve some of the build errors I was getting. The reason it was pretty easy is because there was a lot of documentation through various parts of the web which explain how to do this. So I just read through some of them and eventually got the build to function properly without any errors. Now I have Blender 2.5 running on my system and will continue to get updates as we move through the development process.
In the meantime I wanted to provide a stripped down example of how I got Blender running on my computer. This is so someone with a similar setup as me can try and get Blender 2.5 up and running as fast as possible. Please note that I am not an expert in this build process. If you are having trouble please reffer to the documentation I used or post on the Blender Artists forums or the Blender IRC.
Another important thing to note is that I used Scons to build Blender. This is what was used in the documentation I had available and so this is what is in this tutorial.
OS: Ubuntu 9.04
Hardware: Dell Latitude D820 Laptop, two Intel 2.0 Ghz Processors, 512 MB of ram, 80 GB Hard Drive, NVIDIA Gfx Card.
Getting the Needed Dependencies
In order to build Blender properly you will need to have on your system the needed 3rd party libraries that Blender uses. One way to do this is to download the “lib” folder from the Blender repository which will contain all the binaries for the needed libraries. Oddly I didn’t find any link to the repository and didn’t know how to get it myself so I just decided to install the libraries anyway. To do that first open up a terminal and type the following command:
sudo apt-get install svn build-essential scons g++ libx11-dev libgl1-mesa-dev libxi-dev zlib1g-dev libpng12-dev libglu1-mesa-dev libjpeg62-dev libfreetype6-dev libtiff4-dev libopenexr-dev libsdl1.2-dev libopenal-dev libfftw3-dev libsamplerate0-dev libjack-dev libavformat-dev libxvidcore4-dev libogg-dev libfaac-dev libfaad-dev libx264-dev libmp3lame-dev libvorbis-dev libtheora-dev libswscale-dev libavdevice-dev libalut-dev
Enter your password and then follow the terminal prompts as it will attempt to install all of the libraries and packages listed in the above command. Also note that the last package in the list, libalut-dev, was not mentioned as something that needed to be installed. I had to install it on my system because of an error the build was spitting out. More info about that library can be found at:
http://packages.ubuntu.com/source/hardy/freealut
Next we have to get Python 3.1 complied and working on our system. Now this an installation because want to make sure we keep Python 2.6(or whatever version you have) installed on our system. This is so other programs like Blender 2.49, which rely on the more stable version of Python still know where to find the stable version. So create a directory on your system where you want to keep Python 3.1. For example I chose to create:
mkdir /home/ronbravo/Library/python
Of course you can be whatever or wherever you want. Now download the compressed source file for Python 3.1 which can be found here. Unzip the file and into the newly created python directory you should have created from above. Then type in the command below, also rememeber to replace the directory in –prefix=”/home/ronbravo/Library/python” to point to the directory you created for Python.
./configure –prefix=”/home/ronbravo/Library/python“; make
sudo make altinstall
To test to make sure that Python 3.1 is working just type the full path to the directory that you created for python plus the path to the python binary. For example on my system I would type:
/home/ronbravo/Library/python/Python-3.1.1/python
Which should return something like:
Python 3.1.1 (r311:74480, SepĀ 9 2009, 08:33:52)
[GCC 4.3.3] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>>
which places you inside the Python interactive interpreter. Just press Ctrl-D to exit the interpreter. That means Python 3.1 is up and running on your system without interffering with the currently working version that you may have. You can doulbe check this by typing in the terminal:
python –version
and you should see something like:
Python 2.6.2
This is good because it means your system is still recognizing your old installation.It is important to remember the Python 3.1 directory you created(In my case: /home/ronbravo/Library/python/Python-3.1.1) because you will need it later on when
Getting the Blender 2.5 Source Code
In order to compile Blender 2.5 you will need to grab the source code from the Blender Foundation repository. Before this is done you should create a directory on your system where you would like to keep the source code. For me I just created a new project directory:
mkdir /home/ronbravo/Projects/blender_development
cd /home/ronbravo/Projects/blender_development
Now just tell the SVN program, which should have been installed when the dependencies got installed, to grab the source code from the Blender 2.5 repository:
svn checkout https://svn.blender.org/svnroot/bf-blender/branches/blender2.5
After that open you will need to open up the scons config file to add a new settings and point the scons build process to where you are keeping Python 3.1. So just type into the terminal the following commands:
cd blender-svn/blender2.5/blender/
gedit user-config.py
This should launch the gedit program that comes with Ubunutu so that you can edit the user-config.py file. If you’re using a different distro or flavor of Ubuntu, then just replace the word gedit with the name of a text editor that is on your operating system.
In the file add the following lines:
BF_OPENAL_LIB = ‘openal alut’
BF_PYTHON=”/home/ronbravo/Library/python/Python-3.1.1″
Note that the BF_PYTHON option should be pointing to the directory where you are keeping python 3.1 on your system. Then save the file and close. Now type in the following the commands to get Blender to build:
python scons/scons.py
From there Blender should begin compiling and you should have a working build with in several minutes. Now if at some point the build process comes across an error the build will stop and output some information about that error. Try to figure out what it means, but if you can’t then post on the Blender Artists forums or the Blender IRC.
If everything went well, in the terminal you should see something like this:
scons: done building targets.
And you should be returned back to the terminal prompt. The executable binary for blender should be located one level above the current directory you are in. So for example on my system we could find it from:
Directory where we compiled the source code: /home/ronbravo/Projects/blender_development/blender-svn/blender2.5/blender
Directory where the Blender 2.5 was placed: /home/ronbravo/Projects/blender_development/blender-svn/blender2.5/install/linux2
So just go into that Blender directory and you’ll find the blender binary file. Double click on the file and Blender 2.5 should be up and running. One thing you may want to do is copy this directory somewhere else. This is so if you ever recompile a version that has some serious bug, you will have a compiled version that is somewhat working.
So in the future if you wanted to get a newer update of 2.5 just go back to the source code directory, update the source, and fire off the build process again. For example on my system it would be:
cd /home/ronbravo/Projects/blender_development/blender-svn/blender2.5/blender
svn update
python scons/scons.py
Go grab a bite to eat and when you come back, a new and update version of Blender 2.5 should be waiting for you. Enjoy your new development build of Blender 2.5, I know I will. C ya.
One other thing, if nothing seems to work and you just can’t get Blender to run, remember you can always download uploaded development builds from Graphicall.org. Of course and personal changes to Blender that you make won’t be in these builds but at least you will have the chance to give it a go.
References:
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/2.5/Linux
http://feeblemind.tuxfamily.org/dotclear/index.php/2009/07/11/109-compiling-blender-250-svn-on-kubuntu-904
http://feeblemind.tuxfamily.org/dotclear/index.php/2007/12/09/104-compiling-blender-for-kubuntu-710
http://packages.ubuntu.com/source/hardy/freealut