使用Armadillo时出错



我已经下载了最新的Armadillo软件包(3.920),我正试图在我的机器(Ubuntu 12.04)上使用它。我正在按照readme.txt文件中提到的步骤进行安装(cmake.,make,sudo make-install)。我的系统有漏洞和漏洞。当我尝试运行examples目录中提供的示例时,使用:g++示例1.cpp-O2-larmadillo我得到错误://usr/lib/librapack.so.3gf:对ATL_zptgemm' /usr/lib/liblapack.so.3gf: undefined reference to ATL_scope的未定义引用etc

如果我试着用g++示例1.cpp-O2-llpack-lblas-lgfortran我得到错误:/tmp/ccOsKhfg.o:在函数double arma::blas::dot<double>(unsigned int, double const*, double const*)': example1.cpp:(.text._ZN4arma4blas3dotIdEET_jPKS2_S4_[double arma::blas::dot<double>(unsigned int, double const*, double const*)]+0x36): undefined reference to wrapper_dot_'中/tmp/ccOsKhfg.o:在函数void arma::blas::gemv<double>(char const*, int const*, int const*, double const*, double const*, int const*, double const*, int const*, double const*, double*, int const*)': example1.cpp:(.text._ZN4arma4blas4gemvIdEEvPKcPKiS5_PKT_S8_S5_S8_S5_S8_PS6_S5_[void arma::blas::gemv<double>(char const*, int const*, int const*, double const*, double const*, int const*, double const*, int const*, double const*, double*, int const*)]+0x53): undefined reference to wrapper_dgemv_'中/tmp/ccOsKhfg.o:在函数void arma::blas::gemm<double>(char const*, char const*, int const*, int const*, int const*, double const*, double const*, int const*, double const*, int const*, double const*, double*, int const*)': example1.cpp:(.text._ZN4arma4blas4gemmIdEEvPKcS3_PKiS5_S5_PKT_S8_S5_S8_S5_S8_PS6_S5_[void arma::blas::gemm<double>(char const*, char const*, int const*, int const*, int const*, double const*, double const*, int const*, double const*, int const*, double const*, double*, int const*)]+0x61): undefined reference to wrapper_dm_'中

请注意,如果我在config.hpp中注释行"#define ARMA_USE_LAPACK"、"#defin ARMA_USE_BLAS",我可以运行示例1,但不能运行示例2,因为它需要LAPACK。

你能指导我解决这个问题吗。谢谢唾液

通过查看您的问题,我认为你应该键入-lapack而不是-llpack
如果没有lgfortan,它也可以工作,所以也尝试一下

g++主.cpp-o主-o1-larmadillo-llapack-lblas

最新更新