Armadillo

Armadillo[1] is a high quality C++ linear algebra library, aiming towards a good balance between speed and ease of use.

Worked Example

Reserve Compute Node

srun --pty bash

Find the armadillo module using the module spider command:

module spider armadillo

Output:

------------------------------------------------------------

  armadillo: armadillo/8.500.1

------------------------------------------------------------

Description:

Armadillo is a linear algebra software library for the C++ programming language. It aims to provide efficient and streamlined base calculations, while at the same time having a straightforward and easy-to-use interface. You will need to load all module(s) on any one of the lines below before the "armadillo/8.500.1" module is available to load.


gcc/6.3.0  openmpi/2.0.1

Load the module

module load gcc openmpi armadillo

Compile and Run

Copy the Armadillo example from /usr/local/doc/ARMADILLO to your home directory

cp -r /usr/local/doc/ARMADILLO

Compile the code:

cd ARMADILLO

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

Run:

./example 

output:

0.9713 1.3566 0.7946 1.6896

1.2593 1.1457 0.9011 1.6260

1.1954 0.8484 1.0444 1.6753

1.6225 1.5009 1.2935 2.2019

References

[1] Armadillo Home