Compiling Blender 2.45 on Windows...The easy way


Alternate guide: Compiling Blender 2.45 on Windows. Advanced Guide.

Please follow the guide precisely. The guide also assumes all software installations use the default path


1. Acquire Blender source code and libraries

- Download and install tortoisesvn from: tortoisesvn.tigris.org
-created a folder named "blender" under c:\build, select the folder and click on SVN checkout, and use the following location:
https://svn.blender.org/svnroot/bf-blender/trunk/blender
-created a folder named "windows" under c:\build\lib, select the folder and click on SVN checkout, and use the following location:
https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows


2. Acquire compiling softwares

- Download and install Python 2.5.1 (9MB) from www.python.org
- Download Mingw 5.1.3 (~10MB) from www.mingw.org . Run the installer, Pick any mirror, Select Current and install packages MinGW BASETOOLS and G++ COMPILER.
- Download and install SCons 0.97 Windows (300KB) from www.scons.org


3. Environment setup

- Go to Start Menu >> Control Panel >> System >> Advanced (Tab) >> Environment Variables (button) >> System Variables scroll area double click on the PATH item
- Add the following line to the end: ;C:\Python25;C:\mingw\bin
- Copy libpython25.a from C:\Python25\libs to C:\build\lib\windows\python\lib
- If you are running Windows Vista: add also ;C:\MinGW\libexec\gcc\mingw32\MinGW-Version where MinGW-Version is the Version of MinGW you are using.


4. Compile!


Before you start, this is how the everything should look like: (Ignore user-config.py for now, that is covered in the advanced guide)
compile blender using gcc


- Open a command prompt window by click on Start >> Run >> type in "cmd" and hit OK.


- Navigate to where the Blender source code is by typing this into the command prompt cd C:\build\blender


- Start the building process by:
scons BF_BUILDDIR=c:\install -j2


- The above command should take about 5-10 minutes to process, and it helps if you have a dual-core processor!


- When it finishes, (Hopefully without error), you can navigate to C:\install\win32-mingw\ and find a complete Blender installation ready to be zipped up and distributed!










Where to go from here?

You might want to rid the blender.exe of extra useless debug data by entering the following command into the command line:
strip C:\install\win32-mingw\blender.exe
This will reduce the size of the executable by 8mb or so without having any negative impact


scons clean BF_BUILDDIR=C:\install
can be used to clean the build data and getting ready for a new build


Once you have successfully compiled Blender, you can try more customization by following the Advanced Guide.




Acknowledgement: A big thanks goes to Nathan Letwory(jesterKing), lukep, Jonathan Jacobs and Johnny Matthews for the BlenderDev/SconsRefactoring article at mediawiki.blender.org; and jmk for pointing me to the python25.a solution.

Comments

On Apr 29, 2008, samran Said:
i get error
'cl.exe' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [C:\install\intern\SoundSystem\intern\SND_AudioDevice.obj] Error 1
scons: building terminated because of errors.
C:\build\blender>scons clean BF_BUILDDIR=C:\install
scons: Reading SConscript files ...
what i have to do ?
thanks
On Apr 29, 2008, samran Said:
i use windows vista 32 and i add the PATH
On Apr 29, 2008, Mike Pan Said:
uh cl.exe is the microsoft visual studio compiler. The problem is that Scons is calling the wrong compiler, when it should call GCC.

Instead of
scons BF_BUILDDIR=c:\install -j2

Try:
scons BF_TOOLSET=mingw BF_BUILDDIR=c:\install -j2
On Apr 30, 2008, samra Said:
thanks man
run good in first 2minit than
alooooooot of Error and in the end have this
scons: *** [C:\install\bin\blender.exe] Error 1
scons: building terminated because of errors.
thanks
On Apr 30, 2008, samran Said:
Oooo done thanks man i am so happy Done
On May 05, 2008, Camwood Said:
Real interested in getting this system setup.
Everything works except 'scons'

- is not recognised as an internal or external command etc...

I have Python running on my XP system fine.
MingGW and everything else is good as well.
I am aiming for a totally open source system and so I have kept away from Visual C++ .

Any one know what is wrong?
I am no expert.
On May 06, 2008, daniel Said:
i get to the command line fine, but it tells me that scons in not recognized as an internal or external command, operable program, or batch file
On May 07, 2008, Daniel Said:
Never mind, I got it fixed.

@Camwood
Just restart your computer, that should do the trick.


A Mike Pan Design.