bugGNU Octave - Bugs: bug #41460, mkoctfile issues on Mac: can't...


bug #41460: mkoctfile issues on Mac: can't find X11 libs (and side question: why link with all dependencies)?

Submitted by:  Michael C. Grant <mcgrant>
Submitted on:  Wed 05 Feb 2014 01:18:40 AM UTC  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: DuplicateAssigned to: None
Originator Name: Michael C. GrantOpen/Closed: Closed
Release: devOperating System: Mac OS

Add a New Comment(Rich Markup)

You are not logged in

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


Fri 28 Mar 2014 01:52:33 AM UTC, comment #2:

Thanks, marking as duplicate and closing this bug.

Mike Miller <mtmiller>
Project Administrator
Fri 28 Mar 2014 01:31:10 AM UTC, comment #1:

This can probably be closed as a duplicate of bug 41574.

Michael C. Grant <mcgrant>
Wed 05 Feb 2014 01:18:40 AM UTC, original submission:

I observed this when using the stable branch here with the mkoctfile executable.

Attempting to compile a very simple MEX file (with no dependencies on external libraries save the system) returned this:

The verbose output is this:

Adding either '-L/opt/X11/lib' or '-L/usr/X11/lib' does the trick. It would seem that somehow the configure/build system isn't picking up that mkoctfile needs to provide this flag by default.

But I must ask: why should it be trying to link to X11 at all? And more generally, why should mex/oct files link to all of Octave's dependencies? It seems to me that this is going to make it nearly impossible for me to distribute binaries to other Octave users, because I have no way to ensure that 1) they have installed the same dependencies I have; and 2) they have installed in them in the same locations I have. (That assumes we can figure out the relative library path issue on all platforms as well.)

Matlab, by contrast, links its mex files only to its own internal libraries (libmx/libmex/libmat) and the system libraries by default. If you want a direct connection to BLAS or LAPACK or any other library it uses internally, you need to add -lblas or -llapack yourself. Combined with an effective relative path strategy, this has the nice effect of allowing MEX files to be compatible across installations and different versions.

It does seem that the fact that Octave depends on so many external libraries makes this approach more problematic. I could see two solutions: 1) implement custom linker-style "-l" flags that add those dependencies on demand; for example, '-lfftw' automatically brings in the local installation of FFTW; or 2) provide an option '--minimal-dependencies' or somesuch that strips all but the truly essential libraries.

I think I'll be able to accomplish my goal by bypassing mkoctfile and compiling the functions by hand. But it does seem wise to provide this facility more generally.

Michael C. Grant <mcgrant>


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

Attach File(s):

No files currently attached


   bug dependencies.

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -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 project members can vote.


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



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 28 Mar 2014 01:52:33 AM UTCmtmillerStatusNone=>Duplicate
      Dependencies-=>Depends on bugs #41574

    Back to the top

    Powered by Savane 3.1-cleanup1