From BlenderWiki
Home | SVN - Compile Blender with SCons & jesterKing!
NOTE: Settings in this Article are NOT Official Blender Settings! Especially Compiler Settings! Do NOT report Blender Bugs traced on unofficial builds only! Compile on your own Risk!
Linux, Debian based Distributions (Ubuntu, etc...)
Well, it's always good to know how to compile Blender if you are curious about fresh new Blender stuff. jesterKing is the Man behind Blender SCons. He is one of those cool guys who are always (err.. when they have free time...) ready to help. He's also smart enough to give you funny answers to your own stupid questions! :) A Real King! In my case I wanted to check the new Verse integration and I couldn't find latest Blender build with Verse, so I asked jesterKing on IRC about latest Blender builds:
- <jesterKing> \o/
- <jesterKing> You can build Blender easily with scons :]
- He was optimistic as always!
- <jesterKing> Tools: svn, scons, gcc/g++
- <oxigen> Oh, cool! Will you help me?
- <jesterKing> Sure!
When I've been quickly checking for tools, he added: I'll be online for about 2 more hours :). Well, I didn't expect that I will need his help that long, but he was right, actually he went away before I finished... :) Meanwhile I decided to make a short Blender SVN build guide out of our conversation. So here it is for my Linux Ubuntu system, which is most likely a bit different than yours (who read this & U are not me? :), but don't worry, JesterKing did a good job, as you will see!
So I needed to install new svn, python-dev, some sounds-dev libraries, ... Here is how it all went down. Below are my building steps under jesterKings guidelines:
Change Directory where to Build Blender, in my case:
$ cd /home/compile
Log in as Super User:
$ sudo su
Update apt database:
# apt-get updateInstall Python development packages:
# apt-get install python2.5-devInstall Scons:
# apt-get install sconsInstall SVN:
# apt-get install subversionCreate directory where you will compile blender and move to it:
# mkdir /home/compile; cd /home/compileExecute SVN ''($ man svn - read manual about svn command)'':
# svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/blender- Note: For the next step, it may be easier to install build dependencies using the command:
sudo apt-get build-dep blender
After this command SVN created blender subdirectory and I received from svn.blender.org a zillion Modules, Directories & other misc stuff needed for a new Blender Build. Everything went smooth, so I was able to move to /home/compile/blender where I finally started to compile blender with scons. After first command:
scons WITH_BF_VERSE=1
There were some errors because of my sound & OPENAL settings, so jesterKing supplied me a new scons command & showed me a new secret passage to blender scons documentation: /home/compile/blender/doc
Change Directory:
# cd /home/compile/blenderExecute SCons:
# scons WITH_BF_VERSE=1 WITH_BF_OPENAL=0This command started compiling and produced a zillion Warning messages, I was nervous, but jesterKing was cool as always:
"Warnings can be ignored. Blender source is ridden with them :)
This will create a "normal" build. If you want a debug build, you'll have to set BF_DEBUG=1 like this:
scons WITH_BF_VERSE=1 WITH_BF_OPENAL=0 BF_DEBUG=1
But first see if this works."
It's also good idea to set in Konsole a large amount of log lines to catch first error message. After a while I started recieving Error messages in console like this:
In file included from source/blender/imbuf/intern/dynlibtiff
source/blender/imbuf/intern/dynlibtiff.h:48: error: syntax error before ‘*’ token source/blender/imbuf/intern/dynlibtiff.h:48: error: syntax error before thandle_t ... etc</source>
JesterKing pointed out another command for solving such errors:
Search for development ''(dev)'' packages which including missing stuff, in this case tiff libraries ''(check the console for the very first error message!)'':
# apt-cache search tiff | lessInstall missing libtiff4:
apt-get install libtiff4-dev
After installing all missing dev packages and repeating the command scons WITH_BF_VERSE=1 WITH_BF_OPENAL=0, the brand new & latest fresh newborn Blender with Verse was ready for action! Fortunately SCons compile every module just once, so you will not need to compile all day, but compiling Blender for the first time took more than expected. Two hours just wasn't enough for me on my old 1.7GHz really_crappy_intel_card... :)
More about scons flags read in /home/compile/blender with:
scons -hIf you want to compile with new commited changes in SVN, then just:
Change Directory
# cd /home/compileExecute svn again:
# svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/blender... Change Directory /home/compile/blender & Recompile.
- Thank you jesterKing, it was fun again! :) --Igor 12:47, 12 October 2006; updated 17 September 2007 (CEST)
SVN - Blender Optimizing, Patching & Splashing New Screening!
So, you want to compile Blender optimized for your hardware? Want to try some new fancy Blender feature, which isn't implemented in the latest Blender builds yet? Or you want to have your own fancy Blender Splash Screen when Blender start? Well, if you survived Blender Compiling tutorial, all this shouldn't be the problem for you.
Blender Optimization
- For Blender Optimization you need to edit SCons user configuration file: user-config.py. Check out my user-config.py with some comments.
Blender Patching
- For Blender Patching - implementing a new Patch in Blender, you'll need to install program 'patch' on Linux ('apt-get install patch' Debian, Ubuntu, etc) . On Windows try to install 'TortoiseSVN Patch'. OSX has GNU patch as default, I guess... I use Linux so I can't say for sure what tools to use on other operating systems and how to use it, but you'll probably get an idea anyway...
It looks that are programmers not very user friendly for other people but for them self only, so I'll also try to explain a few things which might confuse some common people like I am... :)
After installing program 'patch' you must find the 'patch file' which will add some new feature to the main Blender. Such 'pieces' of Blender code which they also name 'patches' are written by different programmers with a different manners. This can be confusing sometimes because some programmers use different naming for a file extensions! So you can find patches with the names like 'patch_name.patch', 'patch_name.diff' or even 'patch_name.txt'! You see what I mean!? :) Anyhow, on this url you can also find other patches, but I will use as an example for this tutorial patch made by Brecht Van Lommel and Matt Ebb. Glossy reflections/refractions patch, but on this tracker you can also find other patches and bug fixes as well:
If you scroll this page down you will find on the bottom files with a names: gloss01.txt, gloss02.txt, ..., gloss12.patch. Pick and download latest file (in this case gloss12.patch) and save it somewhere, let's say in: /home/compile/blender/patch, then first try to apply it with a '--dry-run' flag:
- # cd /home/compile/blender
- # patch --dry-run -p0 < /home/compile/blender/patch/gloss12.patch
So, if you don't get any error you can proceed with a real patching, this time without '--dry-run':
- # patch -p0 < /home/compile/blender/patch/gloss12.patch
After this step you just need to recompile Blender and that's it!
Blender Custom Splash Screen
Lucky me! Chickencoop already wrote how to add Blender custom splash screen. Check it out here!
- Kudos for useful tips goes to: BeBraw, UnNamed, ZanQdo, ddwagnz, mfoxdogg and Lynx3d!
Good luck with Blender compiling, patching and splashing!
Compiling Blender 2.5
You can compile Blender 2.5 the same way, you just need to replace SVN checkout step as written before with:
# svn checkout https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender
Blender 2.5 is its own branch, so it's good idea to make a separate directory for it on your local computer. In my case: /home/compile/blender2.5
Check also
- Blender SVN usage: http://www.blender.org/development/coding-guides/svn-checkout-and-usage/
- Another Linux/Debian/Ubuntu Compiling Tutorial.
- Read this part of Manual about compiling Blender on other operating systems.
- Read this part of Manual about installing Blender on other operating systems.
- http://www.geneome.net/index.php/blender-tutorials/building-blender-with-msvc
- http://mpan3.homeip.net/page?compileblender
- Create your own splash screen!
Additional notes
You can also compile Blender on Linux with GNU Make, but there are some rumours about migrating Blender on CMake. Maestro Nathan Letwory alias jesterKing said that he will still support SCons. \o/
