[Insight-developers] Explicit instantiation

Hans Johnson hans-johnson at uiowa.edu
Sun Apr 23 20:51:59 EDT 2006


Brad,

I just wanted to chime in and say that I think this is an important
undertaking.  While disk space is super cheap, and computers are super fast,
building ITK for regression test purposes has become quite a large resource
commitment.

Thanks for your efforts,
Hans


On 4/21/06 9:15 AM, "Brad King" <brad.king at kitware.com> wrote:

> Both.  Right now the ITK build tree is over 7GB with all the tests and
> Tcl/Python wrapping on Linux.  Alot of the space comes because every
> object file that gets built has its own copy of implicitly instantiated
> templates like "itk::Image<unsigned char, 2>".  Most of these duplicate
> symbols are merged by the linker, which means that the compiler wasted
> time compiling them in the first place.  Even after the linker merges
> them each executable still has its own copy, even with shared libraries
> enabled.
> 
> The explicit instantiation support puts the common instantiations in one
> library ahead of time and then instructs the compiler not to build those
> instantiations elsewhere.  This should significantly reduce the disk
> space and compile time needed to build ITK with tests and wrapping.
> 
> If you look at the Code/Common/Templates directory you will see
> something that looks a bit like the wrapper configuration files.  In the
> future I plan to find a way to merge these so that all explicit
> instantiations are wrapped.  Building wrappers for them should be much
> faster because the .txx files do not need to be included at all since
> now only calls to the code need be compiled in the wrappers instead of
> the code itself in the form of implicit instantiations.
> 
> -Brad




More information about the Insight-developers mailing list