Building Blender

(Redirected from Dev:Doc/Building Blender)

Building Blender

Instructions

Steps to build Blender from scratch for each operating system.

The instructions will guide you through these steps:

  • Install dependencies (git, subversion, C/C++ compiler).
  • Checkout Blender's source code from version control.
  • Compile the source code into an executable.

Resolving Build Failures

Most building problems are not actually errors in Blender's source code, although you can never fully rule out that possibility. See this page for possible causes and where to get help.

Build System

Blender uses the CMake build system.

make wrapper

For quick setup, the make wrapper takes care of setting up CMake automatically, and has quick commands for various tasks. It must be run from the Blender repository root directory. The most important commands are:

make help    # List all available commands.
make full    # Build with all features enabled.
make update  # Update source code, add-ons and libraries to latest versions.
make test    # Run automated tests.

Output

By default, make outputs the build and project files to to ../build_<platform>. The Blender executable will be located in ../build_<platform>/bin.

To change this location, see make help or manually run cmake. Be sure to generate the build files in a directory other than the source directory.

Customization

By default, the CMakeCache.txt configuration file will be in ../build_<platform>. Many CMake options can be set to customize the build.

The configuration can be edited using the CMake GUI (ccmake), or by manually editing CMakeCache.txt.

Build Files

For developers, the build system can be edited in the following files:

  • CMakeLists.txt throughout the source tree
  • ./build_files/cmake/*
  • GNUMakefile and make.bat for wrappers

Setup for Developers

For efficient development of the Blender C/C++ code, install and set up an Editor or IDE to navigate and edit the source code. See the build instruction for each platform for more details.

We recommend developers to configure CMake to enable debugging features and tests. More details about tools for Blender development are here. The main options can be configured as follows with the make wrapper.

make debug developer

debug will make a debug build, and developer will configure CMake options for development, like address sanitizer.

For faster builds, the Ninja build system can be used. If ninja is installed and available in the path, it can be added to the make command when setting up the build folder. If there already exists a build folder with a different build system, it must removed first. Example command to set up ninja build:

make debug developer ninja

On Linux and macOS, ccache also helps make rebuilds faster, especially when switching between git revisions and branches. If ccache is installed, It can be used by setting CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER to ccache in the CMake configuration.

Library Dependencies

Details on obtaining libraries are included in each platform's build documentation. See here for details on how this system works and how to make portable builds.

Compiler Versions

Compiler Official Release Version Minimum Supported Version
Linux GCC: 7.1 4.8
Linux Clang: - 3.5
macOS Xcode: 10.0 8.0
Windows Visual Studio: 2017 2015

Other Build Configurations