我有一个关于使用犰狳的问题。
我使用的是 Ubuntu 12.10,以及 Code::Blocks 中的 gcc 编译器。我使用突触包管理器安装了 LAPACK 和 BLAS。我还使用突触包管理器安装了一次犰狳,一次使用 CMake 手动安装。CMake 在为犰狳编译进行配置时找到了 LAPACK 和 BLAS 库。此外,我在“构建选项”->“链接器”的 Code::Blocks 中链接了 BLAS 和 LAPACK 的库。
但是,每当我想构建我的项目时,我都会收到错误消息:
In function `void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)':|
/usr/include/armadillo_bits/lapack_wrapper.hpp|41|undefined reference to `wrapper_dgetrf_'|
明明是犰狳找不到LAPACK,但是我做错了什么?
我还取消了 armadillo_bits/config.hpp 文件中的相应行的注释,使其看起来像这样:
#if !defined(ARMA_USE_LAPACK)
//#define ARMA_USE_LAPACK
//// Uncomment the above line if you have LAPACK or a high-speed replacement for LAPACK,
//// such as Intel MKL, AMD ACML, or the Accelerate framework.
//// LAPACK is required for matrix decompositions (eg. SVD) and matrix inverse.
#endif
#if !defined(ARMA_USE_BLAS)
//#define ARMA_USE_BLAS
//// Uncomment the above line if you have BLAS or a high-speed replacement for BLAS,
//// such as OpenBLAS, GotoBLAS, Intel MKL, AMD ACML, or the Accelerate framework.
//// BLAS is used for matrix multiplication.
//// Without BLAS, matrix multiplication will still work, but might be slower.
#endif
/* #undef ARMA_USE_WRAPPER */
//// Comment out the above line if you're getting linking errors when compiling your programs,
//// or if you prefer to directly link with LAPACK and/or BLAS.
//// You will then need to link your programs directly with -llapack -lblas instead of -larmadillo
当我尝试用整数设置矩阵时,错误首先出现,所以
Mat<int> element_nodes;
我将不胜感激有用的答案。我确实在互联网上搜索了几个小时。另外,如果您需要更多源代码,请告诉我。