[Insight-users] Re: Controlling number of lines with CabeSwig (was Re: gcc-3.3 : final_scan_insn, at final.c:2117)

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Sep 12 05:47:59 EDT 2007


On 9/12/07, Mathieu Malaterre <mathieu.malaterre at gmail.com> wrote:
> Hi again,
>
>   Since the cxx file is generated I was wondering if cableswig could
> generate code most of the code on single lines (class declaration,
> functions).
...
> Any cableswig options for that ?


Ok that was easy:

[15.5 Reducing the wrapper file size]
http://www.swig.org/Doc1.3/Modules.html#Modules_nn6

$ cd /home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters
&& /home/mmalaterre/Projects/CableSwig-gcc/bin/cswig
-l/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/SWIG/IntensityFilters.swg
-l/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/SWIG/itk.swg
-l/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/SWIG/BaseNumerics.swg
-l/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/SWIG/Base.swg
-I/home/mmalaterre/Projects/CableSwig-gcc/SWIG/Lib -w362 -w389 -w467
-w503 -w508 -w509 -w516 -noruntime -Cindex
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/ClassIndex/Base.mdx
-Cindex /home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/ClassIndex/BaseNumerics.mdx
-Cindex /home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/ClassIndex/IntensityFilters.mdx
-depend /home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilter.xml.depend
-outdir /home/mmalaterre/Projects/Insight-gcc/bin -o
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilterPython.cxx
-c++ -I/home/mmalaterre/Projects/CableSwig-gcc/SWIG/Lib/python -python
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilter.xml
mmalaterre at zorglub $ wc
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilterPython.cxx
  640024  2192200 32447622

compare to:


/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilterPython.cxx
mmalaterre at zorglub $ cd
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters
&& /home/mmalaterre/Projects/CableSwig-gcc/bin/cswig -fcompact
-l/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/SWIG/IntensityFilters.swg
-l/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/SWIG/itk.swg
-l/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/SWIG/BaseNumerics.swg
-l/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/SWIG/Base.swg
-I/home/mmalaterre/Projects/CableSwig-gcc/SWIG/Lib -w362 -w389 -w467
-w503 -w508 -w509 -w516 -noruntime -Cindex
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/ClassIndex/Base.mdx
-Cindex /home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/ClassIndex/BaseNumerics.mdx
-Cindex /home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/ClassIndex/IntensityFilters.mdx
-depend /home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilter.xml.depend
-outdir /home/mmalaterre/Projects/Insight-gcc/bin -o
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilterPython.cxx
-c++ -I/home/mmalaterre/Projects/CableSwig-gcc/SWIG/Lib/python -python
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilter.xml
mmalaterre at zorglub $ wc
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilterPython.cxx
  237463  2076892 29264856
/home/mmalaterre/Projects/Insight-gcc/Wrapping/WrapITK/Modules/IntensityFilters/wrap_itkRescaleIntensityImageFilterPython.cxx


The trick is to simply add -fcompact. The time to compile the file is
exactly the same but at least I am now pleasing gcc 3.3, and manage to
compile the object file.

Now I need to figure out how to add this -fcompact to all target,
geatan any suggestion ?



-- 
Mathieu


More information about the Insight-users mailing list