Merge branch 'cb/mesh'
[plumiferos.git] / INSTALL
blob79f9b0e6fa0edc61684a5630ff41c7f7b5b353b5
1 This file is to help you get started using the source and will hopefully
2 answer most questions.  If you do have any problems with these instructions,
3 post a message to the Forums on www.blender.org, or visit us at #blendercoders
4 on irc.freenode.net
6 The build documentation is also available through the website:
8 http://www.blender3d.org/cms/Building_Blender.117.0.html
10 This should have the most up-to-date build documentation at all times.
13 Here are some links to external packages you may or may not need:
15 python:      http://www.python.org
16 libjpeg:     http://www.ijg.org/
17 libpng:      http://www.libpng.org/pub/png/
18 zlib:        http://www.gzip.org/zlib/
19 ode:         http://opende.sourceforge.net/
20 openal:      http://www.openal.org/home/                (for linux/windows)
21     sdl:     http://www.libsdl.org/index.php (for openal)
22     smpeg:   http://www.lokigames.com/development/smpeg.php3 (for openal)
23 fmod: http://www.fmod.org/
25 mozilla: http://www.mozilla.org/
26 nspr:  ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases
27         (side note: on debian linux you will need mozilla-dev and libnspr-dev)
29 glut:    http://www.opengl.org/developers/documentation/glut.html
31 If you do not have OpenGL you will also need mesa:
32 mesa:    http://www.mesa3d.org
34 If you want to compile with QuickTime enabled, download the SDK for your OS:
35 quicktime:   http://developer.apple.com/quicktime/
37 For the translations to other languages than English you will need gettext,
38 freetype2 and FTGL. Note that these translations are not complete yet, some
39 time after the release of 2.27 they will be made available for download also.
40 We welcome feedback about the translated user interface, and even contributions
41 to the translation effort :)
43 gettext:     http://www.gnu.org/software/gettext/
44 freetype2:   http://www.freetype.org/
45 FTGL:        http://homepages.paradise.net.nz/henryj/code/#FTGL
47 FTGL needs a small patch to get glyphs with the right colour in the cache
48 --- FTGL/src/FTPixmapGlyph.cpp.orig     2003-05-10 16:07:45.000000000 +0200
49 +++ FTGL/src/FTPixmapGlyph.cpp  2003-05-10 16:09:19.000000000 +0200
50 @@ -33,3 +33,3 @@
51          // Get the current glColor.
52          float ftglColour[4];
53 -        glGetFloatv( GL_CURRENT_COLOR, ftglColour);
54 +        ftglColour[0] = ftglColour[1] = ftglColour[2] = ftglColour[3] = 1.0;
57 You may also need to modify the typedef for GLUTesselatorFunction in 
58 src/FTVectoriser.cpp if you are on an undefined system.  To do that
59 check the following link to find out various platform identifiers:
60 http://www.blender3d.org/cms/Names.146.0.html#299
62 _____________________________
63       ADDED FTGL NOTE:
64 _____________________________
66 ftgl now has been patched so much, that it's included in CVS/lib/
67 The sources for the patched ftgl will be made available soon...
72 *********************************************************************
73 *********************************************************************
75 There are two build systems for unixy platforms, the old NaN Makefiles 
76 and the brand new SCons-based system.
78 The NaN system is best understood, if you want to use the configure system,
79 please help improve it. SCons has been added as a new build system for
80 Blender and it has expanded in a short time, proving to be a quite handy
81 build system.
83 *********************************************************************
84 *********************************************************************
88 --------------Basic Makefile TIPS---------------------------------------
91 First of all, make sure 
92 1) you have the full source tree available, either via CVS or as source download. 
93 2) you have the libs dir (CVSROOT/lib/ or bf-blender/lib/ ) checkout as well
95 Read about that here;
96 http://www.blender3d.org/cms/Building_Blender.117.0.html
98 In bf-blender/blender/source you can find several .mk files, these are the
99 main makefile templates, used all over the Makefiles in the source tree.
101 Edit source/nan_definitions.mk to fit your environment, be sure to edit the
102 block matching your OS. You will want to change variables like 
103 NAN_JPEG, NAN_PNG, NAN_PYTHON etc. to point to where you have those installed.
105 Also check on source/Makefile, for potential conflicts with how you configured
106 your system. In general this is not needed though.
108 If you want to be able to run in 'make' in any subdirectory, you also need to
109 set 2 environment variables;
111 NANBLENDERHOME : should point to the bf-blender directory
112 MAKEFLAGS: "-w -I$NANBLENDERHOME/source"
114 After adjusting things for your environment you can run 'make' (or use the nice hmake
115 script at blender/source/tools/hmake/hmake).
117 1) run 'make' in bf-blender/intern/
118 2) run 'make' in bf-blender/extern/
119 3) run 'make' in bf-blender/source/
121 The last step should result in the blender binary. But, first check the TIPS below 
122 for the specific OS's.
124 NOTE 1:
125 It is possible that compiling fails because a directory to save objects and libs to was
126 never created before. These all go to bf-blender/obj/xxxxx/ , where xxxx stands for the
127 'guessconfig' name of your OS/CPU configuration.
128 You can run 'guessconfig' here: bf-blender/source/tools/guess/guessconfig
130 NOTE 2:
131 That same 'guessconfig' name is used to read from bf-blender/lib/
132 Since that directory comes from cvs, easiest is to create a symlink to that dir with the
133 correct name.
138 ----------------------Basic SCon TIPS-----------------------------------
140 More documentation on the scons system is available at
141 blender/doc/blender-scons.txt and blender/doc/blender-scons-dev.txt.  Where
142 this document and those conflict, those are much more likely to be right.
144 To be able to build with the SCons build system you'll need Python (preferably
145 version 2.4.x) and SCons (http://www.scons.org) installed. After you're
146 sure these work properly you are ready to build with SCons.
148 Systems supported at the moment are:
149 * Linux (Michel_)
150 * Windows (jesterKing)
151 * Irix (Hos)
152 * Cygwin (Michel_)
153 * MacOS (sgefant)
155 All except Linux build with this system against the precompiled libraries,
156 so be sure to get them from CVS, ie. for Windows:
158 cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender co lib/windows
160 Be sure to do this at the same level your blender directory is at
161 (ie. /home/username/build/blender and /home/username/build/lib/OS).
163 Not all are entirely complete yet, but the system itself is very usable.
165 Quick tip 1: type 'scons' to build it.   (If you get errors edit config.opts
166         so that it matches your system)
167 Quick tip 2: type 'scons clean' to clean your build tree.
168 Quick tip 3: You should also remove/rename user_config.py any time SConstruct
169         has changed.
171 The main file of interest is the SConstruct file in the blender 
172 directory. Open this file and browse to the section that concerns your
173 system. Set any options as necessary (the true/false switches, the
174 rest should work out-of-the-box).
176 When you're satisfied with the settings you should run scons. For most systems
177 that is just in the command-line in the directory containing the SConstruct
178 file. If you want to, you can use the switch -j N for benefiting more processors,
179 and --debug=time for timing the entire build process.
181 If you are on Windows and you want to compile with MSVC (6 and 7) you'll need
182 to run vcvars32.bat in your command-line (DOS-box) to set the necessary
183 environment variables. Be sure to browse to the blender top-directory. Type
184 'scons' and watch the build fly by.
186 For the Windows build the QuickTime SDK is expected to be at
187 lib\windows\QTDevWin\CIncludes
189 lib\windows\QTDevWin\Libraries,
190 but you can alter the SConstruct file to point it to the path you have your
191 QuickTime SDK installed.
194 ----------------------WINDOWS TIPS--------------------------------------
196 When building Blender on Windows you have three choices:
197 METHOD 1. Build using the old NaN Makefiles.
198 METHOD 2. Use Microsoft Visual Studio project files (msvc6 and msvc7)
199 METHOD 3. Use SCons (see above)
201 These directions are for method 2. Method 1 was used in Nan in combination 
202 with Cygwin.
204 If you are using Method 1 with cygwin you need to set FREE_WINDOWS 
205 to true you can do this with: export FREE_WINDOWS=true
207 EXTERNAL LIBARIES
208 All external libraries that Blender depends on are found in CVS in 
209 precompiled form. If you did not already do so, check out lib/windows from CVS using
211 cvs -z3 -d:pserver:anonymous@cvs.blender.org:/cvsroot/bf-blender co lib/windows
213 [NOTE: Make sure you are in the directory where the blender directory resides,
214 NOT in the blender directory itself! lib/windows must be in the same dir as
215 blender to make the VC project files work correctly.]
216 If you prefer to build or download those libraries yourself, there are some
217 directions below.
219 INTERN LIBRARIES:
220 The first thing you need to do is to build the Blender "intern" libraries.
221 You need to have Python installed on your machine.
223 Open the workspace in the $NANBLENDERHOME/intern/make/msvc_6_0 (msvc_7_0 if you
224 want to build with .NET) directory.
225 Build the "build_install_all" project. This will build all the intern libraries
226 and installs them in the $NANBLENDERHOME/../lib/windows directory.
228 If you get weird compiler errors, make sure you have the latest Visual Studio
229 Service Pack installed. SP5 worked for me.
231 If the post build step (copying the libraries to their destinations) fails,
232 this is probably due to the fact that MSVC can't find the XCOPY command as 
233 happened to me on an XP system. MSVC has it's own PATH that you can set through
234 the options. Open options from the menu: Tools->Options. Go to the directories
235 tab and select "Executable files" from the drop down menu. Now add you SYSTEM32
236 directory.
238 The last project build is the python_freeze project that will freeze python code
239 for compilation and linking with Blender's C code. At the moment, this should be
240 automatic except that batch file probably does not find Python. If this is the
241 case, follow the same procedure as was mentioned above for the XCOPY command
242 to add Python to your path.
244 BUILDING BLENDER
246 Open the workspace $NANBLENDERHOME/projectfiles/blender/blender.dsw or the
247 solution $NANBLENDERHOME/projectfiles_vc7/blender/blender.sln
249 blender           Builds the main executable
251 Choose the project blender and hit F7. If all is well it should build
252 with a lot of warnings but no errors.
254 BUILDING/DOWNLOADING EXTERNAL LIBRARIES
255 If you don't want to use the precompiled libraries you can download and/or
256 build them yourself. Here are some directions.
258 JPEG:
259 BINARY LIBRARY:
260 Go to sourceforge.net, navigate to the GnuWin32 project and download 
261 libjpeg-6b-lib.zip. Rename the unzipped directory "jpeg" and copy it to the 
262 $NANBLENDERHOME/../lib/windows directory.
263 FROM SOURCES:
264 Download the jpeg sources from http://www.ijg.org/. Go into the source 
265 directory and copy the file jconfig.vc to jconfig.h. Now start a command box
266 and run nmake /f makefile.vc (assuming nmake is in your path, if not run the
267 vcvars32.bat batch file located in the VC98/Bin directory of the MSVC 
268 installation directory first).
269 Copy these include files: jconfig.h, jerror.h, jmorecfg.h, jpeglib.h
270 from the build directory to the lib tree in this directory:
271 $NANBLENDERHOME/../lib/windows/jpeg/include
272 The file libjpeg.lib should be copied to:
273 $NANBLENDERHOME/../lib/windows/jpeg/lib
275 PNG:
276 Go to sourceforge.net, navigate to the GnuWin32 project and download 
277 libpng-1.2.4-1-lib.zip. Rename the unzipped directory "png" and copy it to the 
278 $NANBLENDERHOME/../lib/windows directory.
280 ZLIB:
281 Go to sourceforge.net, navigate to the GnuWin32 project and download 
282 zlib-1.1.4-lib.zip. Rename the unzipped directory "zlib" and copy it to the 
283 $NANBLENDERHOME/../lib/windows directory.
285 QUICKTIME:
286 The blender.sln expects the Quicktime SDK to be in lib/windows/QTDevWin, which
287 should contain the directories CIncludes and Libraries.
291 ----------------------Mac OSX TIPS--------------------------------------
293 When building Blender on OSX you have two choices:
294 METHOD 1. Build using the old NaN Makefiles.
295 METHOD 2. Use the SCons build system (see above)
297 Step1:
298 If you want to follow method 1, follow the "Basic Makefile TIPS" above to set the
299 environment variables. You don't need to edit the Makefiles. They should work
300 out of the box in combinations with some external libraries that should be on
301 your system in a fixed location. 
303 Step 2:
304 You can use the package installer fink (http://fink.sourceforge.net/) for some
305 of the external libraries:
306 1. jpeg    (fink install libjpeg)
307 2. png     (fink install libpng3)
308 3. cvs     (fixes some bugs in the shipped cvs: fink install cvs)
309 4. python23 ((adds the static lib for python) fink install python23)
310         You will probably want to select python-nox when
311         it asks you. (Also read python note below)
312 5. freetype (fink install freetype2)
315 If you use OSX 10.3, the python framework is part of the OS installation, so you
316 don't have to use the fink installer for it. The Makefile is configured for 10.3
317 by default, so for 10.2 you have to open source/nan_definitions.mk and comment out:
318         export PY_FRAMEWORK     = 1    
320 Step 3:
321 The rest of the external libraries are present in CVS in binary format so you
322 don't have to download them. Precompiled libraries are found in CVS in 
323 directory:
324 $NANBLENDERHOME/lib/darwin-6.1-powerpc
325 If you are not running on a darwing kernel 6.1 (which is likely if you auto-
326 update your system, you might want to add a symbolic link in the 
327 $NANBLENDERHOME/lib/ directory. For example, if you work on a 6.2 kernel:
328 ln -s darwin-6.1-powerpc darwin-6.2-powerpc
330 Step 4: 
331 Start the build process by building Blender's "intern" libraries. Navigate to 
332 $NANBLENDERHOME/intern and type make. This will build the intern libraries which
333 will be installed into the $NANBLENDERHOME/lib/darwin-6.1-powerpc (thanks to 
334 the symbolic link).
335 Do the same for the $NANBLENDERHOME/extern directory
337 Step 5 
338 Navigate to $NANBLENDERHOME/source and type make. 
340 Step 6:
341 Although the Makefiles in the intern directory run ranlib on the libraries 
342 built, the gcc linker complains about ranlib not being run. Until there is a
343 solution, you will need to run ranlib by hand once in a while when the make 
344 breaks. Luckily, the error message lists the full path of the file to run 
345 ranlib on... so just type "ranlib */*.a" or so. :)
348 BUILDING EXTERNAL LIBRARIES
349 If you don't want to use the precompiled libraries you can download and/or
350 build them yourself. Here are some directions.
353 FREETYPE
354 - the freetype lib in /usr/X11R6 installed by apple X11 SDK dont work in blender (not the standard lib)
355 - both those installed by fink and darwinports can work, or you can compile your own. in any case, 
356 dont move these libs from their install location or you will break other libs (like fgtl) that rely on them. 
358 * if you must move them, edit freetype-config and adjust prefix variable (3rd line). 
359 * always keep freetype-config in the bin directory of the new location
360 * for blender, safer to set enable_shared=no
361 * to build easily those unix libs create a symbolic link as follow :
362             sudo ln -s /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers /usr/include/GL
363 * build the unix version, not the mac one
364 * use ./configure then make and make install
365 * the CVS version of freetype-config has the path on my computer, adjust it to yours if you want to rebuild fgtl
367 FGTL
368 * freetype must be already installed and working
369 * build the unix version, not the mac one
370 * set FT2_CONFIG var to the full path of freetype-config
371 * configure with the following options --without-x  --with-ft-prefix=PFX --with-ft-exec-prefix=PFX where PFX is the valid path
374 ----------------------NetBSD TIPS--------------------------------------
375 NetBSD (and other platforms using pkgsrc)
377 Quick Install
379 cd /usr/pkgsrc/graphics/blender
380 make install
382 In-depth Instructions
384 NetBSD's Packages Collection provides for easy installation from 
385 source on a multitude of platforms (NetBSD, Linux, OpenBSD, FreeBSD, 
386 Darwin, IRIX).  You should be able to compile and install Blender 
387 easily by simply changing into the directory 
388 /usr/pkgsrc/graphics/blender and issuing the command 'make install'.  
389 This will automatically download the sources, verify their integrity, 
390 download and install all necessary dependencies and build and install 
391 Blender.  Please see for details:
392         http://www.netbsd.org/Documentation/software/packages.html
393         http://www.netbsd.org/Documentation/pkgsrc/
396 Note that there are a few flags you can set to compile in support for 
397 additional packages.  Search /usr/pkgsrc/mk/bsd.pkg.defaults.mk for 
398 "BLENDER" variables and set them according to your preference in 
399 /etc/mk.conf
401 If you experience problems building the package, please use send-pr(1)
403 on your NetBSD system or submit a problem report via:
404  http://www.netbsd.org/cgi-bin/sendpr.cgi?gndb=netbsd