1
Framework development / SWIG Takes A Very Long Time To Compile [proposal]
« on: July 19, 2008, 07:34:09 am »
As you all know, SWIG takes a very long time to compile. I think it's because of the memory, but upgrading isn'nt everyone's option. The main problem is we are compiling a very big source file : fife_wrap.cxx. So I went to the swig-user mailing list and asked :
And someone replied:
Which sounds very reasonable. Why not ? Anyone see why not ? Otherwise let's do this ! I'll have a test on my system when I have the time. Cheers all.
Quote
Hi everyone,
I'm Sleek, from FIFE ( www.fifengine.net ). We use swig c++ - python to allow easy modding of the game engine. However, the resultant fife_wrap.cxx is really massive.. close to 3.5 MB last time I checked. This is not so much of a problem, until we try to modify the interface files and recompile the swig wrapper. Currently, this is what we have :
swig -c++ -python *some other options I don't remember* $path/fife.i -> fife_wrap.cxx
What we need, is something like :
swig -c++ -python -noheader view.i -> fife_viewwrapper.cxx
swig -c++ -python -noheader model.i -> fife_modelwrapper.cxx
swig -c++ -python -noheader map.i -> fife_mapwrapper.cxx
swig -c++ -python -noheader layer.i -> fife_layerwrapper.cxx
So if any changes occurs in one of the interface files, only it's .cxx wrapper will be produced. This avoids recompiling the whole thing and saves a lot of time & processing cycles. What do you think ?
On another note, we are experiencing this bug : http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=364907 on random systems. I'm not sure which libstdc++6 version is involved, or whether there is something the swig developers can do about it. But hey, congratulations for a great masterpiece. SWIG rocks !
And someone replied:
Quote
I think you can simply divide the huge module into several smaller module, for example,
view.i -> fife/view.pyd
model.i -> fife/model.pyd
...
and then in Python you can:
import fife.view
import fife.model
is that reasonable?
Best regards,
Haoyu Bai
7/19/2008
Which sounds very reasonable. Why not ? Anyone see why not ? Otherwise let's do this ! I'll have a test on my system when I have the time. Cheers all.