Dev:Doc/Building Blender/old

提供: wiki
< Dev:Doc‎ | Building Blender
2018年6月29日 (金) 02:44時点におけるYamyam (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Compiling the sources

This document describes the tools necessary to build Blender from source, either from CVS or from a source package. Building from CVS requires the use of more tools. While this may be a bit more troublesome than building from a source package, this may be necessary for some people. For example, when you want to build Blender for an unsupported platform or when you want to implement some new features.

This is a very early version of this document. This means that it is incomplete and that some procedures or concepts might be incorrect for your system. Please keep this in mind when reading this. Also keep in mind Blender is a complex product which will require you to create the right environment for.

Getting the sources

The following paragraphs will describe how and where to get the sources needed for building Blender.

Get the latest stable source package

The sources are available on the CDROM accompanying this book. You can also download it from the website, http://www.blender3d.org/cms/Source_Code.12.0.html

Get the latest sources from CVS

CVS stands for Concurrent Versioning System. It is a software configuration tool that keeps the various source files in a central repository. CVS enables developers to quickly update to the latest state of the repository and commit changes. The tool keeps track of the changes between each version of a file. To get the current state of the repository, you don't need to have a username for accessing the sources. To commit changes to the repository, however, you need to have developer access. Since this document only describes how to get the latest state of the sources, the commit procedures are not described here.

To get the latest state of the sources use:

export CVSROOT=:pserver:anonymous@cvs.blender.org:/cvs01

cvs login

password: ↵ Enter

cvs -z3 co blender

Please do not use a higher level of compression for accessing the Blender server.

If you already have a working set of files obtained from the server, you can use the update command to update the sources to the current state of the repository. cd to the blender source tree on your system and type in the following command:

cvs -z3 update .

External libraries needed

Blender is a package that uses a lot of external packages for expanding its functionality. Each of these packages have, just as Blender, a history of changes. Newer versions of such a package will probably have more features and less known problems. As a developer it is exciting to work with the latest features available to get the most out of the tool. However, the number of developers out there is much lower than the number of end-users who are not interested in the latest feature, these users want an application that works. Since Blender has to run on multiple platforms, all those platforms have to have the same minimum functionality available in the external packages.

The table below displays the packages needed and the minimum version of those packages. Over time it is possible that those minimum versions are increased as the demand for the newer features is high.

LibraryVersion
glibc2.2.4
libjpeg6b
libpng1.0.14
libsdl1.0
libz1.1.4
mesa3.4.2
openALN/A
openGL1.1 (1.2 for engine)
python2.2

Not all libraries apply to all platforms. The following table gives an overview of the currently supported platforms and the required libraries. An 'X' means that it is needed, a '-' means that it is not needed and an 'O' means that it is optional.

LibraryLinuxWindowsFreeBSDIRIXMacOS X
glibcX-XXX
libjpegXXXXX
libpngXXXXX
libsdlOOOOO
libzXXXXX
mesaXXX--
openALXXXXX
openGL---XX
pythonXXXXX

Tools needed

Having the necessary libraries installed and the Blender sources downloaded to your system means that you're now able to build Blender. The entire build process requires some tools to be available on your system. In the table below, the list of tools along with the minimum version is shown. The third column shows if the tool is required for CVS only ('X'). If the tool is not required for a source package build, a '-' is shown.

ToolVersionCVSNote
autoconf2.53X
automake1.6.2X
cvs1.11.1p1X
docbook3.1O
doxygenN/AO
gawk3.1.0X
gcc2.96-
gettext0.11-
gmake3.79.1-
m41.4X
sed3.02X
sh2.05.1-
Visual C++6.0 SP5-Windows only
Python

Python is not included in this table although it is used to build Blender. The reason that it is not included is because Python is also needed as an external library and thus has to be installed already as has been written in the previous section.


Building Blender

There are two build systems for using gcc or cc compilers: regular Makefiles, which stem from the period Blender was developed in the company NaN, and the automake/autoconf "configure" style one. Using "configure" can write over the NaN Makefiles, so you have to choose either one.

For Windows MSVC, Blender supports the use of project files and workspaces.

The files describing detailed build information are located in the blender root directory:

  • INSTALL: general information, download links for libraries
  • INSTALL.AUTO: using autoconf and configure scripts
  • INSTALL.MAKE: using regular makefiles
  • INSTALL.MSVC: using Microsoft Visual C++ project files

Prerequisites to Building Blender 2.42a on SUSE Linux

  1. Ensure Python is installed (2.4 or better): http://www.python.org
  2. Ensure scons is installed: http://www.scons.org

Building Blender 2.42a on SUSE Linux

Follow the instructions below for SUSE Linux.

Prerequisites

  1. Ensure Python is installed (2.4 or better): http://www.python.org
  2. Ensure scons is installed: http://www.scons.org

Compile

As the "root" user, do the following (note there may be other dependencies not listed here):

  1. Get Blender: http://www.blender.org
    1. blender-2.42a.tar.gz
  2. Get OpenAL and ALUT: http://www.openal.org
    1. openal-0.0.8-1.i586.rpm
    2. openal-devel-0.0.8-1.i586.rpm
    3. freealut-1.1.0-1.i586.rpm
    4. freealut-devel-1.1.0-1.i586.rpm
  3. Get OpenEXR: http://www.openexr.com
    1. openexr-1.4.0a.tar.gz
  4. Install OpenAL and ALUT:
    1. rpm -ivh openal-0.0.8-1.i586.rpm openal-0.0.8-1.i586.rpm
    2. rpm --force --nodeps -ivh freealut-1.1.0-1.i586.rpm freealut-devel-1.1.0-1.i586.rpm
    3. ln -s /usr/lib/libopenal.so /usr/lib/libopenal.so.1
  5. Create symbolic link for libgettextlib:
    1. ln -s /usr/liblibgettextlib-0.14.3.so /usr/liblibgettextlib.so
  6. Install OpenEXR:
    1. cd /usr/local/src
    2. tar zxf openexr-1.4.0a.tar.gz
    3. cd openexr-1.4.0
    4. ./configure --prefix=/usr/local --enable-shared && make && make install && ldconfig
  7. OpenEXR 1.4.0a has a bug that prevents Blender from being compiled. To fix it:
    1. Edit all these files: /usr/local/include/OpenEXR/Imf*.h
    2. Change every occurrence of #include <ImfXXXXX.h> to #include "ImfXXXXX.h".
    3. For example: #include <ImfIO.h> must be #include "ImfIO.h"
  8. Install Blender
    1. cd /usr/local/src
    2. tar zxf blender-2.42a.tar.gz
    3. cd blender-2.42a
    4. scons BF_INSTALLDIR=/usr/local/blender-2.42a-py24
    5. cd /usr/local
    6. ln -s blender-2.42a-py24 blender

Technical Support