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

Trouble building on Mac OS X El Capitan #83

Closed
anirudhSK opened this issue Sep 17, 2016 · 2 comments
Closed

Trouble building on Mac OS X El Capitan #83

anirudhSK opened this issue Sep 17, 2016 · 2 comments

Comments

@anirudhSK
Copy link
Contributor

I am having some trouble building on Mac OS X.

  1. It complains of yellow and yylval not being defined. For instance,

CXX tools/ir-generator/ir-generator.o
In file included from ../tools/ir-generator/ir-generator.ypp:120:
:857:1: error: use of undeclared identifier 'yylloc'
YY_RULE_SETUP
^
:760:2: note: expanded from macro 'YY_RULE_SETUP'
YY_USER_ACTION
^
../tools/ir-generator/ir-generator-lex.l:5:7: note: expanded from macro 'YY_USER_ACTION'
yylloc = Util::SourceInfo(tmp, Util::InputSources::instance->getCurrentPosition()); }

1. I "fixed" this by adding two extern declarations at the top of tools/ir-generator/ir-generator-lex.l

extern YYSTYPE yylval;
extern YYLTYPE yylloc;

Not sure if this was correct, but it moved on.

  1. Then, I ran into this. It seems like a value is being substituted for a template parameter, where it is expecting a type.

In file included from ../ir/ir.h:42:
../ir/nodemap.h:22:10: error: declaration of anonymous class must be a definition
template<class KEY, class VALUE,
^
../ir/nodemap.h:22:32: error: a non-type template parameter cannot have type 'class VALUE'
template<class KEY, class VALUE,
^
../ir/nodemap.h:25:55: error: expected a type
class ALLOC = std::allocator<std::pair<const KEY * const, const VALUE *>>>
^
frontends/p4/p4-parse.cpp:161:13: note: expanded from macro 'KEY'

define KEY 290

        ^

There are more errors, possibly resulting from the same cause, attached in the file here.
err.txt

  1. I seem to run into these where I use g++ or clang++ on Mac (specified using CXX="..." ./boostrap.sh).

Not sure if this is important, but I use ports, not brew for installing bison, flex, boost, and auto tools.

@cc10512
Copy link
Contributor

cc10512 commented Sep 17, 2016

make sure that the ports installed bison is in your path before the system installed bison.

@anirudhSK
Copy link
Contributor Author

Ok, this fixed the problem. Thanks!

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

2 participants