Re: [eigen] Possible Bug ?

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


On 07/15/2014 01:23:31 PM, Matthieu Brucher wrote:
Hi,

Did you try by changing the order of vector/Eigen headers?

I've just tried it, i.e. first include vector then include Eigen - no problems at all. I forgot to mention that I'm using the GIT-version (from today) of Eigen.

Helmut


2014-07-15 12:20 GMT+01:00 Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>:
> On 07/15/2014 01:02:29 PM, Gael Guennebaud wrote:
>>
>> I found the one line triggering the issue. Using the stackoverflow
>> example,the following main.cpp file is sufficient to trigger the issue:
>>
>>
>> namespace riri { // the namespace is optional
>>   enum { fifi = sizeof(int) };
>> }
>>
>> #include "func.h"
>>
>> int main() {
>>     std::vector<Eigen::Matrix<double, 2, 2> > m;
>>     f<2>(m);
>> }
>>
>>
>> that is, adding the declaration:
>>
>> enum { fifi = sizeof(int) };
>>
>> *before* including Eigen makes gcc's linker nuts.
>>
>> I'm clueless.
>>
>> gael
>>
>
> Probably, I haven't understood the issue.
>
> The following cases compile and link fine with gcc-4.9.0
>
> Case I)  gcc Bug1.C
>
> Bug1.C :
>
> #include <Eigen/Dense>
> #include <vector>
>
> template <int N>
> void f(std::vector<Eigen::Matrix<double, N, N> >& m);
>
>
> template <>
> void f<2>(std::vector<Eigen::Matrix<double, 2, 2> >& m) {}
>
> enum { fifi = sizeof(int) };
>
>
> int main() {
>     std::vector<Eigen::Matrix<double, 2, 2> > m;
>     f<2>(m);
> }
>
>
> Case II)  gcc Bug2.C func.C  where
>
> Bug2.C :
> #include <Eigen/Dense>
> #include <vector>
>
> template <int N>
> void f(std::vector<Eigen::Matrix<double, N, N> >& m);
>
> enum { fifi = sizeof(int) };
>
>
> int main() {
>     std::vector<Eigen::Matrix<double, 2, 2> > m;
>     f<2>(m);
> }
>
> func.C :
> #include <Eigen/Dense>
> #include <vector>
> template <int N>
> void f(std::vector<Eigen::Matrix<double, N, N> >& m);
>
> template <>
> void f<2>(std::vector<Eigen::Matrix<double, 2, 2> >& m) {}
>
>
> Helmut
>
>
>



--
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher
Music band: http://liliejay.com/








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