[Bf-committers] [BF-Committers] Duplicate Explicit Instantiations

Chuck Schwalbach charles at charlesschwalbach.com
Thu Sep 13 00:53:01 CEST 2007


Mathias,

Thank you for the help. From the information in the last link I was
able to circumvent the problem - Irix will stay up to date for now!

Thanks again,

Charles

On 9/12/07, Mathias Wein <lynx at yafray.org> wrote:
> Kent Mein wrote:
> > I believe the issue is something like this:
> > in the elbeem dir we have this:
> > intern/solver_interface.h:template<class Scalar> class ntlMatrix4x4;
> > intern/particletracer.h:template<class Scalar> class ntlMatrix4x4;
> > intern/attributes.h:template<class T> class ntlMatrix4x4;
> >
> > And we have the actual template in
> > intern/ntl_matrices.h
> >
> Unless i'm really mistaken those three are just (template) class
> declarations, they shouldn't hurt anyone. You basically do that to
> avoid including headers in headers in headers...it's enough to
> declare a type when you only store/pass pointers/references
> of that type.
>
> An explicit template instantiation would for example be:
> template class ntlMatrix4x4<gfxReal>;
> This makes the compiler generate all code for this template even
> when it is never used in code.
>
> The information that GCC doesn't do automatic instantiation is plain
> wrong i think. When i was new to C++ i didn't even know you can do
> explicit instantiation :D
> Not very common these days i think, except for library purposes.
>
> What seems to be the problem here is that the linker on Irix can't
> handle duplicate instantiations (in contrast to the GNU linker), and hence
> MIPSpro seems to have a special prelinker that collects all templates that
> still need to be instantiated and only creates them once
> (well, that probably saves compile time too...GCC's template performance
> is sometimes quite lacking, to say it politely).
>
> No idea which template the prelinker is moaning about, or what settings
> you use.
>
> Some possibly interesting links:
> http://www.network-theory.co.uk/docs/gccintro/gccintro_60.html
> http://www.risc.uni-linz.ac.at/education/courses/ws2003/intropar/origin-new/CC_PG/sgi_html/ch04.html
>
>
> Mathias
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list