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
)
Armadillo is a c++ library and does not need "installing". Just extract the archive and point your compiler/linker to the appropriate subfolders. For gcc the options are -L for the library path and -I for the include path. For finally running your program you would do something like
LD_LIBRARY_PATH=[path to library folder of armadillo] ./[your program]
under linux, not sure what the corresponding command would be under windows.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:
Property Manager --> C/C++ --> General --> Additional Include Directories
, add semicolon after existing entries, followed byC:\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 byC:\armadillo\examples\lib_win64;%(AdditionalLibraryDirectories)
Property Manager --> Linker --> Input --> Additional Dependencies
, add semicolon after existing entries, followed byblas_win64_MT.lib;lapack_win64_MT.lib;%(AdditionalDependencies)
Ensure that you are modifying the
Property Manager
in the sameSolution Configuration
andSolution 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.Hope that helps.
.tar.xz is archive. Try using 7zip for extracting.