ML symbols in

Satish Balay balay at
Thu Oct 29 16:33:05 CDT 2009

On Thu, 29 Oct 2009, Lisandro Dalcin wrote:

> >> > IMHO, I think that what Jed suggested in previous mail about using
> >> > -Wl,-whole-archive ${PETSC_EXTERNAL_LIB} -Wl,-no-whole-archive when
> >> > --with-shared is in action could be a VERY good idea... Then PETSc
> >> > link lines will not need to refer at all to these static libs from
> >> > external packages...
> >
> > This works for folks who use PETSc - and nothing else. But once you
> > have 2 packages doing this [say both add in hypre symbols] - and then
> > some user wants to use these two packages - you have conflicts. [esp
> > with multiple copies of global variables etc..]
> >
> And can you explain me how the current situation is better?

Yes the current situation doesn't fix the above problem.

> Let's
> suppose other self-contained beast like PETSc  also builds a static
> hypre lib... then when you mix stuff, you have two libhypre.a at
> different places... Then you link your program... and the linker will
> likely pick one... which one? whatever... All this works by accident,
> I think...

Yes. it becomes harder. The thing I keep recommending in these cases
is: make sure only one copy of the package is in the whole chain of
packages. [just like we keep recommending - use the same compile to
compile every package, use the same MPI across all packages etc..]

[note the problem with sharedlibraries can exists even if only one
copy of a package is maintained]

> So I still think that for petsc-downloaded external packages built as
> static libs, the -W,-whole-archive should be used... If this is not
> what users want, then they should previously build these ext packages
> themselves and pass info to After all, when I ask
> PETSc to download a pkg is because I do not have it built/installed...
> for example, I never petsc-download blas/lapack because I have them in
> my boxes... The same applies with MPI, I've never --download-mpi...
> Satish, please note that I'm talking about using --whole-archive ONLY
> with the pkgs that PETSc automatically downloads upon user requests
> using --download-<pkg> ...

Since the curent thing is broken anyway - I guess I shouldn't object to
this change..


> >
> > The ideal solution is to have every library have its own .so
> > file.. [but this is not easy]
> >
> > Satish
> >
> Yes... Perhaps it is not that hard...

More information about the petsc-dev mailing list