bugGNU Octave - Bugs: bug #43023, Compilation error...

 
 

bug #43023: Compilation error "‘yylex’ was not declared in this scope"

Submitter:  Guillaume <gyom>
Submitted:  Tue 19 Aug 2014 01:57:54 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 03 Nov 2014 02:26:41 AM UTC, comment #18: 

I believe this has been fixed on both default and stable.

http://hg.savannah.gnu.org/hgweb/octave/rev/6b4dfb1e5afb
http://hg.savannah.gnu.org/hgweb/octave/rev/429ed2f2e8c6

Closing report.

Mike Miller <mtmiller>
Group Member
Wed 10 Sep 2014 06:14:09 PM UTC, comment #17: 

Sorry, I forgot that I made the original change on stable.  I'll put this fix there too.

I agree that we should still support some older versions of the tools.  I'm not worried about Bison 2.3.x though.  2.4.x was first released in 2008.

John W. Eaton <jwe>
Group administrator
Wed 10 Sep 2014 05:35:08 PM UTC, comment #16: 

And it now works for me with bison 2.4.1, many thanks!

Guillaume <gyom>
Wed 10 Sep 2014 04:59:29 PM UTC, comment #15: 

This fix works for me with bison 2.4.3, thanks! (Some other unrelated build errors, but I'll take care of those separately.)

With bison 2.3 it correctly reports that it is unable to declare a push-pull parser and refuses to use it.

The only problem I have with this fix is that it's on default, but it's fixing a regression that showed up on stable (and is in the 3.8.2 release).

And I have no problem with obsoleting old bison versions, if you'd rather have configure only test for the most modern syntax and report that all others are not usable. But we will need to keep some feature test for the minimum set of new features that we require. In general it would be nice to at least support whatever versions of tools most regular developers building from hg are using (for example if some people are still on Ubuntu 12.04 or Debian 7, both with bison 2.5).

Mike Miller <mtmiller>
Group Member
Wed 10 Sep 2014 03:27:05 PM UTC, comment #14: 

OK, it was a little more complicated, but I think I have it working now.  I checked in the following changeset:

  http://hg.savannah.gnu.org/hgweb/octave/rev/429ed2f2e8c6

I even tested it (!! I know, right?) with an older version of bison and it seems to work for me.  Let me know if you have additional problems.

Maybe someday the bison interface will stop changing and we can drop all this cruft and just require a sufficiently recent version.  Or is that asking too much?


John W. Eaton <jwe>
Group administrator
Tue 09 Sep 2014 08:44:23 PM UTC, comment #13: 

Hmm, it didn't work correctly.  But something like this should work!

John W. Eaton <jwe>
Group administrator
Tue 09 Sep 2014 08:42:52 PM UTC, comment #12: 

I think the attached patch will fix the problem.  I'm testing it now, but if you can test it and verify that it does work, then please go ahead and apply it.

(file #32051)

John W. Eaton <jwe>
Group administrator
Tue 09 Sep 2014 07:34:07 PM UTC, comment #11: 

And the problem with the detection in OCTAVE_PROG_BISON is that old bison does not error on '%define api.prefix "foo_"', it just emits a warning that you've defined an unused variable. So the current detection misunderstands all bisons as supporting the new syntax.

Mike Miller <mtmiller>
Group Member
Tue 09 Sep 2014 07:18:24 PM UTC, comment #10: 

Looks to me like the problem is incorrect detection of when to use "%define api.prefix" vs. "%name-prefix=". Specifically, when I try to build with bison 2.4.3, configure sets the variable BISON_API_PREFIX_DECL_STYLE to "api" and compilation fails. If I instead build with "make BISON_API_PREFIX_DECL_STYLE=name", compilation succeeds.

Mike Miller <mtmiller>
Group Member
Tue 09 Sep 2014 05:22:48 PM UTC, comment #9: 

Thanks, John. I was just documenting here your advice on how to build Octave after changing the version of Bison.
I'll try to have a closer look but I'm afraid I don't have your expertise.

Guillaume <gyom>
Tue 09 Sep 2014 05:07:50 PM UTC, comment #8: 

Same here, I have seen this error with bison 2.4 as I said in comment #4 and have also meant to dig into this to see what changed and what it should be, but not gotten around to it yet :)

Mike Miller <mtmiller>
Group Member
Tue 09 Sep 2014 04:41:45 PM UTC, comment #7: 

As I said previously, I recently made some changes to allow Octave to be built with Bison 3.0.x. I didn't intend to break things for earlier versions. I'll try to take a look at making it work again, but unfortunately I haven't had time to do that.  If you can spot the flaw in my previous change it would be helpful.

John W. Eaton <jwe>
Group administrator
Tue 09 Sep 2014 04:12:10 PM UTC, comment #6: 

Compilation went fine when running `make maintainer-clean` beforehand as described here:
http://lists.gnu.org/archive/html/octave-maintainers/2014-09/msg00040.html
It would still be useful to build Octave with Bison 2.4.x.

Guillaume <gyom>
Tue 19 Aug 2014 05:57:35 PM UTC, comment #5: 

I built and installed bison 3.0.2 (which required to build and install a more recent version of m4) and added it to the PATH (the bin directory) but still got the same error message when building Octave.
Just in case it might be useful, before the error message copied in my initial post, there is also a similar warning:


parse-tree/lex.cc:3991:13: warning: unused parameter ‘yyscanner’
parse-tree/lex.cc:4331:7: warning: unused parameter ‘yyscanner’
parse-tree/lex.cc:4336:7: warning: unused parameter ‘yyscanner’
parse-tree/lex.cc:4348:6: warning: unused parameter ‘yyscanner’


Guillaume <gyom>
Tue 19 Aug 2014 05:08:28 PM UTC, comment #4: 

I get the same error building default rev 8c648c3a2c8f using bison 2.4.3.

Mike Miller <mtmiller>
Group Member
Tue 19 Aug 2014 04:36:50 PM UTC, comment #3: 

I recently made some changes to allow Octave to be built with Bison 3.0.x.  I didn't intend to break things for earlier versions.  I'll try to take a look at making it work again.

You should be able to build and install bison in whatever directory you like, then put that directory in your PATH ahead of any other that contains bison when you run configure and make.

John W. Eaton <jwe>
Group administrator
Tue 19 Aug 2014 03:46:58 PM UTC, comment #2: 

Sorry for the unclear message: I am trying to compile revision 8c648c3a2c8f
The version of bison that is installed on my system is 2.4.1, which I understand is quite dated but was sufficient to compile Octave until now.
Just in case I do it wrongly, I compile with:


hg pull http://www.octave.org/hg/octave
hg update
./bootstrap
setenv JAVA_HOME /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0
./configure ...
make


If Octave now requires a more recent version of bison than the one I have, is there a way for me to install and compile manually bison 3.0 somewhere and let Octave know where to find that version instead of the system one?

Many thanks for your help.

Guillaume <gyom>
Tue 19 Aug 2014 03:11:07 PM UTC, comment #1: 

Your "tip" is probably not the same as mine, and even if it was at some point, it could easily change from when you reported the problem until now.  To clearly identify what revision you are using, please report the output from running "hg id" in your archive.

What version of bison are you using?

John W. Eaton <jwe>
Group administrator
Tue 19 Aug 2014 01:57:54 PM UTC, original submission:  

When trying to compile the tip, I get the following error:


parse-tree/oct-parse.cc: In function ‘int yypull_parse(yypstate*, octave_base_parser&)’:
parse-tree/oct-parse.cc:3969:14: error: ‘yylex’ was not declared in this scope
oct-parse.yy: In member function ‘int octave_parser::run()’:
oct-parse.yy:3788:29: error: ‘octave_parse’ was not declared in this scope
oct-parse.yy: In member function ‘int octave_push_parser::run(const std::string&, bool)’:
oct-parse.yy:3829:62: error: ‘octave_push_parse’ was not declared in this scope
oct-parse.yy: In member function ‘int octave_parser::run()’:
oct-parse.yy:3789:1: warning: control reaches end of non-void function


Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #32051:  diffs.txt added by jwe (669B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by gyom (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-11-03 mtmiller StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2014-09-09 jwe Attached File- Added diffs.txt, #32051
    2014-08-19 mtmiller StatusNone Confirmed

    Back to the top

    Powered by Savane 3.14-79a4.
    Corresponding source code