Opened 15 years ago

Closed 15 years ago

#20222 closed defect (fixed)

R-2.9.1 patch to better handle the dynamic libraries

Reported by: blb@… Owned by: kjell.konis@…
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: Cc: mamoll (Mark Moll), jvliwanag@…
Port: R

Description

R does some interesting linking to avoid encoding paths into the dylibs it installs (hence the install_name_tool stuff in post-destroot). This means that env variables would need to be set in order to properly run software (like rpy, see #18783 and #18784). A better method would be to patch the build system so the dylibs have the right path right away, making it work better with extensions.

Attached is a patch to R (updates Portfile and adds a patch file) which accomplishes this. It gets rpy2 to build and run against it, and R itself appears to still work fine with several demos.

Attachments (3)

R.diff (3.9 KB) - added by blb@… 15 years ago.
diff to R
R.2.diff (4.5 KB) - added by kjell.konis@… 15 years ago.
Updates R to 2.9.2 and incorporates the patch provided by blb.
R.3.diff (6.9 KB) - added by kjell.konis@… 15 years ago.
third time's the charm

Download all attachments as: .zip

Change History (11)

Changed 15 years ago by blb@…

Attachment: R.diff added

diff to R

comment:1 Changed 15 years ago by mamoll (Mark Moll)

Cc: mmoll@… added

Cc Me!

comment:2 Changed 15 years ago by kjell.konis@…

Port maintainer here. Sorry I have been off the radar so far. Unfortunately I won't be able to test this out for a couple more days (I am on a trip and I didn't bring my laptop). Please make sure that the dylibs (they have a .so file extension) in RHOME/library/*/libs also have the correct paths encoded. Also, is there some problem right now that this patch fixes? I can submit it upstream and it will almost certainly be in the next R release.

comment:3 Changed 15 years ago by blb@…

This updates the libraries in ${prefix}/lib/R/lib to have the full path encoded, as otherwise anything which wants to link to R would need to have a DYLD environment variable set to see it properly. This initially came up due to ticket #18784.

The files in RHOME/library/*/libs are .so files so I'm guessing they are dlopen()'d right? If so, they don't need a path encoded since dlopen() is going to need a full path prior to even touching them.

As far as upstream, I'm guessing this won't happen since it seems like they want R to be easily relocatable by default, hence this would seem to be somewhat MacPorts-specific.

comment:4 Changed 15 years ago by kjell.konis@…

I am unable to get R to build with these modifications (OS X 10.4, ppc). That's why this is taking so long ):

comment:5 Changed 15 years ago by mamoll (Mark Moll)

I can confirm that the patch works on OS X 10.5. If the rpy bug mentioned above does not occur on 10.4, maybe the patch can be wrapped in a darwin_9 (and darwin_10?) variant.

Changed 15 years ago by kjell.konis@…

Attachment: R.2.diff added

Updates R to 2.9.2 and incorporates the patch provided by blb.

comment:6 Changed 15 years ago by jvliwanag@…

Cc: jvliwanag@… added

Cc Me!

Changed 15 years ago by kjell.konis@…

Attachment: R.3.diff added

third time's the charm

comment:7 Changed 15 years ago by kjell.konis@…

OK, R.3.diff actually does what I said R.2.diff would do. Sorry. Also fixes #21450.

comment:8 Changed 15 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

Applied in r58123.

Note: See TracTickets for help on using tickets.