Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flex error building verilator under SLES #1219

Closed
veripoolbot opened this issue Sep 21, 2017 · 7 comments
Closed

flex error building verilator under SLES #1219

veripoolbot opened this issue Sep 21, 2017 · 7 comments

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Sep 21, 2017


Author Name: Moira Richmond
Original Redmine Issue: 1219 from https://www.veripool.org


Hi,

My system is using the following OS and tool versions:

OS="SUSE Linux Enterprise Server 11 SP4"
bison (GNU Bison) 1.875
flex version 2.5.4
gcc (GCC) 4.7.2

Under this system I have compiler errors when trying to build verilator as follows:
In file included from V3Lexer_pregen.yy.cpp:245:0,
                  from ../V3ParseLex.cpp:37:
/usr/include/FlexLexer.h:130:14: error: expected unqualified-id before numeric constant
In file included from ../V3ParseLex.cpp:37:0:
V3Lexer_pregen.yy.cpp: In member function ‘virtual int V3LexerBase::yylex()’:
V3Lexer_pregen.yy.cpp:3361:10: error: ‘yy_current_buffer’ was not declared in this scope
In file included from ../V3ParseLex.cpp:37:0:
V3Lexer_pregen.yy.cpp:6799:8: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp:6822:23: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In constructor ‘V3LexerBase::V3LexerBase(std::istream*, std::ostream*)’:
V3Lexer_pregen.yy.cpp:6939:2: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In destructor ‘virtual V3LexerBase::~V3LexerBase()’:
V3Lexer_pregen.yy.cpp:6951:20: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::switch_streams(std::istream*, std::ostream*)’:

Is the build only compatible with Redhat?

Thanks & Regards

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 21, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-09-21T10:34:04Z


Sorry, this should just work. It's probably a bug in the "flex" package, which has been buggy in the past. The file with the error is generated. Please attach V3Lexer_pregen.yy.cpp, and maybe we can find a workaround short of upgrading flex. You also didn't indicate the Verilator version - I assume it is the latest?

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 21, 2017


Original Redmine Comment
Author Name: Moira Richmond
Original Date: 2017-09-21T12:10:20Z


Please find attached V3Lexer_pregen.yy.cpp and V3ParseGrammar.cpp which are both giving me errors under above tool versions.

Yes this is on latest version but I've also tried 3.853 with the same results.

Thanks,
Moira

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 21, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-09-21T12:18:50Z


V3Lexer_pregen.yy.cpp was not attached. What errors do you get from V3ParseGrammar?

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 21, 2017


Original Redmine Comment
Author Name: Moira Richmond
Original Date: 2017-09-21T12:28:47Z


In file incldued from ../V3ParseGrammar.cpp:25:0:
verilog.cL In function 'int yyparse()':
verilog.c:19828:3: error: expected primary-expression before 'attribute'
verilog.c:19828:3: error: expected ';' before 'attribute'
make[2] *** [V3ParseGrammar.o] Error 1

Everytime I try to attach V3Lexer_pregen.yy.cpp I am getting 'Internal Sever Error'. Fault on my side or yours?

Thanks,
Moira

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 21, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-09-21T13:32:26Z


It's only included from V3ParseGrammer, not an error in V3Parse grammar.

Not sure why it isn't posting; you could post as a comment the lines near the error (verilog.c line 19828 and /usr/include/FlexLexer.h line 130)

But no need as I googled the FlexLexer message and it's a known bug in flex 2.5.4 which they fixed in 2.5.4a. You'll need a newer flex. Sorry.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 22, 2017


Original Redmine Comment
Author Name: Moira Richmond
Original Date: 2017-09-22T12:39:43Z


Thanks Wilson, an upgrade to versions of flex and bison fixed the compilation problems.

Could you help me out with one last thing -

When I make and install verilator it all looks good, ~/bin and ~/share contain the executables and directories. However when I go to run this against RTL to generate a model via a render script the script is searching in /usr/local/share/. for the vlstd dir containing vpi_user.h instead of my ~/share/include/verilator/vlstd, even though I thought this should be specified when --prefix was used by the configure script. Is there a way to change the include path?

Thanks,
Moira

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Sep 22, 2017


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-09-22T22:46:24Z


configure --datadir says what to use for includes, but prefix should default that. You can always set VERILATOR_ROOT (to a dir with include/vltstd under it) in your environment to override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.