Installing Armadillo 0.4.0

I found a nice C++ linear algebra library called Armadillo by Conrad. I will write short posts to describe how to use it, and I will begin on how to install it.

First, download the source tarball from this link

untar the tar.gz file, and enter the directory.

The installation uses CMake, so if you don’t have, you can install it (in Ubuntu)
sudo apt-get install cmake

and then to install Armadillo, simply type:
cmake .
make install DESTDIR=$HOME/local

where I chose to install it in $HOME/local/usr/local. (NOTE: Somehow the installation folder will add “/usr/local”)

To compile a C++ code with armadillo, you need to include the header file
#include “armadillo”

and specify in the compiler option:
-I$HOME/local/usr/local/include -L$HOME/local/usr/local/lib -larmadillo

you can find an example in the “example” folder shipped with the source.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: