bugGNU Octave - Bugs: bug #32033, error: `fnmatch' undefined...

 
 

bug #32033: error: `fnmatch' undefined (octave-dev on MinGW)

Submitted by:  Tatsuro MATSUOKA <tmacchant>
Submitted on:  Mon 03 Jan 2011 07:48:09 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating 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)

Tue 18 Jan 2011 09:09:57 AM UTC, comment #16:

I'm going to close this report since the problem is now fixed in Octave. If gnulib is later fixed to remove the redefinition of fnmatch and we remember, we could revert the change in Octave.

John W. Eaton <jwe>
Project Administrator
Sun 16 Jan 2011 10:29:12 AM UTC, comment #15:

Hello

I have confirmed that the changeset below fix this issue.

Regards

Tatsuro

Tatsuro MATSUOKA <tmacchant>
Sun 09 Jan 2011 10:23:36 PM UTC, comment #14:

Since it looks like the redefinition is happening because of gnulib, I asked about this problem on the gnulib mailing list. I'll change the DEFUN to DEFUNX if there is no way to fix the problem in gnulib.

John W. Eaton <jwe>
Project Administrator
Sun 09 Jan 2011 09:55:43 PM UTC, comment #13:

Using,

DEFUNX ("fnmatch", Ffnmatch,

instead of
DEFUN (fnmatch, ...)

test_system.m result change to

test_system.m .................................... PASS 84/84

Tatsuro MATSUOKA <tmacchant>
Sun 09 Jan 2011 09:41:37 PM UTC, comment #12:

Sorry I have omitted to see the below:

*******************
/* Define to a replacement function name for fnmatch(). */
#define fnmatch posix_fnmatch
*******************

The above is found in config.h.

Tatsuro MATSUOKA <tmacchant>
Sun 09 Jan 2011 09:36:45 PM UTC, comment #11:

You wrote:

Yes, but is there another line that does

John W. Eaton <jwe>
Project Administrator
Sun 09 Jan 2011 09:34:01 PM UTC, comment #10:

Looking at the files that you posted, it looks like fnmatch is still being redefined to posix_fnmatch. Where is that happening if it is not in config.h? Does some header file on your system do that? If so, which one?

John W. Eaton <jwe>
Project Administrator
Sun 09 Jan 2011 09:25:59 PM UTC, comment #9:

I carried out git pull and executed ./autogen.sh --copy --gnulib-srcdir=../gnulib. And then I executed configure and make but fnmatch errors in test_system.m still happened.

I have looked into 'config.h' and found
/* Define to 1 if you have the <fnmatch.h> header file. */
/* #undef HAVE_FNMATCH_H */

I have attached a new -save-tmp results and diffs from the previous one in tar.bz2 archived form.

BTW,
I am now trying
*************
#define fnmatch posix_fnmatch
DEFUNX ("fnmatch", Ffnmatch,
*************

After the above will be done I will report here.

(file #22380)

Tatsuro MATSUOKA <tmacchant>
Sun 09 Jan 2011 12:16:08 AM UTC, comment #8:

Are you up to date with gnulib? Could you please try running

in the gnulib source directory, then reconfiguring and rebuilding to see if that fixes this problem? If not, then please check your generated config.h file and see if it has a

line in it, and tell me what that line is.

John W. Eaton <jwe>
Project Administrator
Sat 08 Jan 2011 10:54:05 PM UTC, comment #7:

In the file you attached, I see

so in some header file that is included in dirfns.cc, there is apparently a

or something that has that effect. You could work around the problem by using

instead of

but I would really like to know where this definition is coming from. If it is gnulib, then we should fix the problem instead of just covering it up.

John W. Eaton <jwe>
Project Administrator
Sat 08 Jan 2011 04:17:21 AM UTC, comment #6:

Hello John

Sorry I have not carried out the following
**************************
nm src/.libs/liboctinterp_la-dirfns.o | grep fnmatch
**************************

Results are
**************************
$ nm src/.libs/liboctinterp_la-dirfns.o | grep fnmatch
0000a230 T __Z14Fposix_fnmatchRK17octave_value_listi
U __ZNK10glob_match21opts_to_fnmatch_flagsEj
**************************

On windows, glob and fnmatch do not exist in default. By the 3.2, the widows builders uses the originally prepared glob and fnmatch. As far as I remember, when you decided to use gnulib, discussion on glob and fnmatch were carried out. Final conclusion is to use gnulib version of glob and fnmatch if the system does not have them.

Therefore of source, in condig.h,

/* Define to 1 if you have the <fnmatch.h> header file. */
/* #undef HAVE_FNMATCH_H */

Therefore in libgnu/.libs, fnmatch.o exists and fnmatch.o is found libgnu.a.

And I also fonud 'fnmatch' in liboctinterp_la-dirfns.o by an text editor as I wrote in the previous mail.

I attached dirfns.ii (bzip2 compressed).

Regards

Tatsuro

(file #22376)

Tatsuro MATSUOKA <tmacchant>
Thu 06 Jan 2011 11:56:34 PM UTC, comment #5:

So there is no fnmatch symbol in src/.libs/liboctinterp_la-dirfns.o at all? What does

return by itself? Does this file have any symbols at all? I can't see any conditionals in the corresponding dirfns.cc file that would cause the fnmatch function to be omitted.

Is there a "#define fnmatch ..." on MinGW systems that is causing trouble?

Can you add -save-temps to CXXFLAGS and recompile dirfns.cc and attach the resulting dirfns.ii file? Maybe that will give a clue about why there is no fnmatch symbol present.

John W. Eaton <jwe>
Project Administrator
Thu 06 Jan 2011 11:18:54 PM UTC, comment #4:

nm src/.libs/liboctinterp_la-dirfns.o | grep fnmatch

I found that fnmach in src/.libs/liboctinterp_la-dirfns.o using the editor.

****************
cd %s: %s rename readlink link mkdir directory exists readdir symlink fnmatch confirm_recursive_rmdir all filesep glob
*****************

I executed the following
octave:1> x = _builtins_ ();
octave:2> x{strmatch ("fnmatch", x)}
octave:3>

Tatsuro MATSUOKA <tmacchant>
Thu 06 Jan 2011 07:33:17 AM UTC, comment #3:

What does

show on your system?

Or, what does

show?

John W. Eaton <jwe>
Project Administrator
Mon 03 Jan 2011 08:45:08 AM UTC, comment #2:

Hello

Thank you for your reply.

I have tried,

octave:18> fnmatch ("f*", "foo")
error: `fnmatch' undefined near line 18 column 1

fnmatch has not be able to be recognized from the octave on MinGW (developments source since Benjamin had reported the error.

Tatsuro MATSUOKA <tmacchant>
Mon 03 Jan 2011 08:10:26 AM UTC, comment #1:

This looks like Octave is telling you that its fnmatch function is not available, but I don't see how that could happen. The fnmatch function is defined in dirfns.cc, and is always defined as far as I can tell.

What happens if you start Octave and type

fnmatch ("f*", "foo")

at the command prompt?

John W. Eaton <jwe>
Project Administrator
Mon 03 Jan 2011 07:48:09 AM UTC, original submission:

In the fntests on octave-dev source (3.3.54+ on Jan 1, 2011), I have met errors,

Integrated test scripts:
<snip>
Fixed test scripts:

test_system.m .......................................... PASS 81/84 FAIL 3

Summary:

PASS 4963
FAIL 20

In the test_system,
***** test
string_fill_char = setstr (0);
assert((fnmatch ("a*a", {"aba"; "xxxba"; "aa"}) == [1; 0; 1]
&& fnmatch ({"aa"; "bb"}, "bob")
&& fnmatch ("x[0-5]*", {"x1"; "x6"}) == [1; 0]
&& fnmatch ("x[0-5]*", {"x1"; "x6"; "x001"}) == [1; 0; 1]
&& fnmatch ("x???y", {"xabcy"; "xy"}) == [1; 0]));
!!!!! test failed
`fnmatch' undefined near line 4 column 10
***** error <Invalid call to fnmatch.*> fnmatch ();
!!!!! expected <Invalid call to fnmatch.*> but got `fnmatch' undefined near line 2 column 2

***** error <Invalid call to fnmatch.*> fnmatch ("foo", "bar", 3);
!!!!! expected <Invalid call to fnmatch.*> but got `fnmatch' undefined near line 2 column 2

The fnmatch error has already reported by Benjamin in the octave-maintainers list.

http://octave.1599824.n4.nabble.com/building-development-tip-with-mingw32-td2013435.html

I have registered the report of this test result to bug tracker to prevent this issue to be forgotten.

Tatsuro MATSUOKA <tmacchant>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #22376:  dirfns.ii.bz2 added by tmacchant (272KiB - bzip2 compressed dirfns.ii)

 

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 tmacchant (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
    Tue 18 Jan 2011 09:09:57 AM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sun 09 Jan 2011 09:25:59 PM UTCtmacchantAttached File-=>Added dirfns.new.tar.bz2, #22380
    Sat 08 Jan 2011 04:17:21 AM UTCtmacchantAttached File-=>Added dirfns.ii.bz2, #22376

    Back to the top


    Powered by Savane 3.1-cleanup1