patchGNU Octave - Patches: patch #8314, Patch to build system to use...


patch #8314: Patch to build system to use @rpath for Mac liboctave/libinterp

Submitted by:  Michael C. Grant <mcgrant>
Submitted on:  Thu Feb 13 16:22:13 2014  
Category: Core : otherPriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Fri Aug 5 20:36:39 2016, comment #5:

This patch needs to be updated to work with the current build system.

It seems to me that things like

should not be hard-coding the library version number. There are now variables for those.

the liboctave, libinterp, libgui, and src directories now have files instead of separate files. So there can be only one all-local target, in the top-level Makefile. I suggest adding {lib{octave,interp,gui},src}-all-local targets as dependencies of all-local, and defining those targets in teh corresponding files.

John W. Eaton <jwe>
Project Administrator
Thu Jul 7 23:15:15 2016, comment #4:

Ben, could you comment on whether this should go into 4.2.0?

Lachlan Andrew <lachlan>
Project Member
Tue Mar 25 14:22:08 2014, comment #3:

Hey, is there any chance we can get this patch committed to gui-release? Since John has designated that branch as a sort of a "sandbox" for making Octave and CVX play friendly with each other, it would be helpful to have this in there.

This particular makes MEX files portable across Mac installations (assuming no other external dependencies). It has no impact on Linux or Windows. It is similar to the approach employed by Octave-Forge, I believe, when building a Mac app bundle for Octave.

Michael C. Grant <mcgrant>
Sat Feb 22 17:14:55 2014, comment #2:

Added liboctgui.0.dylib to the @rpath treatment. Necessary if the end goal is to make the package relocatable.

(file #30641)

Michael C. Grant <mcgrant>
Thu Feb 13 19:33:29 2014, comment #1:

Patch amended slightly to bypass errors that occur if "install_name_tool -add_rpath" is run twice on the same executable (as will happen with, say, "make all; make install"). Please use rpath2.diff instead of rpath.diff.

(file #30541)

Michael C. Grant <mcgrant>
Thu Feb 13 16:22:13 2014, original submission:

The following patch inserts additional build steps (using "all-local") in libinterp/Makefile, liboctave/Makefile, and src/Makefile so that these internal libraries and the binaries use the @rpath construct.

Specifically, the libraries' "install names" are changed to @rpath/liboctinterp.2.dylib and @rpath/liboctave.2.dylib, and the executables add $(octlibdir) to their RPATH list.

Why does this matter? It enables MEX/OCT files to be shared between users without recompilation and without having to resort to DYLD_LIBRARY_PATH tricks. I believe this is already possible for Linux and/or Windows, but these steps are needed for the Mac. (Indeed, Octave Forge's app bundles have to do something like this on a larger scale).

If you study the patch you will see I attempted to ensure that this is engaged ONLY on a Mac, only when shared libraries are being built, and only when the 'install_name_tool' utility is available. So this should leave builds for all other platforms unchanged.

Michael C. Grant <mcgrant>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #30641:  rpath3.diff added by mcgrant (3kB - application/octet-stream)
file #30541:  rpath2.diff added by mcgrant (3kB - application/octet-stream)
file #30538:  rpath.diff added by mcgrant (3kB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by lachlan
  • -unavailable- added by mcgrant (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Jul 7 23:15:38 2016lachlanCategoryNone=>Core : other
    Thu Jul 7 23:15:15 2016lachlanCarbon-Copy-=>Added bpabbott
    Sat Feb 22 17:14:55 2014mcgrantAttached File-=>Added rpath3.diff, #30641
    Thu Feb 13 19:33:29 2014mcgrantAttached File-=>Added rpath2.diff, #30541
    Thu Feb 13 16:22:13 2014mcgrantAttached File-=>Added rpath.diff, #30538

    Back to the top

    Powered by Savane 3.1-cleanup1