bugGNU Octave - Bugs: bug #29427, mex help text not displayed

 
 

bug #29427: mex help text not displayed

Submitter:  None
Submitted:  Sat 03 Apr 2010 01:04:55 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  dbateman
Originator Name:  Dan McMahill Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 21 May 2012 09:06:09 PM UTC, comment #4: 

As mex files are for legacy matlab support we should follow their conventions. Reading the document from mathworks "Introducing Mex files" they write


If you invoke the function conv2 from inside
MATLAB, the interpreter looks through the list of directories on the MATLAB
search path. It scans each directory looking for the first occurrence of a file
named conv2 with the corresponding filename extension from the table or .m.
When it finds one, it loads the file and executes it. MEX-files take precedence


So the suggestion of allowing the m-files to exist in a different directory seems to be a bad idea to me. I'm closing this bug report as the orginal bug was fixed two years ago, and the follow up comment doesn't seem to be a bug.

D.

David Bateman <dbateman>
Group Member
Tue 13 Mar 2012 04:21:09 PM UTC, comment #3: 

Hello.  I happened to try out octave-3.6.1 last weekend and found that the patch which was pushed did not work for me.  From looking at the source code it appears that the issue is the code which was pushed looks for the .m file in the same directory as the .mex file.  However, it isn't clear to me that .m files are supposed to install to the same place as mex files. 

I would have thought the right places for the .mex files and .m files would have been:

octave-config --print LOCALVEROCTFILEDIR

and

octave-config --print LOCALVERFCNFILEDIR

-Dan

Anonymous
Sun 25 Apr 2010 09:23:23 PM UTC, comment #2: 

Your solution is quite elegant, as get_help_from_file parses the function file and then deletes the function before inserting it in the symbol table. Though it means that the function file has to be parsed every time the help string is requested. I tend to read the help text several times so it would make more sense to me to do something similar to what you propose when loading the mex-file itself so the help string might be cached.

I just pushed the change

http://hg.savannah.gnu.org/hgweb/octave/rev/a61d7248627c

that fixes this issue based on your idea.

Thanks
D.

David Bateman <dbateman>
Group Member
Wed 21 Apr 2010 01:39:57 PM UTC, comment #1: 

looks to me like the problem is that in help.cc, we start searching for help text.  If we find the function in the symbol table (which I guess means it is either a built-in or dynamically linked as opposed to a script file) then we stop.  The patch makes us keep looking if the help text found from the symbol table lookup is empty. 

I tried help on a few other functions and it looks like I didn't break anything, but this should be reviewed perhaps by someone who understands that bit of code a little better.

-Dan

Anonymous
Sat 03 Apr 2010 01:04:55 AM UTC, original submission:  

I'm using octave-3.2.4.  I have a compiled mex function which has been installed to:

${prefix}/libexec/octave/3.2.4/site/oct/i686-pc-linux-gnu/wcalc-1.1/bars_calc.mex

It works.  When I run octave, bars_calc() is available as a function and does what I expect.

However, the online help does not  work.

octave-3.2.4:1>  help bars_calc
error: help: `bars_calc' is not documented

yet I do have this file installed:
${prefix}/libexec/octave/3.2.4/site/m/wcalc-1.1/bars_calc.m

The top several lines of bars_calc.m look like the following.  The
first "%" line is the first line of the file.

%BARS_CALC        - Self and mutual inductance of a pair of parallel
rectangular bars
%
%  SYNOPSIS
%
%  [L1, L2, M, k] = bars_calc(a, b, l1, d, c, l2, E, P, l3, freq)
%
%  PARAMETERS
% ....


I'm pretty sure that this used to work for me.  If interested, wcalc.sf.net has the package that I'm trying to install.

-Dan

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #20292:  patch-aa added by None (327B - application/octet-stream - attached patch seems to fix it.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Updated the item)
  • -email is unavailable- added by dbateman (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-21 dbateman StatusNone Fixed
        Open/ClosedOpen Closed
    2012-03-13 jordigh StatusFixed None
    2012-03-13 jordigh Open/ClosedClosed Open
        Release3.2.4 3.6.1
        Summarymex help text not working mex help text not displayed
    2010-04-25 dbateman StatusNone Fixed
        Assigned toNone dbateman
        Open/ClosedOpen Closed
    2010-04-21 None Attached File- Added patch-aa, #20292

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code