4
$\begingroup$

I want to incorporate matrix solver into my program. Is it possible to separate out any library of matrix solver from PETSc? I am working in C language. It will be very helpful if I get any library without installing PETSc. If I get it, then I will just add those source codes and will use it.

$\endgroup$
6
$\begingroup$

You can configure with separate libraries (--with-single-library=0) and link only the ones you need (e.g., -lpetscmat -lpetscvec -lpetscsys), but this is generally a waste of effort. If you use static libraries, then only the parts you reference go into the binary (if you're trying to squeeze the last megabyte out of a memory-constrained environment). PETSc compiles in about one minute, so build time is not a reason. We don't distribute stand-alone sub-components only because it's simpler to build everything and configure is really the hard part of distribution.

$\endgroup$
4
$\begingroup$

No. Like many other libraries, you will spend far more time trying to isolate a piece than to simply use the whole thing. Why not just install PETSc somewhere and use it as-is?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.