I'm going to work on PETSc's dynamic libraries support

Barry Smith bsmith at mcs.anl.gov
Fri Oct 17 18:25:24 CDT 2008

On Oct 17, 2008, at 5:51 PM, Lisandro Dalcin wrote:

> On Fri, Oct 17, 2008 at 4:47 PM, Barry Smith <bsmith at mcs.anl.gov>  
> wrote:
>>> 2) Add appropriate typedefs for PestcDLHandle, an enumeration
>>> PetscDLFlags, and routines PetscDLOpen, PetscDLClose, and  
>>> PetscDLSym.
>>> This would abstract the handling of the different dlopen-like family
>>> of functions across platforms, in a way similar to what GNU libtool
>>> does.
>>  I worry that dlopen()/dlsym() may not be the right level of  
>> abstraction to
>> match (for example the Windows approach) a general idea of "dynamic"
>> libraries.
>> Especially dlsym().
>> I guess it is ok to add them, but I hate to add stuff, you know.
> Just to make it clear, I'm not actually adding stuff.

    I understand this.  I still don't like adding PETSc functions  
unless they
are really adding some value. If the use of dlopen() currently in PETSc
is just replaced by PetscDLOpen() I don't see it as worthwhile, it is  
worthwhile if you plan to use PetscDLOpen() in other places as well
(and those other places also have to have a valid reason to exist  
from the current use).

    I know I am being a bit anal, but I believe 99% of people who do  
computing are overwhelmed by complexity of libraries (and this is why
some nice C++ math libraries are not used by many people) and I think
PETSc is successful because we try very hard not to add stuff unless  
it is
crucial. Numerical computing people are also stupid, in that complexity
of a part of the library they will never use  (like sys) does not make  
the software
harder to use for them but they irrationally cannot see this and think  
package is too complex.


> I'll just
> provide and additional layer of calls that will remove the current
> calls to dlopen()/LoadLibrary() in 'src/sys/dll/dl.c' and move them to
> an additional file named 'src/sys/dll/dlimpl.c' implementing
> PetscDLOpen/PetscDLClose/PetscDLSym as appropriate for
> windows/unix-like as appropriate. In the future, this separation will
> make it easier to support other dlopen-like API's.
> BTW, help me a bit: remeber to wipe-out the petsc-dev-dalcinl repo and
> put there a fresh clone of petsc-dev (perhaps a pull & update is
> enough?)
> -- 
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594

More information about the petsc-dev mailing list