bugGNU Octave - Bugs: bug #47713, the function in a mex file turns...

 
 

bug #47713: the function in a mex file turns out undefined when all the letters of the file's name are capital

Submitted by:  Wayne <wayne19>
Submitted on:  Sat 16 Apr 2016 06:08:31 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: Works For MeAssigned to: None
Originator Name: WayneOpen/Closed: Closed
Release: 4.0.1Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Mon 18 Apr 2016 09:51:52 AM UTC, comment #6:

Thank you very much, Wayne, for reporting back and confirming Matlab's behavior.

Closing report.

Philip Nienhuis <philipnienhuis>
Project Member
Mon 18 Apr 2016 01:34:07 AM UTC, comment #5:

Thanks so much for your patience and help.
I know the reason now. Before I compiled it into a mex file, I had compiled it with this command:

(Apparently I used a wrong command at first. However there wasn't any error or warning message.)

So there is a PANDA_SF_2_HF.oct file along with the PANDA_SF_2_HF.mex file. This is the very reason why Octave cannot find the function. After I deleted the oct file, everything became fine.

As for MATLAB, it is case-sensitive. With PANDA_SF_2_HF.mexw32 under my folder "D:\test\", I've tried to call the function with PANDA_SF_2_hf. And the output was as follow.

Wayne <wayne19>
Sun 17 Apr 2016 12:21:35 PM UTC, comment #4:

BTW, how does Matlab treat case-sensitivity of mex files and function names in that mex file? I don't have Matlab around ATM.

If Matlab behaves case-insensitive as regards .mex files we'd have a case of Matlab-incompatibility.

Philip Nienhuis <philipnienhuis>
Project Member
Sun 17 Apr 2016 12:18:55 PM UTC, comment #3:

With Octave-4.0.1 from ftp.gnu.org I get:

...so that works fine AFAICS.

Let's dig further. What is the exact error message you get?

Anyway I suspect you are a bit confused about case-sensitivity nitty-gritty, and about file names and function names in a file.

On Windows, the entire file system is case-insensitive and AFAIK even MinGW/MSYS cannot get around that.
But OTOH Octave's namespace IS case-sensitive. The only way I can get an error is when I call the just-compiled PANDA_SF_2_HF module with:

What happens is that Octave puts an identifier for Octave's namespace in the module and Octave's parser expects the case of that identifier to match the function call exactly, no matter what the file name looks like.

You might try with:
+ verbatim+

>> autoload ("PANDA_SF_2_Hf", which ("PANDA_SF_2_HF"))
>> PANDA_SF_2_Hf

Hello, World!
I have 0 inputs and 0 outputs
-verbatim-

(Hey! now it does work)
(FYI, autoload() instructs Octave to load some function called "foo" (case-sensitive !) from some file called e.g., "bar". See help autoload)

All in all I think you simply mixed up case somewhere.

I'm tempted to close this report with "Works for me", but I'll await your response for a while.

Philip Nienhuis <philipnienhuis>
Project Member
Sun 17 Apr 2016 12:00:38 AM UTC, comment #2:

I've just tried the following short example:

Save the code above as PANDA_SF_2_HF.c and compile it with
and then run it. the problem would be reproduced.

However if the file name is PANDA_SF_2_Hf.c, it works perfectly.

Wayne <wayne19>
Sat 16 Apr 2016 06:18:53 PM UTC, comment #1:

Would you please describe an example to reproduce the problem?

Philip Nienhuis <philipnienhuis>
Project Member
Sat 16 Apr 2016 06:08:31 AM UTC, original submission:
Wayne <wayne19>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by philipnienhuis
  • -unavailable- added by wayne19 (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 18 Apr 2016 09:51:52 AM UTCphilipnienhuisStatusNeed Info=>Works For Me
      Open/ClosedOpen=>Closed
    Sun 17 Apr 2016 12:23:10 PM UTCphilipnienhuisCarbon-Copy-=>Added philipnienhuis
    Sat 16 Apr 2016 06:18:53 PM UTCphilipnienhuisStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1