From: Nitro <ni...@dr...> - 2008-02-02 14:26:43
|
Am 02.02.2008, 15:01 Uhr, schrieb William S Fulton = <ws...@fu...>: > Nitro wrote: >> > The structure has worked well for Java and C#, but is more challeng= ing >> > for >> > Python. I've actually got a very similar structure on the C++ side = as >> > you with >> > about 10 modules. I can't have one .i file for each module though a= s >> > there is >> > just too much code. Some of the .i files as they are, are too close= to >> > the 64K >> > LOC max that visual studio will allow per file. SWIG generates a lo= t >> > of code - >> > over 2 million LOC in total! As for the build, it would take a long= >> > time, but >> > fortunately we've parallelised the build, so it only takes a few >> > minutes with >> > the link time being the longest part. >> >> I haven't checked the actual line numbers of my project. The generate= d >> wrappers are ~20 MB in size together. So far I did not encounter the = 64k >> line limit with msvc 2005 (not sure if I tested it with 2003 back whe= n >> we were using this). MSVC 2005 is happy to compile files with hundred= s >> of thousands of lines. Sometimes there's a message saying something l= ike >> "I won't report any more errors after line 65535", but the code still= >> compiles fine. > Ah okay, MSVC 2005 has probably fixed the file size limit. I'm using = > MSVC 2003 because that is what python 2.5 is built with and when I did= = > some reading around, it wasn't clear that the latest Python could = > reliably be used with 2005, eg = > http://groups.google.com/group/comp.lang.python/browse_thread/thread/2= c94dd98c47c176d/194cb5f361ce89f7?lnk=3Draot. = > Saying that, the SWIG test-suite runs fine though with 2005. Our = > projects are probably a similar size as my resulting wrapper dll is = > 15MB. You can get the lines of code quite easily using unix tools (eg = = > cygwin) with: > > wc -l *_wrap.cxx > > A grand total is printed at the end. Thanks for the ip. Unfortunately I don't use any unix environment and = wrote this little script to count the lines of my wrapper files: import glob files =3D glob.glob('*.h') + glob.glob('*.cpp') total =3D 0 for file in files: f =3D open(file, 'r') no_lines =3D len(f.readlines()) print file, no_lines total +=3D no_lines print 'Total : ', total The result was approx. 500,000 lines in total. So your project is 4x = bigger. My resulting dlls are ~11 MB in size. Sometimes it would be nice if window shipped with some more default = command-line programs (grep, wc, ...). -Matthias |