How can I install Armadillo on Windows?

扶醉桌前 提交于 2019-12-24 10:58:10

问题


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)


回答1:


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.

Hope that helps.




回答2:


.tar.xz is archive. Try using 7zip for extracting.




回答3:


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.



来源:https://stackoverflow.com/questions/44551414/how-can-i-install-armadillo-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!