[petsc-dev] Symbol visibility

Barry Smith bsmith at mcs.anl.gov
Mon Dec 6 12:53:11 CST 2010


On Dec 6, 2010, at 11:53 AM, Jed Brown wrote:

> I'm not convinced that removing the PETSCXXX_DLLEXPORT stuff was a good thing.  Besides the obvious issues on Windows, it removes the ability to do proper export control.  This is discussed at length in section 2.2:
> 
> http://www.akkadia.org/drepper/dsohowto.pdf#page=17
> 
> but the tangible benefit is that distro packagers would be happier because it allows more robust handling of dependencies.  I realize that it was unused, but the "export" label has real meaning (even if only as documentation at this point) in a library context.  Most internal functions can (and should) be static, but there are a few that need more than file scope, but still shouldn't be exported.
> 
> I understand that it's one more thing, and perhaps the simplicity is worth it, but I wanted to point out that with those macros, we could have used (gcc/clang/intel) -fvisibility=hidden and defined the macro to __attribute__((visibility("default"))).
> 
> Jed

  Worse comes to worse I put it back (but better next time :-).

  Actually I think handling these "things" with CPP is not the way to go, in fact, I'd like to see, if possible, almost no use of CPP in PETSc source. Reason: PETSc source code currently is the combination of two relatively simple but very different, languages CPP and C. Doing source to source manipulations on this beast is a nightmare because one cannot even parse CPP plus C. If we eliminate the CPP then it becomes only C which we parse and manipulate relatively easily, this opens up enormous opportunities for a whole new approach to code development we do not have currently and cannot have with a CPP plus C code base. Of course, I could be totally on the wrong track but I won't know without investigation.

  Honestly I am sick of having this big code base where making changes means editing flat files and manually changing source code, I thinking that model really needs to change. I don't really know how to change the model but I really want to see if change and if that involves going down some wrong roads that is ok with me, better than not trying things.

  Barry





More information about the petsc-dev mailing list