Re: [eigen] on extern template instanciation

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


On Sat, Jun 14, 2008 at 11:18 AM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:
> so it looks like -finline-functions has priority over attribute(noinline).
> Strange indeed, the local attribute is wiser than the global gcc option so it
> should have priority....
>
> Worst case, the gcc man page lists the 4 cxxflags that -O3 adds over -O2 so
> you could always use -O2 plus the 3 other flags...

sure, or just add -fno-inline-functions after the -O3, but that's not
a real solution.

what about the following: we give two levels to EIGEN_EXTERN_INSTANTIATIONS.
so:
 if EIGEN_EXTERN_INSTANTIATIONS==1 then we only declare the extern templates
 if EIGEN_EXTERN_INSTANTIATIONS==2 then we declare the extern
templates + hide the heavy code using a pair of #if
EIGEN_EXTERN_INSTANTIATIONS<2 / #endif

that's a bit complicated for the user:
- if he does not need  -finline-functions then define it to 1
- otherwise define it to 2 and take care when you use non-common types
(i.e re-define EIGEN_EXTERN_INSTANTIATIONS=1 before including eigen
headers)

but I cannot see a better solution until gcc changes this behavior.

FYI, I suggested that could be a gcc bug on gcc-help and if I don't
get any reply soon I'll report a bug.

gael.


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