Re: [eigen] Possible Bug ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
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