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

Compilation error with clang++3.8 #63

Closed
hanw opened this issue Jun 24, 2016 · 3 comments
Closed

Compilation error with clang++3.8 #63

hanw opened this issue Jun 24, 2016 · 3 comments

Comments

@hanw
Copy link
Contributor

hanw commented Jun 24, 2016

Tried to compile p4c in docker's ubuntu-latest image with clang++3.8, but got the following error.

root@d8f907559953:~/p4c/build# make -j4
CXX tools/ir-generator/ir-generator.o
CXX lib/crash.o
CXX lib/gc.o
CXX lib/hex.o
CXX lib/indent.o
CXX lib/json.o
CXX lib/log.o
../tools/ir-generator/ir-generator.ypp:140:13: error: use of undeclared identifier 'PARSE_BRACKET'
{ BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:170:49: error: use of undeclared identifier 'PARSE_BRACKET'
{ (yyval.kind) = NodeKind::Interface; BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:171:48: error: use of undeclared identifier 'PARSE_BRACKET'
{ (yyval.kind) = NodeKind::Abstract; BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:172:48: error: use of undeclared identifier 'PARSE_BRACKET'
{ (yyval.kind) = NodeKind::Concrete; BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:194:13: error: use of undeclared identifier 'PARSE_BRACKET'
{ BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:209:13: error: use of undeclared identifier 'PARSE_CTOR_INIT'
{ BEGIN(PARSE_CTOR_INIT); }
^
../tools/ir-generator/ir-generator.ypp:212:19: error: use of undeclared identifier 'NORMAL'
BEGIN(NORMAL); }
^
../tools/ir-generator/ir-generator.ypp:366:13: error: use of undeclared identifier 'yyrestart'
yyrestart(fp);
^
../tools/ir-generator/ir-generator.ypp:367:19: error: use of undeclared identifier 'NORMAL'
BEGIN(NORMAL);
^
CXX lib/match.o
9 errors generated.
Makefile:1828: recipe for target 'tools/ir-generator/ir-generator.o' failed
make: *** [tools/ir-generator/ir-generator.o] Error 1
make: *** Waiting for unfinished jobs....

@mihaibudiu
Copy link
Contributor

This is very strange. There should be a file generated by flex: build/tools/ir-generator-lex.c, which should be #included in this one, which contains the definition of PARSE_BRACKET. Is this the whole output from make? I don't see where flex has been executed.

@ChrisDodd
Copy link
Contributor

That looks like something went wrong with flex generation, since those are
all symbols defined in the code generated by flex. Try rm
tools/ir-generator/ir-generator-lex.c and then run make again...

On Thu, Jun 23, 2016 at 5:20 PM, Han Wang notifications@github.com wrote:

Tried to compile p4c in docker's ubuntu-latest image with clang++3.8, but
got the following error.

root@d8f9075 https://github.com/root/p4c/commit/d8f907559953:~/p4c/build#
make -j4
CXX tools/ir-generator/ir-generator.o
CXX lib/crash.o
CXX lib/gc.o
CXX lib/hex.o
CXX lib/indent.o
CXX lib/json.o
CXX lib/log.o
../tools/ir-generator/ir-generator.ypp:140:13: error: use of undeclared
identifier 'PARSE_BRACKET'
{ BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:170:49: error: use of undeclared
identifier 'PARSE_BRACKET'
{ (yyval.kind) = NodeKind::Interface; BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:171:48: error: use of undeclared
identifier 'PARSE_BRACKET'
{ (yyval.kind) = NodeKind::Abstract; BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:172:48: error: use of undeclared
identifier 'PARSE_BRACKET'
{ (yyval.kind) = NodeKind::Concrete; BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:194:13: error: use of undeclared
identifier 'PARSE_BRACKET'
{ BEGIN(PARSE_BRACKET); }
^
../tools/ir-generator/ir-generator.ypp:209:13: error: use of undeclared
identifier 'PARSE_CTOR_INIT'
{ BEGIN(PARSE_CTOR_INIT); }
^
../tools/ir-generator/ir-generator.ypp:212:19: error: use of undeclared
identifier 'NORMAL'
BEGIN(NORMAL); }
^
../tools/ir-generator/ir-generator.ypp:366:13: error: use of undeclared
identifier 'yyrestart'
yyrestart(fp);
^
../tools/ir-generator/ir-generator.ypp:367:19: error: use of undeclared
identifier 'NORMAL'
BEGIN(NORMAL);
^
CXX lib/match.o
9 errors generated.
Makefile:1828: recipe for target 'tools/ir-generator/ir-generator.o' failed
make: *** [tools/ir-generator/ir-generator.o] Error 1
make: *** Waiting for unfinished jobs....


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#63, or mute the thread
https://github.com/notifications/unsubscribe/AD4c8TPiZ4N02FmZ_yHpImletMfVgUQEks5qOyLkgaJpZM4I9XAQ
.

@hanw
Copy link
Contributor Author

hanw commented Jun 24, 2016

Thanks, I removed build directory and rerun ./bootstrap.sh, compilation is successful this time.
I installed clang++, instead of g++ this time. That might be the reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants