简体   繁体   中英

How can I run example armadillo program

I am trying to run the minimal armadillo example program (bellow for convinience)

#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;
  }

I am running a linux fedora 23 distro and have the armadillo package installed.

$ 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 

Though when I compiled the example program from the current directory I get:

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

On Fedora you also need to install the corresponding development package: armadillo-devel. This provides the header files required for compiling C++ programs that use armadillo.

For example:

sudo dnf install armadillo-devel

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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