繁体   English   中英

我如何运行示例犰狳程序

[英]How can I run example armadillo program

我正在尝试运行最小的犰狳示例程序(为了方便起见)

#include <iostream>
#include <armadillo>

using namespace std;
using namespace arma;

int main()
  {
  mat A = randu<mat>(4,5);
  mat B = randu<mat>(4,5);
  cout << A*B.t() << endl; 
  return 0;
  }

我正在运行 linux fedora 23 发行版并安装了armadillo软件包。

$ sudo dnf list armadillo
Last metadata expiration check: 1:04:12 ago on Tue May 31 17:57:36 2016.
Installed Packages
armadillo.x86_64        6.700.6-1.fc23         @updates
Available Packages
armadillo.i686          6.700.6-1.fc23         updates 

虽然当我从当前目录编译示例程序时,我得到:

$ g++ example.cpp -o example -O2 -larmadillo
example.cpp:2:21: fatal error: armadillo: No such file or directory
compilation terminated.

在 Fedora 上还需要安装相应的开发包:armadillo-devel。 这提供了编译使用 armadillo 的 C++ 程序所需的头文件。

例如:

sudo dnf install armadillo-devel

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM