[petsc-dev] --known-mpi-shared-library and --with-batch annoyance
Barry Smith
bsmith at mcs.anl.gov
Thu Apr 21 14:36:51 CDT 2016
> On Apr 21, 2016, at 2:09 PM, Jed Brown <jed at jedbrown.org> wrote:
>
> Barry Smith <bsmith at mcs.anl.gov> writes:
>> We generate (or should if we don't) our shared PETSc libraries by
>>
>> sharedlink petscsys.so -lmpi
>>
>> sharedlink petscvec.so -lpetscsys
>
> If your shared libraries are set up correctly and there is a strict
> policy about transitive linking (the correct thing), then this is not
> okay because petscvec.so has direct calls to MPI. If libmpi.a (built
> with -fPIC) was inlined into petscsys.so, then it would "work" (but be
> disgusting).
But this means, in general, that one cannot mix static and shared libraries if the static libraries have any global variables? Thus Matt is correct that we need to have MPI shared library if we have multiple PETSc libraries
More information about the petsc-dev
mailing list