Guides for compiling Blender

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

SamAdam
Posts: 316
Joined: Thu Mar 04, 2004 1:28 pm
Contact:

Postby SamAdam » Mon Nov 08, 2004 3:25 am

theappleman's tut is gone.

does anyone have a copy of it?

ch
Posts: 57
Joined: Sun Sep 19, 2004 9:42 am

Postby ch » Mon Nov 08, 2004 8:20 pm

404 - Not found :roll:
http://www.web-play-3d.de
German site with Blender Tutorials

bannerboy
Posts: 67
Joined: Sun Sep 05, 2004 1:18 am

Postby bannerboy » Tue Nov 16, 2004 1:12 am

I recently decided to build blender off of cvs so I could get blender 2.35 early. I made a little script that builds blender from cvs using scons, and they notifys you when it's done. I also made a kde crystal-svg style blender-cvs icon for those of us who like to keep both the stable and the cvs versions arround.

anyway, here it is, tell me if you like it:
http://www.praiseworthybooks.com/jasons ... vs.tar.bz2
http://www.praiseworthybooks.com/jasons ... cvs.tar.gz

TheAppleMan
Posts: 4
Joined: Sat Jul 17, 2004 10:31 pm

Postby TheAppleMan » Sun Nov 28, 2004 11:51 am

SamAdam wrote:theappleman's tut is gone.

does anyone have a copy of it?


sorry bout that moved it to http://www.southanuk.co.uk/~theappleman/index.html
[EDIT]Redirects to blender.html[/EDIT]
Last edited by TheAppleMan on Wed Feb 02, 2005 10:08 pm, edited 1 time in total.

pazuzu
Posts: 9
Joined: Sun Aug 08, 2004 9:52 am

Compiling blender 2.36 under windows (not cygwin)

Postby pazuzu » Sun Jan 23, 2005 8:22 am

HI i have compiled blender2.36 for windows using sconsand vc++ 6, i found some problems:

* Many void* implicit casting that should be replaced for explicit type* casting.

*Some variables and their respective types have the same name ( ie: foo foo;) so when correcting castings u have some problems.

* I used openAl lib from creative (the new one) and found some windows functions changes its arguments, so you need to cast and change some callings, others openal libs doesnt work for me.

* the quicktime lib path could not be changed from the config.opts file so you need to change the sconstruct main file.

* Have to rename some lib from gnuwin32, like ftgl , some because sufixes like MTD or SDT were not in their names.

Some of the problems could be fixed changing the code under the respective #def WIN32 like OpenAl function calling, i compile blender 2.36 with the newest libraries for windows, and really spend many time on it because was my first blender compilation.
Hope this could be helpfull for ppl trying to compiled for windows and for source code and scons script fixing.

excuse me for my english, im not very good with it. :oops:

studmuffinuk05
Posts: 2
Joined: Thu Mar 10, 2005 11:27 pm

Compiling Blender using MSVC .NET 2003

Postby studmuffinuk05 » Fri Mar 11, 2005 7:23 am

Hi, i got blender to compile first time on my house mates computer.

here's what you do (until i get around to fixing the sln files properly for 2003, will release it when complete)

1 - download current version from CVS using batch file

FILENAME:blender.bat
@echo off
cls
echo creating directories
c:\
md develop
cd develop
md unstable
cd unstable

echo downloading BLENDER
cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender login
cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender co blender

echo downloading BLENDER LIBS
cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender login
cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender co lib


2 - copy the blender and lib directory to develop directory
3 - build the intern.sln, extern.sln then blender.sln
4 - you will have errors with blender.sln but this will be sorted by simply placing the directory location in the tools menu/options/projects/ in VC2003


i will release the new project files for vc.net 2003 in the next few days, so all you will have to do is simply download from cvs the blender and lib modules then unzip the my files into the blender directory. Or if anyone from the blender team reads this i'll send it to them instead so it can be added to the cvs

hope this helps

Gordon

-efbie-
Posts: 215
Joined: Wed Oct 27, 2004 9:47 pm

Postby -efbie- » Sat Aug 06, 2005 12:38 pm

Compiling blender on Ubuntu 5.04 Hoary for newbies
(no game engine...)
first, you need to install the following packages.

