Page 1 of 1

Compiling Questions: HUGE file size, patches, and... config?

Posted: Mon Oct 03, 2005 4:49 am
by Fred_Pyo
Hi everyone,

I've decided to venture into the world of compiling, and I must admit using the CVS to get the latest features is wonderful! (Except when it gives tons of errors, like the ones I'm having now... but that's no the issue right now)

My situation:
I'm currently using Cygwin and all the little nifty packages necessary for it to build Blender.

Questions:
1. The compiled binaries I get are... GIGANTIC! The file blender.exe itself has 10 Mb compared to the 5 Mb file that I get from the official (and some non-official) builds? Is there a flag or something I can set to fix this?

2. I have downloaded the particle patch, I am not very sure what to do with it... my guess is that I have to compile it along with the rest of the source of blender... now, how do I do this?

3. One time a friend told me that normally opensource applications have a configuration script (or something like that) that allows the user to customize some aspects of the build to match the user's system? Is this possible too in blender? (For example, that Intel optimized build?)

Thanks for the replies!

Re: Compiling Questions: HUGE file size, patches, and... con

Posted: Mon Oct 03, 2005 8:25 am
by jesterKing
Fred_Pyo wrote: 1. The compiled binaries I get are... GIGANTIC! The file blender.exe itself has 10 Mb compared to the 5 Mb file that I get from the official (and some non-official) builds? Is there a flag or something I can set to fix this?
Perhaps you are building debug builds? Someone more knowledgable about 'make' of blender should answer this (but see also answer on your third question).
Fred_Pyo wrote: 2. I have downloaded the particle patch, I am not very sure what to do with it... my guess is that I have to compile it along with the rest of the source of blender... now, how do I do this?
If the patch is created in the source root dir, go to the blender sources root and do:

Code: Select all

patch -p0 < ../path/to/patch_file.txt
Fred_Pyo wrote: 3. One time a friend told me that normally opensource applications have a configuration script (or something like that) that allows the user to customize some aspects of the build to match the user's system? Is this possible too in blender? (For example, that Intel optimized build?)
Blender doesn't have autoconf scripts for customising builds. Instead there is a hand-coded Makefile system, and a cool SCons (http://www.scons.org - see the SConstruct in the source root directory, and the SConscript-files in subdirs) implementation. If you want to customise your build, edit source/nan_definitions.mk (as mentioned here) ) for make and the config.opts that is created on first run when using SCons (see here and here).

Have fun!

/Nathan

Posted: Mon Oct 03, 2005 9:29 am
by levon
you could try striping it
its as easy as:

Code: Select all

strip blender.exe

im makes it a bit smaller, and apparently a bit faster.

Posted: Tue Oct 04, 2005 4:17 am
by Fred_Pyo
Thanks for the replies!

jesterKing:
Hmmm, eager to understand how to deactivate the "debug" build... will search around the forums, thanks!

About the patch, I have just downloaded a .patch file, and I am not quite sure what to do with it...

what's "patch -p0"?

When building... which's easier? Make or Scons? I will sure look into the configure files and see what I can get from them...

Last but not least,
levon, can you be a bit more specific with that strip command, it might seem obvious to you, but this is my frist time messing with source code..

THANKS!

Posted: Tue Oct 04, 2005 7:22 am
by levon
sorry, i dont actualy know what the strip command does... i just run it and it makes things smaller.

Posted: Tue Oct 04, 2005 9:46 am
by jesterKing
Fred_Pyo wrote:Thanks for the replies!

jesterKing:
Hmmm, eager to understand how to deactivate the "debug" build... will search around the forums, thanks!
Getting a debug build with scons is easy: edit the config.opts that is created on first run, set BUILD_BINARY from 'release' to 'debug'
Fred_Pyo wrote: About the patch, I have just downloaded a .patch file, and I am not quite sure what to do with it...

what's "patch -p0"?
patch is the program to apply patches with, -p0 is just a switch. Start your cygwin shell and do a 'man patch', you'll get all the info you need.
Fred_Pyo wrote: When building... which's easier? Make or Scons? I will sure look into the configure files and see what I can get from them...
I'm a scons dude, so I'd say go for scons :)

/Nathan

Posted: Tue Oct 04, 2005 4:10 pm
by UncleZeiv
Fred_Pyo wrote:levon, can you be a bit more specific with that strip command, it might seem obvious to you, but this is my frist time messing with source code..
"strip" removes a lot of information which is not needed to actually run the program, but only to facilitate debugging.

_dave_

Posted: Thu Oct 06, 2005 4:14 am
by Fred_Pyo
Thanks for the replies again...

I decided to play with the strip command before reading these posts... and I did notice a little increase of speed when loading blender... thanks for the information!

About the patch thing, hmmm, I've searched it before with man patch and I didn't find anything, I'll download it's package now...

Another thing about the patches, how does it work? I mean, everytime I renew the source from CVS i need to repatch blender? Anyway, thanks for the info guys!

(I will look for SCONS and see if I like it better :D , but make is pretty much obvious and simple for me now)

Thanks again!

Posted: Thu Oct 06, 2005 8:08 am
by jesterKing
Fred_Pyo wrote:Another thing about the patches, how does it work? I mean, everytime I renew the source from CVS i need to repatch blender? Anyway, thanks for the info guys!
I principle you don't have to reapply the patch, provided you only updated (cvs update -dP) the source from CVS. You have to be aware of merge conflicts though - patched files are more prone to that. If you use the command-line cvs, look for lines marked with C and check those files (do a search for three minus signs should help).

/Nathan

Posted: Sat Oct 08, 2005 10:19 am
by Fred_Pyo
Thanks for the tip jesterKing!