[petsc-users] How to use petsc in a dynamically loaded shared library?

Florian Beck Flo.44 at gmx.de
Wed Jul 18 05:50:10 CDT 2012


Hi,

I want to use the petsc library in a shared library which I'm dynamically loading in my main program. Therefore I'm not using the functions to destroy a Vector such as VecDestroy. If I use the function I got an segmentation fault error. Of course I have a memory leak, because I'm not using the functions to destroy my vectors. Is there a simple example how to use the petsc-library in a program like the following pseudo-code:

main{

 for 1 to 10 

   do_something 

   call function_to_solve_Ax=b_with_petsc

   do_something

 end

}


More information about the petsc-users mailing list