我正在尝试使用Eigen + LAPACK,以便提高某些算法的性能。但是,如果我按照https://eigen.tuxfamily.org/dox/TopicUsingBlasLapack.html
的说明进行操作,则无法编译我尝试将<boost/thread/barrier.hpp>
移到文件的开头,但这不能解决问题。我的Boost库是1.68,本征是3.3.7。我从编译器传递EIGEN_USE_LAPACKE作为定义的变量。它仅与bla成功链接。我通过检查生成的代码验证了这一点。
这是第一个头文件的开头;
#define EIGEN_USE_BLAS
//#define EIGEN_USE_LAPACKE
#include <boost/thread/barrier.hpp>
#include <Eigen/Dense>
错误是:
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;