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

Florian Beck Flo.44 at gmx.de
Tue Jul 24 10:24:43 CDT 2012


On Sun Jul 22 11:28:18 CDT 2012  Jed Brown jedbrown at mcs.anl.gov wrote:

>>
>> Back to my problem, I think I have a problem with the initialisation of
>> the petsc library and therefore I'm not able to create vectors in the
>> right way. I call PetscInitialize() as in the examples shown. Are there
>> some special functions to check if everthing is initialized correct?
>>
>> My example works fine except the destroying of the vectors, for the
>> first testing I run it serial. Can that cause my problem?
>>
>>
>Can you send us a reduced test case to demonstrate the problem?

Hi I think I have solved my problem, but I don't know why. The things I have change to my previous version are the following. In my previous version I moved my installed petsc library. I read that this could cause some problems. And I had the following construct: executable load shared library A with dlopen. I linked the petsc library to library B and B to A. Now I have change it to: executable load lib A. And I have linked petsc to A. 

I try to reproduce it in a smaller example. If the smaller example has the same problems I will send it to you. Or can you say without the example what the problem is?


More information about the petsc-users mailing list