Re: [eigen] separation declaration -- implementation

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


All of Eigen is templates.

As always with templated code, all one can do is instantiate some
common specializations, but especially due to expression templates
there are "infinitely many" possible specializations -- every
different expression like "a+b*c" means different specializations.

In Eigen 2.0 we had a (rather unmaintained) concept of instantiating
some heavy templates, like some decomposition algorithms, into a
binary library. that was the EIGEN_BUILD_LIBRARY option to cmake. Now
we're probably not going to keep this.

Instead, if you want to speed up compilation with Eigen, try these things:

1) try precompiler headers.

2) make your own binary library, with only the stuff that you actually
need. For instance if you know that you only use 'float' and that the
only decomposition that you use is 'LU' then you can streamline your
binary library much more than we can upstream.

3) make sure that your code doesn't make more template specializations
than really needed. E.g. try to turn template parameters into runtime
parameters unless really needed, etc.

Cheers,
Benoit



2009/8/19 Michael Meyer <mjhmeyer@xxxxxxxxx>:
> Folks,
>
> What do you think of the idea of taking the implementations out of the header files so we can compile eigen into a library and link against it.
>
> I think it is most elegant to minimize implementations in headers
> by all means possible.
>
> The main reason for this request is the compile time (in excess of a minute), probably two minutes on my medium fast laptop.
>
> I am now referring to version 2.0.
> There seemed to be files designed to force the instantiation of templates (if I understand the code correctly).
>
> Would it not be better not to do this and instantiate only the templates
> you actually need in your project.
>
> Greetings,
>
> Mike
>
>
>
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/