Eigen leaves macro I defined
Submitted by Djordje Zivanovic
Assigned to Nobody
Link to original bugzilla bug (#1720)
Version: 3.3 (current stable)
Operating system: Linux
Description
I have tried using LAPACK + BLAS + Eigen following the instructions https://eigen.tuxfamily.org/dox/TopicUsingBlasLapack.html .
However, when I define EIGEN_USE_BLAS and EIGEN_USE_LAPACKE and have the following order in the first header file:
#include <boost/thread/barrier.hpp>
#include <Eigen/Dense>
the following compilation error appears:
In file included from /usr/include/c++/7/complex.h:36:0,
from /usr/local/include/Eigen/src/misc/lapacke.h:79,
from /usr/local/include/Eigen/LU:34,
from /usr/local/include/Eigen/Dense:2,
from xxx.h:4,
from xxx.cpp:5:
/usr/local/include/boost/type_traits/integral_constant.hpp:34:20: error: expected identifier before ‘(’ token
template <class I, I val> struct integral_c;
^
/usr/local/include/boost/type_traits/integral_constant.hpp:34:20: error: expected ‘)’ before ‘extension’
template <class I, I val> struct integral_c;
^
/usr/local/include/boost/type_traits/integral_constant.hpp:34:20: error: expected ‘>’ before ‘extension’
/usr/local/include/boost/type_traits/integral_constant.hpp:34:20: error: expected unqualified-id before ‘)’ token
template <class I, I val> struct integral_c;
I tracked the origin of this compiler error and it is from
#include <complex.h> that defines I. (https://en.wikibooks.org/wiki/C_Programming/complex.h)
I successfully circumvent the problem by adding #undef I after #include<Eigen/Dense>, but you should solve this problem for future releases of Eigen.