-cvs
-libsdl1.2-dev
-gcc
-g++
-ftgl-dev
-libopenal-dev
-libpng3-dev
-libjpeg62-dev
-libnspr-dev
-mozilla-dev
-libglut3-dev
-python 2.3-dev
-libxmu-dev
-libarts1-dev
-libsmpeg-dev
-arts

then, you create a directory where you'll put your cvs version of blender.
let's create "cvs-blender" in /home/username/

Open a console
type the following commands :

cd cvs-blender
cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender login
*** Password is "anonymous"****
cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender co blender
cd blender
gedit SConstruct
= > find the following code :

Code: Select all

if sys.platform == 'linux2' or sys.platform == 'linux-i386':
   use_international = 'true'
   use_gameengine = 'true'
   use_openal = 'false'
(...)
   build_blender_dynamic = 'true'
   build_blender_static = 'false'
   build_blender_player = 'true'
   build_blender_plugin = 'false'

replace it by

Code: Select all

if sys.platform == 'linux2' or sys.platform == 'linux-i386':
   use_international = 'true'
   use_gameengine = 'false' //Disable game engine
   use_openal = 'false'
(...)
   build_blender_dynamic = 'true'
   build_blender_static = 'false'
   build_blender_player = 'false' //Disable game engine player
   build_blender_plugin = 'false'

