I just built python-ogre on my Ubuntu box.
The resulting binary "_ogre_.so" is over 260 MBytes huge!
How can I turn optimizations on?
There is an issue with optimization flags in the SConstruct file and the order of the build command with later versions of gcc (4.5/4.6).
I'll fix it next time I do a build, I think the solution is to move "pkg-config" to the end of the CCFLAGS part of the build command :
CCFLAGS += ' -I'
CCFLAGS += ' -O3 -I./ '
CCFLAGS += ' -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES '
## moved to eliminate problems with gcc 4.6
CCFLAGS = ' `pkg-config --cflags OGRE` ' ## needs to change I think :)
If the above doesn't work as a ugly hack see the first post in the following link, you should be able to force the order by setting a custom compiler:
## Use custom compilier if wanted (things like ccache)
_env['CXX'] ='g++ -O3 -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -Wno-deprecated -I./ -I./'
The above should reduce your ogre .so file to around 80MB. Try this first on one of the smaller modules such as OIS. If you run into difficulties let us know.