This forum has been archived. All content is frozen. Please use KDE Discuss instead.

how to use PardisoLU

Tags: None
(comma "," separated)
ivanchang
Registered Member
Posts
7
Karma
0

how to use PardisoLU

Fri Sep 16, 2016 4:24 am
Hi all-

I am new in using Eigen. And I need to solve Sparse Matrix(To get its inverse matrix by solving Ax=I), I know how to do this with Eigen::SparseLU solver. But I want to try Eigen::PardisoLU. I already installed MKL in my mac and add its include and lib file to my project's header search path and library search path( I am using Xcode).

But the running error exists like this:

Undefined symbols for architecture x86_64:
"_pardiso", referenced from:
Eigen::internal::pardiso_run_selector<int>::run(void*, int, int, int, int, int, void*, int*, int*, int*, int, int*, int, void*, void*) in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


and my code is :
Eigen::PardisoLU<Eigen::SparseMatrix<double>> s2;
s2.compute(sm);//sm is sparse matrix here
inverse = s2.solve(identity);

Could someone tell me what's wrong with this??
metalfox
Registered Member
Posts
7
Karma
0

Re: how to use PardisoLU  Topic is solved

Fri Sep 16, 2016 6:05 am
You have to link the mkl libraries. This involves (1) telling the compiler where those libraries are, and (2) specifying the libraries you want to link at link time.

With the intel compiler this is very simple because the -mkl compiler flag suffices.

With other compilers (say gcc) possibly the simplest way is something like:

(1) export LD_LIBRARY_PATH=(path to your mkl library binaries):$LD_LIBRARY_PATH
(2) tell the compiler the libraries you want to link: -lmkl_core -lmkl_intel_thread and possibly some more.

Note the above commands are for a Linux environment. No idea under OSX.

Furthermore, you can choose using openmp or tbb as the underlying threading model.

I'd suggest that you research a little about linking mkl with your compiler/platform. There is a dedicated website explaining the process: https://software.intel.com/en-us/articl ... ne-advisor
ivanchang
Registered Member
Posts
7
Karma
0

Re: how to use PardisoLU

Fri Sep 16, 2016 4:20 pm
metalfox wrote:You have to link the mkl libraries. This involves (1) telling the compiler where those libraries are, and (2) specifying the libraries you want to link at link time.

With the intel compiler this is very simple because the -mkl compiler flag suffices.

With other compilers (say gcc) possibly the simplest way is something like:

(1) export LD_LIBRARY_PATH=(path to your mkl library binaries):$LD_LIBRARY_PATH
(2) tell the compiler the libraries you want to link: -lmkl_core -lmkl_intel_thread and possibly some more.

Note the above commands are for a Linux environment. No idea under OSX.

Furthermore, you can choose using openmp or tbb as the underlying threading model.

I'd suggest that you research a little about linking mkl with your compiler/platform. There is a dedicated website explaining the process: https://software.intel.com/en-us/articl ... ne-advisor




Thanks, really appreciate it.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]