[petsc-dev] Apple sadness

Barry Smith bsmith at mcs.anl.gov
Mon Apr 12 14:54:27 CDT 2010

On Apr 12, 2010, at 1:49 PM, Satish Balay wrote:

> We [sean and I] have a better fix for this issue.
    Cool, thanks for figuring this out.

> Basically we have to run dsymutil on the binary/.dylib - before the .o
> files are deleted. This creates binary.dSYM dir - which has the debug
> info - thats available for the debugger.
> I've pushed a fix for libpetsc.dylib to petsc31/dev- so that part
> works now.
> However - when the application is built - for example - ex1.c, ex1.o
> gets deleted aswell by our makefiles, so that part of the debug
> symbols are still missing.  [we don't have a generic target here to
> modify - so I'm not sure how to deal with it]

    Like I said before I use make ex1 RM=/usr/bin/true and the leaves  
behind the .o and the debugger is happy. Any reason this isn't the way  
to go?


> satish
> On Wed, 31 Mar 2010, Barry Smith wrote:
>> 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