Building Blender 2.5x on FreeBSD
Instructions detailing how to build Blender 2.5x on FreeBSD, currently for FreeBSD 8.2 i386/amd64
Note that this article is a work in progress. All materials presented here apply only to FreeBSD 8.2 and more specifically to the i386/amd64 architectures, until otherwise specified.
If you already have FreeBSD 8.2 installed
First you'll need to become root so you can get the additional libraries Blender is going to need in order to compile correctly using the most common settings.
...type in root password
Now to make things easier, we'll get a program called portmaster. This is not required for building Blender, but it will make getting the dependencies easier and save you time.
pkg_add -r portmaster
Just to be sure you can use portmaster after pkg_add returns, we'll do a quick rehash.
Then try to get all the dependencies. This step is going to take a bit of time...
portmaster audio/freealut audio/lame audio/libsamplerate \ audio/libsndfile audio/openal-soft devel/cmake \ devel/gettext devel/gmake devel/sdl12 \ devel/subversion graphics/glew graphics/ilmbase \ graphics/jpeg graphics/libGL graphics/libGLU \ graphics/OpenEXR graphics/openjpeg graphics/png \ graphics/tiff lang/gcc44 lang/python32 \ multimedia/ffmpeg multimedia/x264 multimedia/xvid \ print/freetype2 x11/libXi
During this step's execution you will be asked to make several choices about which options you'd like to compile these ports with. Blender has been successfully compiled and run by accepting all the default values on all screens asking for you to make a choice.
During the initial configuration of all the ports you can quickly accept the defaults on each screen by pressing →, ←, ↵ Enter. Nothing special about that key sequence, it's just a quick way of getting focus to the button and hitting ↵ Enter on it.
If you are not using IPv6 for internet access, you could uncheck the IPv6 options along the way if you'd like. Blender compilation does not require them by any means. This would mean you could arrow up and/or down to the IPv6 options for a few ports such as the following:
- python31 or python32
At this point, portmaster will ask you to press Y to proceed. Go ahead and press Y.
During the fetching, compiling, and installing process, portmaster may occasionally ask you if you'd like to delete various .tbz files it has fetched. It's probably safe to delete them, but in the chance you'd want to reinstall those ports later, it will save you from having to re-fetch them if you leave them in /usr/ports/distfiles/.
Once all the compiling is set and done, you should have all the dependencies for compiling Blender.
If all went well so far, you can press CtrlD to exit the superuser prompt and be returned to the regular user's shell.
Getting Blender Sources
Now we need to make a directory to put Blender's source files into, and then actually get the sources into that directory.
cd ~ mkdir blender-svn cd blender-svn svn co https://svn.blender.org/svnroot/bf-blender/trunk/blender
You'll see a bunch of files get fetched by subversion which is the program we executed by typing svn in that last command and eventually be returned to the shell prompt once again.
Now we'll need to make a directory to compile Blender in. Since we are still in our ~/blender-svn/ directory, and we now have sources under ~/blender-svn/blender/ we can just do the following:
mkdir build cd build
Now it's time to build Blender. We'll be using cmake to do this. It should be straight forward.
Currently FreeBSD builds must use system GLEW, so we need to set that option for cmake.
- Arrow down to WITH_BUILTIN_GLEW which should be near top of the list, and by default is set to ON. Press [ENTER] to switch it to OFF. Press [C] to configure, then [G] to generate and exit.
Now we need to make Blender. This is done with:
|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.
You'll see quite a bit of output, and eventually be returned to your shell prompt.
At this point, we simply need to install Blender with:
Performing that step will ensure the correct transfer of Python files and such to the directories where Blender is going to expect them.
You should be able to test your new Blender by running:
cd bin ./blender
Updating Blender once you've already successfully built before
You can update your copy of Blender to the latest and greatest version at any time using the following:
cd ~ cd blender-svn/blender svn up cd ../build make -j''N'' ''(were N is number of cores + 1)'' make install
Then your Blender should be up to date. :)