Save & exit gedit (not the console)
type the following command
scons
(...wait...)
if everything is fine you should see
scons: Nothing to be done for `default'.
scons: done building targets.

then you can launch blender with
./blender -w

If it doesn't work, and you have an error like
"can't find shared file xyz-lib.so"
search synaptic or google for xyz-lib and install the missing library, and post it here to complete the list :)

if you want to apply a patch, called "UberPatch.patch"
put it in your /cvs-blender/blender/ directory
then open a console and type :

cd cvs-blender/blender/
patch -p0 < UberPatch.patch

(you may need to install "patch" from synaptic)

for tuhopuu it's quite the same thing, except that you replace the cvs commands by

Code: Select all

 cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/tuhopuu login
 cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/tuhopuu co tuhopuu3

and there is no password (just enter)
Good luck :)

tv
Posts: 30
Joined: Thu Sep 08, 2005 9:31 pm

Postby tv » Thu Oct 13, 2005 8:39 pm

is it possible to build blender with mingw - windows?

if so, any optimizations for renderspeed possible (sse flags...)?

cfolchh
Posts: 7
Joined: Mon Apr 28, 2003 10:09 pm

Postby cfolchh » Mon Jan 16, 2006 12:17 pm

-efbie- wrote:first, you need to install the following packages.

-cvs
-libsdl1.2-dev
-gcc
-g++
-ftgl-dev
-libopenal-dev
-libpng3-dev
-libjpeg62-dev
-libnspr-dev
-mozilla-dev
-libglut3-dev
-python 2.3-dev
-libxmu-dev
-libarts1-dev
-libsmpeg-dev
-arts


Now, we need too:

-libtiff4-dev

;-)

snow
Posts: 28
Joined: Sun Jan 22, 2006 2:55 pm

Postby snow » Mon Feb 20, 2006 12:24 am

Fool-proof guide for building Blender with scons/mingw in Windows
It's now dead easy to compile Blender with scons and mingw. When you're finally fed up with msvc, try this. :wink:

Here's the steps:

1. Download the tools
You need mingw and scons. Get them here:
mingw: http://www.mingw.org/
scons: http://www.scons.org/

You also need a cvs tool. E.g. Any one of these should do:
wincvs: http://www.wincvs.org/
cvsnt: http://www.cvsnt.org/wiki/
tortoisecvs: http://www.tortoisecvs.org/

2. Get the blender sources and libraries from CVS:
Create a directory in for blender and type these commands into the console.

To get the sources:

Code: Select all

cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender login
cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender co blender


To get the libraries:

Code: Select all

cvs -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender login
cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender co lib


3. Build blender
Go into the blender subdirectory and type

Code: Select all

scons BF_TOOLSET=mingw


4. Copy the dlls
You need to copy all the necessary dlls into the install/win32-mingw directory (where you'll find blender.exe etc). This is easy just look at the error messages and find them in the lib directory.
Here's a list for you lazy people: :P
gnu_gettext.dll, libpng.dll, SDL.dll, zlib.dll

________________________________________________________________
Additional Notes
+ At the CVS password prompt you can just press enter. (Because this is anonamous CVS)
+ Step 4 might not be necessary very soon: JesterKing mentions that these will be copied automatically in the future.
+ Quicktime is not a dependency in this build (I think it's either impossible or extremely difficult to link with mingw)
+ Don't forget your essential scons guides (thanks to JesterKing): Scons Documentation, Scons Developer Documentation
________________________________________________________________
Troubleshooting
+ If you get a building error, the first thing to do is rebuild with BF_QUIET=0 added to the build command in order to get more information on what went wrong.
+ If you get the error Command line is too long, this means that the directory path you downloaded blender sources into is too long. The fix is pretty simple: Copy the blender and lib directories to a shorter path. (E.g. c:\B). (Yes I know - this is annoying :evil: )
Alternatively add BF_BUILDDIR=C:\build to the build command (Thank you Inktvlek! :D )
Also, a sudden stopping compile with no clear error (esp. when linking libsrc.a) is a sign of a too deep directory structure.
The only correct fix is to use BF_BUILDDIR, as it will ensure proper recompile on next run (you'll have to specify it always on command-line, or set it in user-config.py - a copy from config/win32-mingw-config.py in the same dir where SConstruct is) (Thank you jesterKing! ;) )
+ I had Blender crash on me when I added an OpenEXR background to the world... I have a nasty suspicion this might be due to the gcc openexr libraries??? I'm not sure. :?
Last edited by snow on Fri Feb 24, 2006 7:19 pm, edited 6 times in total.

Inktvlek
Posts: 6
Joined: Thu Aug 18, 2005 7:34 pm

Postby Inktvlek » Fri Feb 24, 2006 4:52 pm

Snow first of all, thanks for this nice guide! Togheter with this and jesterKing's help I was able to build Blender without any problems!

snow wrote:+ If you get an error Command line is too long, this means that the directory path you downloaded blender sources into is too long. The fix is pretty simple: Copy the blender and lib directories to a shorter path. (E.g. c:\B). (Yes I know - this is annoying :evil: )

You can also add "BF_BUILDDIR=C:\build", which is easier than moving all the stuff.

jesterKing
Site Admin
Posts: 1848
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Postby jesterKing » Fri Feb 24, 2006 6:02 pm

snow wrote:+ If you get an error Command line is too long, this means that the directory path you downloaded blender sources into is too long. The fix is pretty simple: Copy the blender and lib directories to a shorter path. (E.g. c:\B). (Yes I know - this is annoying :evil: )
Alternatively add BF_BUILDDIR=C:\build to the build command (Thank you Inktvlek! :D )


A nice tute snow!

Also, a sudden stopping compile with no clear error (esp. when linking libsrc.a) is a sign of a too deep directory structure.

The only correct fix is to use BF_BUILDDIR, as it will ensure proper recompile on next run (you'll have to specify it always on command-line, or set it in user-config.py - a copy from config/win32-mingw-config.py in the same dir where SConstruct is)

/Nathan

vizzy
Posts: 23
Joined: Tue Feb 28, 2006 12:36 am

yacs, yet another comile script........

Postby vizzy » Tue Feb 28, 2006 1:32 am

so today is my posting day... :))

here you can find a small description and a script to completely checkout blender from cvs (and yafray too) and compile. maybe someone finds it useful:
http://www.vizzy.de/index.php?p=&l=de&i ... rayfromcvs

(you dont need yafray if you dont use it, i actually have problems with yaf release version+blender-cvs, see notes on the site)

yours vizzy
alias verblendet

ideasman
Posts: 1000
Joined: Tue Feb 25, 2003 2:37 pm

Postby ideasman » Tue Mar 07, 2006 10:55 am

Attempt a tutorial that outlines some of these steps in greater detail.
Please edit. - Apart of the idea of the tutprial is not to incluce all options.
Rather the quickest way to get blender to compile.
http://mediawiki.blender.org/index.php/BlenderDev/SconsRefactoring#Scons.2FMingw.2FWin32_tutorial

snow
Posts: 28
Joined: Sun Jan 22, 2006 2:55 pm

Postby snow » Sun Mar 12, 2006 6:46 pm

ideasman: Shouldn't wiki tutorial be placed in BlenderDev/CodingTutorials instead? The refactoring project page seems a little bit of a strange home...


Return to “Coding Blender”

Who is online

Users browsing this forum: No registered users and 0 guests