Search code examples
xcodevisual-studioidestatic-librariesarmadillo

How can I install Armadillo on Windows?


I need to install and use Armadillo library to deal with linear algebra.

I went to their websites and downloaded .tar.xz file, but I have no idea how to install it.

How can I install Armadillo? (I'm primarily using Dev-C++, but I also sometimes use XCode)


Solution

  • If you are using Windows, you might be using Visual Studio for compilation. Extract tarball using 7zip or other extraction software and save it in the directory of your choice. For example your path could be, C:\armadillo.

    In the Visual Studio solution, do the following:

    • Add armadillo directory under Property Manager --> C/C++ --> General --> Additional Include Directories, add semicolon after existing entries, followed by C:\armadillo\include;%(AdditionalIncludeDirectories)

    If you are using 64-bit version to build also do the following:

    • Property Manager --> Linker --> General --> Additional Library Directories, add semicolon after existing entries, followed by C:\armadillo\examples\lib_win64;%(AdditionalLibraryDirectories)
    • Property Manager --> Linker --> Input --> Additional Dependencies, add semicolon after existing entries, followed by blas_win64_MT.lib;lapack_win64_MT.lib;%(AdditionalDependencies)

    Ensure that you are modifying the Property Manager in the same Solution Configuration and Solution Platform that you are using for the build. If this was successful, you should be able to use armadillo by simply adding #include <armadillo> in your header file.