Opened 13 years ago

Closed 13 years ago

#32634 closed enhancement (fixed)

building R with debug symbols

Reported by: macporter90210@… Owned by: kjell.konis@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: haspatch Cc: drkp (Dan Ports)
Port: R

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I want to build R with debug symbols so I can more easily debug my C extensions and how they interact with R. I modified the portfile to use apple's gcc and the -g flag. It installed fine, but it seems that the debug symbols aren't found by gdb.

  1. What should I do so that when I compile with -g, the symbols can be found?
  2. Do I need to use apple's rather than the mp gcc to do this?
  3. I think other people might find this useful so it would be nice if the debug variant, after appropriate corrections can be added to the port.

I attach the port diff.

Attachments (2)

Portfile.diff (624 bytes) - added by macporter90210@… 13 years ago.
portfile diff to add debug variant - doesn't seem to work
Portfile.2.diff (1.2 KB) - added by kjell.konis@… 13 years ago.
Adds debug variants and bumps version to 2.14.1.

Download all attachments as: .zip

Change History (8)

Changed 13 years ago by macporter90210@…

Attachment: Portfile.diff added

portfile diff to add debug variant - doesn't seem to work

comment:1 Changed 13 years ago by macporter90210@…

The -k option as

port -k install r +apple42debug -gcc44

seems to do it.

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Owner: changed from macports-tickets@… to kjell.konis@…
Type: requestenhancement

The "-k" flag means keep the build files after installation; I suppose this is necessary for debugging.

The port currently forces the use of MacPorts gcc complier; I assume the maintainer has a good reason to do this and that we should not then offer the choice to override that.

Would just this work? (Untested)

variant debug {Build with debug symbols} { 
    configure.optflags-append -g 
}

comment:3 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

comment:4 in reply to:  3 Changed 13 years ago by macporter90210@…

Replying to ryandesign@…:

You mean

variant debug description {Build with debug symbols} { 
    configure.optflags-append -g 
}

Yours gave the error Error: Unable to open port: wrong # args: should be "proc name args body". Funny how that happens. I am trying to see if this does it.

Changed 13 years ago by kjell.konis@…

Attachment: Portfile.2.diff added

Adds debug variants and bumps version to 2.14.1.

comment:5 Changed 13 years ago by kjell.konis@…

Maintainer here. I added the suggested variant and bumped the version to 2.14.1. Let me know if that solves your problem. Thanks.

comment:6 in reply to:  5 Changed 13 years ago by drkp (Dan Ports)

Cc: dports@… added
Resolution: fixed
Status: newclosed

Replying to kjell.konis@…:

Maintainer here. I added the suggested variant and bumped the version to 2.14.1. Let me know if that solves your problem. Thanks.

Thanks, committed in r88382.

Note: See TracTickets for help on using tickets.