犰狳安装 [英] Armadillo installation

查看:120
本文介绍了犰狳安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在自己的工作目录/home/me/package/armadillo3.0.1/中安装了Armadillo3.0.1,如README.txt所述.但是当我尝试一个例子时:

Hi I installed Armadillo3.0.1 in my own working directory /home/me/package/armadillo3.0.1/ as the README.txt said. But when I try an example:

g ++ -I/home/me/package/armadillo3.0.1/usr/include/example.cpp -o示例-O1

g++ -I /home/me/package/armadillo3.0.1/usr/include/ example.cpp -o example -O1

它总是显示错误:

/tmp/ccZAE9pj.o:在函数void arma::gemm<false, false, false, false>::apply_blas_type<double>(arma::Mat<double>&, arma::Mat<double> const&, arma::Mat<double> const&, double, double)': example.cpp:(.text._ZN4arma4gemmILb0ELb0ELb0ELb0EE15apply_blas_typeIdEEvRNS_3MatIT_EERKS5_S8_S4_S4_[void arma::gemm<false, false, false, false>::apply_blas_type<double>(arma::Mat<double>&, arma::Mat<double> const&, arma::Mat<double> const&, double, double)]+0x75e): undefined reference to wrapper_dgemm_'中 /tmp/ccZAE9pj.o:在函数void arma::glue_times_redirect2_helper<true>::apply<arma::Mat<double>, arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Glue<arma::Mat<double>, arma::Mat<double>, arma::glue_times> const&)': example.cpp:(.text._ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_3MatIdEES4_EEvRNS3_INT_9elem_typeEEERKNS_4GlueIS5_T0_NS_10glue_timesEEE[void arma::glue_times_redirect2_helper<true>::apply<arma::Mat<double>, arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Glue<arma::Mat<double>, arma::Mat<double>, arma::glue_times> const&)]+0xe69): undefined reference to wrapper_dgemv_中 example.cpp :(.text._ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_3MatIdEES4_EEvRNS3_INT_9elem_typeEEERKNS_4GlueIS5_T0_NS_10glue_timesEEE [空隙ARMA :: glue_times_redirect2_helper ::申请,ARMA ::垫>(ARMA ::垫:: elem_type>&安培;, ARMA ::胶,ARMA ::垫,ARMA :: glue_times > const&)] + 0x1175):对"wrapper_dgemv_"的未定义引用 collect2:ld返回1个退出状态

/tmp/ccZAE9pj.o: In function void arma::gemm<false, false, false, false>::apply_blas_type<double>(arma::Mat<double>&, arma::Mat<double> const&, arma::Mat<double> const&, double, double)': example.cpp:(.text._ZN4arma4gemmILb0ELb0ELb0ELb0EE15apply_blas_typeIdEEvRNS_3MatIT_EERKS5_S8_S4_S4_[void arma::gemm<false, false, false, false>::apply_blas_type<double>(arma::Mat<double>&, arma::Mat<double> const&, arma::Mat<double> const&, double, double)]+0x75e): undefined reference towrapper_dgemm_' /tmp/ccZAE9pj.o: In function void arma::glue_times_redirect2_helper<true>::apply<arma::Mat<double>, arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Glue<arma::Mat<double>, arma::Mat<double>, arma::glue_times> const&)': example.cpp:(.text._ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_3MatIdEES4_EEvRNS3_INT_9elem_typeEEERKNS_4GlueIS5_T0_NS_10glue_timesEEE[void arma::glue_times_redirect2_helper<true>::apply<arma::Mat<double>, arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Glue<arma::Mat<double>, arma::Mat<double>, arma::glue_times> const&)]+0xe69): undefined reference towrapper_dgemv_' example.cpp:(.text._ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_3MatIdEES4_EEvRNS3_INT_9elem_typeEEERKNS_4GlueIS5_T0_NS_10glue_timesEEE[void arma::glue_times_redirect2_helper::apply, arma::Mat >(arma::Mat::elem_type>&, arma::Glue, arma::Mat, arma::glue_times> const&)]+0x1175): undefined reference to `wrapper_dgemv_' collect2: ld returned 1 exit status

但是,如果我添加-larmadillo选项,例如:

However if I add the -larmadillo option like:

g ++ example.cpp -o示例-O1 -larmadillo

g++ example.cpp -o example -O1 -larmadillo

它可以通过调用旧版本来工作.如果我想在3.0.1中使用Mat.t()等新功能,它也会显示错误:

It works by calling the old version. If I want to use new features in 3.0.1 like Mat.t(), it will also show the error:

example.cpp:在函数‘int main(int,char **)’中: example.cpp:20:错误:"struct arma :: mat"没有名为"t"的成员

example.cpp: In function ‘int main(int, char**)’: example.cpp:20: error: ‘struct arma::mat’ has no member named ‘t’

这表明通过添加-larmadillo,它从/usr/include/armadillo_bits/调用了旧版本的armadillo.

This shows that by adding -larmadillo, it calls the old version armadillo from /usr/include/armadillo_bits/.

有什么想法吗?谢谢.

推荐答案

在第一个命令中,您未与 libarmadillo 链接.您是否考虑过使用 -L gcc选项添加链接目录?例如:

In the first command, you are not linking with libarmadillo. Have you considered using the -L gcc option to add a link directory ? For example:

g ++ -I/home/me/package/armadillo3.0.1/usr/include/ -L/home/me/package/armadillo3.0.1/usr/lib example.cpp -o示例-O1 -larmadillo

g++ -I/home/me/package/armadillo3.0.1/usr/include/ -L/home/me/package/armadillo3.0.1/usr/lib example.cpp -o example -O1 -larmadillo

这篇关于犰狳安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