「Dev:Doc/Building Blender/FreeBSD」の版間の差分

提供: wiki
移動先: 案内検索
 
(1版 をインポートしました)
 
(相違点なし)

2018年6月29日 (金) 04:42時点における最新版

NOTE: this page is now outdated, should be updated for FreeBSD 10, GIT and Blende2.7. Blender will build on FreeBSD, mostly steps are similar to Linux

Building Blender 2.6x or newer on FreeBSD

Instructions detailing how to build Blender 2.6x (or newer versions) from its git repository on FreeBSD.

Requirements

  • A recent FreeBSD installation (8.2 or newer)
  • Internet access
  • A checkout of the FreeBSD ports tree - OR -
  • The pkgng tools configured with a remote package repository

Getting the dependencies

Installing git

To get the blender sources from git, you will have to install git from FreeBSD's package repositories or ports tree. If you are using the ports tree, install git as root using

cd /usr/ports/devel/git
make install clean

During the installation, you might be asked to tweak git or one of its dependencies to your liking. Adjust the configuration settings as needed and proceed through the installation.

If you are using FreeBSD's pkgng package management tools and want to install git as prebuilt package, you can use

pkg install git

Installing Blender's dependencies

Depending on the build options for Blender, you want to choose later on, Blender can depend on a huge set of third party libraries and tools. The easiest way to install the required dependencies is to use FreeBSD's blender port from the ports tree and to install only its dependencies:

cd /usr/ports/graphics/blender
make config
make depends

make config will prompt you with a set of configuration options to choose from for building and installing Blender from the ports tree. Use this command to tweak the list of required dependencies your needs. make depends will build and install all dependencies of the blender port.

If you are using the pkgng tools, you can install the minimum set of default dependencies using

pkg install -A $(pkg rquery %do graphics/blender)

You can find a list of dependencies at the end of this article.

Getting the Blender sources

Once git and the dependencies are installed, please follow the instructions about getting a copy of the blender sources as described in the Dev:Doc/Tools/Git section.

Building Blender

Assuming you have checked out blender into ~/blender, switch into the directory and create a new one, which will be used for building.

cd ~/blender
mkdir build
cd build

To build blender, you have to configure it for the environment using cmake.

cmake ../

Before executing cmake, please read about the specific configuration settings below, especially for Cycles, since it requires you to invoke cmake differently.

Once the initial configuration has been done, you should tweak its settings with ccmake to fit the requirements of the FreeBSD system.

ccmake ../

Configuration settings

Most parts of Blender should be built against the provided system libraries rather than the libraries that ship with Blender.

  • The GLEW library of the FreeBSD system must be used rather than Blender's version. WITH_SYSTEM_GLEW hence must be switched to ON.

Cycles render engine with OSL support

FreeBSD's OpenShadingLanguage library (used optionally by the Cycles render engine in Blender) uses LLVM 3.3 and thus requires you to build Blender with LLVM 3.3. To do this. run cmake again with the following arguments:

cmake -DWITH_CYCLES_OSL:BOOL=ON -DLLVM_STATIC:BOOL=OFF -DWITH_LLVM:BOOL=ON -DLLVM_VERSION:STRING="3.3" -DLLVM_CONFIG:STRING="/usr/local/bin/llvm-config33"

Building and installing

To build Blender, you need to execute make and be patient.

make
Blender3D FreeTip.png
Parallel Builds
For multi-core / multi processor systems you can build much faster by passing the jobs argument to make: -jnumber_of_cores.

For example put "-j2" if you have a dual-core or "-j4" if you have a quad-core.
To figure out, how many CPUs are available on your FreeBSD system, execute

sysctl -n kern.smp.cpus

Sometimes this might break building though. If you are running into build failures, clean up and build again with only one job.

make -j3
... error on building ...
make clean
make


You will see quite a bit of output, and eventually be returned to your shell prompt. If Blender has been built successfully, you can install it using

make install

The installation will be done in the build directory. You can start and test blender with

bin/blender

or

cd bin
./blender

Dependencies

The following dependencies are needed for building blender, regardless of the chosen options.

  • lang/python33
  • devel/cmake
  • graphics/glew
  • graphics/jpeg
  • graphics/png
  • print/freetype2
  • x11-toolkits/libXmu
  • x11/libX11
  • x11/libXext

You can install each of the dependencies using either

cd /usr/ports/<dependency> && make install clean

when you are using the ports tree, or

pkg install <dependency>

when you are using pkgng.

If you are tweaking Blender's build using ccmake, the one or other option also requires you to install third party packages to enable Blender to build the feature properly.

Below is a list of the Blender options to adjust along with the FreeBSD ports or packages you need to install.

Blender Option FreeBSD port or package to install Important Notes
WITH_INTERNATIONAL converters/libiconv
devel/gettext
WITH_MOD_BOOLEAN devel/boost-libs
WITH_LIBMV devel/libunwind
WITH_OPENCOLLADA graphics/opencollada
WITH_CODEC_FFMPEG multimedia/ffmpeg
WITH_FFTW3 math/fftw3
WITH_JACK audio/jack
WITH_OPENCOLORIO graphics/opencolorio
WITH_IMAGE_OPENEXR graphics/OpenEXR
WITH_IMAGE_OPENJPEG graphics/openjpeg You also must set WITH_SYSTEM_OPENJPEG to ON
WITH_SAMPLERATE audio/libsamplerate
WITH_CODEC_SNDFILE audio/libsndfile
WITH_IMAGE_TIFF graphics/tiff
WITH_CYCLES graphics/openimageio
WITH_CYCLES_OSL graphics/openshadinglanguage
devel/llvm3
See the configuration notes regarding cycles for further details
WITH_OPENAL audio/openal-soft
audio/freealut
WITH_SDL devel/sdl12
WITH_X11_XINPUT x11/libXi
WITH_X11_XF86VMODE x11/libXi
x11/libXxf86vm