From BlenderWiki

Jump to: navigation, search

[edit] Building Blender with VS 2008 Pro and SCons on Windows XP/Vista/7

Download and install the following applications / Libraries

  1. Visual Studio 2008 Pro
  2. Python 2.6.2 from here (SCons doesn't run yet with Python 3.x. Python dependencies for Blender are included in lib/windows). Install the 32bit version to build 32bit version of Blender. Only install 64bit version if you run a 64bit version of Windows - cross-compiling 64bit Blender on 32bit Windows isn't supported yet.
  3. SCons is included in Blender 2.50
  4. Subversion client from here

Create new folders:

  c:\BlenderSVN

open windows cmd: menu START-RUN type cmd press return

cd to c:\BlenderSVN

type:
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/blender

After you've checked out the Blender source code, fetch the dependencies,

type:
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows lib/windows

Download and install the Quicktime Dev Kit to c:\BlenderSVN\lib\windows\QTDevWin from here

open notepad and copy

BF_BUILDDIR = r'..\build'
WITH_BF_FFMPEG = True
WITH_BF_OPENAL = True
WITH_BF_QUICKTIME = True
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = False # set this to True whenever the player has been ported properly
WITH_BF_JACK = True
WITH_BF_SDL = True
WITH_BF_ICONV = True
WITH_BF_FFTW3 = False
BF_DEBUG = False
BF_NUMJOBS = 1

save the file as c:\BlenderSVN\blender\user-config.py

You can change true false settings in this file. Eg. if quicktime sdk is not installed set WITH_BF_QUICKTIME = False

If you have a multicore machine, set BF_NUMJOBS in the user-config.py to the amount of cores + 1. This should help in building Blender faster.

If building the x64 version use this user-config.py

BF_BUILDDIR = r'..\build'
WITH_BF_FFMPEG = False # not on win64
WITH_BF_OPENAL = True
WITH_BF_QUICKTIME = False #
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = False # set this to True whenever the player has been ported properly
WITH_BF_JACK = False # not on Win64
WITH_BF_SDL = True
WITH_BF_ICONV = True
WITH_BF_FFTW3 = False
WITH_BF_SNDFILE = False # not on win64
BF_DEBUG = False
BF_NUMJOBS = 1

Start the Visual Studio 2008 Command Prompt. If you haven't added your Python install to PATH through environment variables for system-wide, do

set PATH=C:\Python26;%PATH%
set PYTHONHOME=C:\Python26

Then CD into the blender checkout directory:

cd C:\BlenderSVN\blender

and run the compile command:

python scons\scons.py

If for whatever reason you need to rebuild from scratch you can clean the intermediate files with the command:

python scons\scons.py -c

When the build process is complete, go to c:\BlenderSVN\install\win32-vc and run blender.exe

[edit] Building Blender with MS VC++ Express 2008 and SCons on Windows XP/Vista/7

Download and install the following applications / Libraries

  1. MS VC++ Express 2008 from here
  2. Python 2.6.2 from here (SCons doesn't run yet with Python 3.x. Python dependencies for Blender are included in lib/windows)
  3. SCons is included in Blender 2.50
  4. Windows SDK from here
  5. Subversion client from here

Create new folders:

  c:\BlenderSVN

open windows cmd: menu START-RUN type cmd press return

cd to c:\BlenderSVN

type:
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/blender

After you've checked out the Blender source code, fetch the dependencies,

type:
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows lib/windows

Download and install the Quicktime Dev Kit to c:\BlenderSVN\lib\windows\QTDevWin from here

open notepad and copy

BF_BUILDDIR = r'..\build'
WITH_BF_FFMPEG = True
WITH_BF_OPENAL = True
WITH_BF_QUICKTIME = True
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = False # set this to True whenever the player has been ported properly
WITH_BF_JACK = True
WITH_BF_SDL = True
WITH_BF_ICONV = True
WITH_BF_FFTW3 = False
BF_DEBUG = False
BF_NUMJOBS = 1

save the file in c:\BlenderSVN\blender as user-config.py

You can change true false settings in this file. Eg. if quicktime sdk is not installed set WITH_BF_QUICKTIME = False

Open notepad and copy the batch script below:

PATH=%PATH%;C:\Python26;^
C:\BlenderSVN\lib\windows;^
C:\BlenderSVN\lib\windows\QTDevWin;^
C:\Program Files\Microsoft Visual Studio 9.0\VC\include;^
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include;^
C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib

cd lib\windows
svn update
cd ..\..\blender
svn update
python scons\scons.py

Save the file in c:\BlenderSVN as anynameyouwant.bat and execute it.

The batch file will update the svn files for both the source code and the dependencies, pause and wait for you to press to continue with building blender.

If you have a multicore machine, set BF_NUMJOBS in the user-config.py to the amount of cores + 1. This should help in building Blender faster.

Open c:\BlenderSVN\install\win32-vc and run blender.exe

Note, you could also separate the batch script to different .bat files one for each task.


[edit] Building Blender with MinGW and SCons on Windows XP/Vista

Download and install the following applications / Libraries

  1. MinGW - Minimalist GNU for Windows get latest from here
  2. Python 2.6.4 from here (Scons doesn't run yet with Python 3.x. Python dependencies for Blender are included in lib/windows)
  3. SCons is included in Blender 2.50
  4. Subversion client from here

Create new folders:

  c:\BlenderSVN

open windows cmd: menu START-RUN type cmd press return

cd to c:\BlenderSVN

type:
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/blender

After you've checked out the Blender source code, fetch the dependencies,

type:
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows lib/windows

Download and install the Quicktime Dev Kit to c:\BlenderSVN\lib\windows\QTDevWin from here

open notepad and copy

BF_BUILDDIR = r'..\build'
WITH_BF_FFMPEG = False
WITH_BF_OPENAL = True
WITH_BF_QUICKTIME = False # not working with MinGW
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = False # set this to True whenever the player has been ported properly
WITH_BF_SDL = True
BF_DEBUG = False
BF_NUMJOBS = 1

save the file in c:\BlenderSVN\blender as user-config.py

You can change true false settings in this file. Eg. if quicktime sdk is not installed or giving errors set WITH_BF_QUICKTIME = False

Open notepad and copy the batch script below:

PATH=%PATH%;C:\Python26;^
C:\BlenderSVN\lib\windows;^
C:\BlenderSVN\lib\windows\QTDevWin;^
C:\BlenderSVN\lib\windows\pthreads\lib;^
C:\BlenderSVN\lib\windows\pthreads\include;^
C:\MinGW\bin;^
C:\MinGW\lib

cd lib\windows
svn update
cd ..\..\blender
svn update
pause
python scons/scons.py BF_TOOLSET=mingw

Save the file in c:\BlenderSVN as anynameyouwant.bat and execute it.

The batch file will update the svn files for both the source code and the dependencies, pause and wait for you to press to continue with building blender.

If you have a multicore machine, set BF_NUMJOBS in the user-config.py to the amount of cores + 1. This should help in building Blender faster.

Open c:\BlenderSVN\install\win32-mingw and run blender.exe

Note, you could also separate the batch script to different .bat files one for each task.