> On Apr 21, 2016, at 2:09 PM, Jed Brown <[email protected]> wrote: > > Barry Smith <[email protected]> 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
