On Tue, Feb 5, 2013 at 8:42 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> > On Tue, Feb 5, 2013 at 7:32 AM, Matthew Knepley <knepley at gmail.com> wrote: > >> 4. XXIntializePackage() is called automatically for all default PETSc >> classes when using --with-single-library=1 >> >> I am guessing that default call will use PETSC_COMM_WORLD. >> > > One way to do this is to make a "constructor" function for each shared > library that registers its *InitializePackage function to be called from > PetscInitialize. (Constructors are called before main so they can't be > collective.) Then we wouldn't have a source-level reverse dependency and it > would get loaded even for single-library=0. I'm not aware of any platforms > that don't support some constructor mechanism, either via an attribute or > C++ (which should not require linking libstdc++). > It sounds like the most likely thing to break on porting, however its exactly what we have for dynamic libraries. Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130205/24df5dc8/attachment.html>