Armadillo is a C++ template library for linear algebra. It is built upon LAPACK and BLAS. It offers a simple API that is similar to that of Matlab.
Download the source code of Armadillo from here. Unzip the source code of Armadillo to a directory.
Create an environment variable named
ARMADILLO_ROOT with a value of the Armadillo directory.
Armadillo requires LAPACK and BLAS libraries for any non-trivial matrix operation. To enable it to use these libraries, open
$(ARMADILLO_ROOT)/include/armadillo_bits/config.hpp and uncomment the defines of
To use Armadillo in your Visual C++ project, add
$(ARMADILLO_ROOT)/include as an Include directory.
Since Armadillo source code uses LAPACK and BLAS, your project needs to link with these libraries. Armadillo ships with pre-built 32-bit
.dll files for LAPACK and BLAS. Add
$(ARMADILLO_ROOT)/examples/lib_win32 as Library directory to your project. Add
lapack_win32_MT.lib as additional dependencies to your project.
armadillo header file in your source code. Use the Armadillo classes and methods in your code. Remember to use the namespace
arma:: Your code should compile to an EXE file without any further problems.
lapack_win32_MT.dll files from
$(ARMADILLO_ROOT)/examples/lib_win32 to the directory that contains your EXE file. Your program should execute successfully now.
Tried with: Armadillo 3.920.2 and Visual Studio 2010