[petsc-dev] Apple sadness

Barry Smith bsmith at mcs.anl.gov
Wed Mar 31 16:48:44 CDT 2010


On Mar 31, 2010, at 2:19 PM, Sean Farley wrote:

> I have finally figured out that gdb will not read any symbols for  
> source
> that does not have the object file with it. So when PETSc deletes the
> .o's after achiving, all I get is a stack. When I save the  
> application .o
> that I am running, at least I can see those symbols. Is this universal
> on Mac. Can I fix it?
>
> This has happened to me since Leopard. In fact, it was the first  
> time I ever emailed the petsc list :-) The fix came from Barry and  
> comment out the line in the makefile that deletes the temporary .o's
>
> I believe the error was that there was no flag to stuff the debug  
> objects in the dynamic library. Was that right, Barry?
>
> Sean

   Matt,

    Sean's understanding is my understanding. Here is my understanding

1)  This is only a problem with shared libraries (with static  
libraries it finds the debug symbols).
2) If you don't delete the .o after making the shared library then it  
finds the symbols
3) my reading of the ld manual page is that the symbols SHOULD be put  
into the dylib; I do not understand why they are not, google searches  
never helped me resolve this issue
4) When I want to debug an application I use something like make ex1  
RM=/usr/bin/true and ex1.o is kept around so it can find the symbols  
for ex1

    So, try removing the line               ${RM} -rf $ 
{INSTALL_LIB_DIR}/$$LIBNAME.tmp-petsc-shlib; \  from conf/rules and  
then make the shared library. Can you now find the symbols in the  
debugger? Is there a good permanent fix for this?

    Barry




More information about the petsc-dev mailing list