Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1219

flex error building verilator under SLES

Added by Moira Richmond about 2 years ago. Updated almost 2 years ago.

Status:
NoFixNeeded
Priority:
High
Assignee:
-
Category:
-
% Done:

0%


Description

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

V3ParseGrammar.cpp View (1.08 KB) Moira Richmond, 09/21/2017 12:10 PM

History

#1 Updated by Wilson Snyder about 2 years ago

  • Description updated (diff)

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?

#2 Updated by Wilson Snyder about 2 years ago

  • Subject changed from building verilator under SLES to flex error building verilator under SLES
  • Status changed from New to AskedReporter

#3 Updated by Moira Richmond about 2 years ago

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

#4 Updated by Wilson Snyder about 2 years ago

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

#5 Updated by Moira Richmond about 2 years ago

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__' make2 *** [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

#6 Updated by Wilson Snyder about 2 years ago

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.

#7 Updated by Moira Richmond almost 2 years ago

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

#8 Updated by Wilson Snyder almost 2 years ago

  • Status changed from AskedReporter to NoFixNeeded

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.

Also available in: Atom