I added successfully Armadillo library to my c++ project in visual studio(I do not have any problem to use for example sparse matrix from Armadillo), but I have a problem regarding to solve spars matrix (spsolve).
Based on the instruction (http://arma.sourceforge.net/docs.html#spsolve), ARMA_USE_SUPERLU must be enabled in config.hpp, I did it. but when I enable ARMA_USE_SUPERLU in config.hpp I get the "unresolved externals" error.
What is the problem? How can I add SuperLU to my project? is there any one can tell me step by step to add SuperLU, please?
I saw lot of instruction to add the SuperLU, but I could not add it.
Notice this line g++ example.cpp -o example -O2 -larmadillo
From what you describe, certain options only rely on the "header only" components of the library, and you can safely skip the -larmadillo bit of the command line.
But other parts need the library implementation to go with it.
This means you need to do 2 things:
1. Actually build the downloaded Armadillo library to generate said object library.
2. Configure your visual studio project to pick that library up when your project is being linked.
as I understand I should link the SuperLU library to my project in order to use this function in Armadillo. I downloaded the SuperLU from here (http://crd-legacy.lbl.gov/~xiaoye/SuperLU/) and link to my project in visual studio. but there is a problem in line 15 in my code.
#if !defined(ARMA_USE_SUPERLU)
#define ARMA_USE_SUPERLU
//// Uncomment the above line if you have SuperLU.
//// SuperLU is used for solving sparse linear systems via spsolve()
//// Caveat: only SuperLU version 5.2 can be used!
#endif
> \\130.88.112.127\share\Morteza\porenetwork\test\SuperLU-master\lib\libsuperlu_4.3.a
That looks like a Unix/Linux library file, and you're compiling on Windows.
You need to make a Windows compatible library of SuperLU and link against that instead.