c++ - 在 Linux 服务器上编译 C++ 程序时英特尔编译器的语法

标签 c++ linux intel eigen

我是 Linux 上 shell 和编译 C++ 程序的新手。

我有一个 C++ 程序,我习惯使用以下命令用 G++ 编译它:

g++ lapack.cpp generators.cpp SimpleRNG.cpp testabc.cpp -O3 -o examplexi.o;

该命令工作正常,testabc.cpp 需要从 Eigen 库调用函数,但是,当我尝试将以下命令与英特尔编译器一起使用时:

icpc lapack.cpp generators.cpp SimpleRNG.cpp testabc.cpp -O3 -o examplexi.o;​

错误很多,这里我只挑了一个放在下面:

  Eigen::Matrix<double, -1, -1, 0, -1, -1>>, const Eigen::GeneralProduct<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, 5>>>>]" at line 274 of "testabc.cpp"

我没有找到任何关于英特尔编译器特殊语法的信息,谁能帮我解决这个问题?

非常感谢!

附言:

其实我发现所有的错误信息都是warning,程序终于可以编译通过了。但是所有这些警告消息仍然很烦人,所以我在这里发布前几行,希望你能帮助我!

eigen/Eigen/src/Core/Product.h(453): warning #2196: routine is both "inline" and "noinline"
  general_matrix_vector_product
  ^
      detected during:
        instantiation of "void Eigen::internal::gemv_selector<2, 0, true>::run(const ProductType &, Dest &, ProductType::Scalar) [with ProductType=Eigen::GeneralProduct<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false, true>, Eigen::Transpose<const Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false, true>>, 4>, Dest=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, false, true>]" at line 340
        instantiation of "void Eigen::GeneralProduct<Lhs, Rhs, 4>::scaleAndAddTo(Dest &, Eigen::GeneralProduct<Lhs, Rhs, 4>::Scalar) const [with Lhs=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false, true>, Rhs=Eigen::Transpose<const Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false, true>>, Dest=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, false, true>]" at line 124 of "eigen/Eigen/src/Core/ProductBase.h"
        instantiation of "void Eigen::ProductBase<Derived, Lhs, Rhs>::scaleAndAddTo(Dest &, Eigen::ProductBase<Derived, Lhs, Rhs>::Scalar) const [with Derived=Eigen::GeneralProduct<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false, true>, Eigen::Transpose<const Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false, true>>, 4>, Lhs=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false, true>, Rhs=Eigen::Transpose<const
                  Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false, true>>, Dest=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, false, true>]" at line 121 of "eigen/Eigen/src/Core/ProductBase.h"
        instantiation of "void Eigen::ProductBase<Derived, Lhs, Rhs>::subTo(Dest &) const [with Derived=Eigen::GeneralProduct<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false, true>, Eigen::Transpose<const Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false, true>>, 4>, Lhs=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false, true>, Rhs=Eigen::Transpose<const Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false, true>>,
                  Dest=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, false, true>]" at line 87 of "eigen/Eigen/src/Core/NoAlias.h"
        instantiation of "ExpressionType &Eigen::NoAlias<ExpressionType, StorageBase>::operator-=(const Eigen::ProductBase<ProductDerived, Lhs, Rhs> &) [with ExpressionType=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, false, true>, StorageBase=Eigen::MatrixBase, ProductDerived=Eigen::GeneralProduct<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false, true>, Eigen::Transpose<const Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false, true>>,
                  4>, Lhs=Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false, true>, Rhs=Eigen::Transpose<const Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false, true>>]" at line 219 of "eigen/Eigen/src/Cholesky/LLT.h"
        instantiation of "MatrixType::Index Eigen::internal::llt_inplace<1>::unblocked(MatrixType &) [with MatrixType=Eigen::Matrix<double, -1, -1, 0, -1, -1>]" at line 232 of "eigen/Eigen/src/Cholesky/LLT.h"
        instantiation of "MatrixType::Index Eigen::internal::llt_inplace<1>::blocked(MatrixType &) [with MatrixType=Eigen::Matrix<double, -1, -1, 0, -1, -1>]" at line 282 of "eigen/Eigen/src/Cholesky/LLT.h"
        instantiation of "bool Eigen::internal::LLT_Traits<MatrixType, 1>::inplace_decomposition(MatrixType &) [with MatrixType=Eigen::Matrix<double, -1, -1, 0, -1, -1>]" at line 311 of "eigen/Eigen/src/Cholesky/LLT.h"
        instantiation of "Eigen::LLT<_MatrixType, _UpLo> &Eigen::LLT<_MatrixType, _UpLo>::compute(const Eigen::LLT<_MatrixType, _UpLo>::MatrixType &) [with _MatrixType=Eigen::Matrix<double, -1, -1, 0, -1, -1>, _UpLo=1]" at line 101 of "eigen/Eigen/src/Cholesky/LLT.h"
        instantiation of "Eigen::LLT<_MatrixType, _UpLo>::LLT(const Eigen::LLT<_MatrixType, _UpLo>::MatrixType &) [with _MatrixType=Eigen::Matrix<double, -1, -1, 0, -1, -1>, _UpLo=1]" at line 373 of "eigen/Eigen/src/Cholesky/LLT.h"
        instantiation of "const Eigen::LLT<Eigen::Matrix<Eigen::internal::traits<Derived>::Scalar, Eigen::internal::traits<Derived>::RowsAtCompileTime, Eigen::internal::traits<Derived>::ColsAtCompileTime, <expression>, Eigen::internal::traits<Derived>::MaxRowsAtCompileTime, Eigen::internal::traits<Derived>::MaxColsAtCompileTime>, 1> Eigen::MatrixBase<Derived>::llt() const [with Derived=Eigen::Matrix<double, -1, -1, 0, -1, -1>]" at line 66 of "generators.cpp"

最佳答案

如评论中所述,这些警告/错误是由旧版本的 Eigen 引起的。升级 Eigen 解决了这个问题。

关于c++ - 在 Linux 服务器上编译 C++ 程序时英特尔编译器的语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25162739/

相关文章:

linux-kernel - 使用 RDTSC 精确测量最大循环计数

assembly - Intel X86-64 组装教程或书籍

c++ - weak_ptr<User_Class> 是非指针类型

c++ - Boost、共享内存和 vector

连接到 IPv4 映射的 IPv6 地址失败

c++ - Qt MainWindow 在 Linux 中的位置

multithreading - 锁定指令是否在弱顺序访问之间提供了障碍?

c++ - 从 python 访问 C++ 类

C++ 继承和包含

c++ - 如何在不使用boost的情况下创建目录?