tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Error Running Sigcomm 2017 Tutorials

Open shyamparekh opened this issue 7 years ago • 4 comments

I just set up a VM for these tutorials. While executing run.sh for the "basic" exercise, I get the following error:

basic.p4(160): error: main: Cannot unify parameter hdr with hdr because they have different directions ) main; ^^^^

basic.p4(65) control MyVerifyChecksum(in headers hdr, input metadata mets) { ^^^

/usr/local/share/p4c/p4include/v1model.p4(197) control VerifyChecksum<H, M>(inout H hdr, ^^^

Compile failed.

Upon a web search, I did see that this issue was raised ~3 weeks back, and was supposedly fixed. However, I still get this error on a fresh install. Any thoughts on how to fix it?

Thanks,

Shyam

shyamparekh avatar Nov 03 '17 07:11 shyamparekh

You'll need to make sure you're on an up-to-date version of p4c and bmv2 (on the VM) and of the tutorial materials themselves. It looks like there is a mis-match.

-N

On Fri, Nov 3, 2017 at 3:16 AM, shyamparekh [email protected] wrote:

I just set up a VM for these tutorials. While executing run.sh for the "basic" exercise, I get the following error:

basic.p4(160): error: main: Cannot unify parameter hdr with hdr because they have different directions ) main; ^^^^

basic.p4(65) control MyVerifyChecksum(in headers hdr, input metadata mets) { ^^^

/usr/local/share/p4c/p4include/v1model.p4(197) control VerifyChecksum<H, M>(inout H hdr, ^^^

Compile failed.

Upon a web search, I did see that this issue was raised ~3 weeks back, and was supposedly fixed. However, I still get this error on a fresh install. Any thoughts on how to fix it?

Thanks,

Shyam

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/p4lang/tutorials/issues/70, or mute the thread https://github.com/notifications/unsubscribe-auth/ABwi0sj-5yFJL150bOrVjoeb6hg4RoCHks5syr3ZgaJpZM4QQuXc .

jnfoster avatar Nov 03 '17 13:11 jnfoster

Thanks Nate! I did "git pull" in the tutorials, /home/vagrant/behavioral-models and /home/vagrant/p4c directories, and rebuilt the code in the /home/vagrant/behavioral-models directory. But, the error is still persisting. Should I be doing something different to follow your suggestion correctly?

Thanks,

Shyam

shyamparekh avatar Nov 03 '17 17:11 shyamparekh

Hi @jnfoster , Did you set env.sh ?

tomyhu1995 avatar Dec 27 '17 02:12 tomyhu1995

If you have the latest p4c, then the program will need to have direction 'inout' for the parameter 'hdr' to the VerifyChecksum control in the P4 program. Likely this P4 program was written to compile with a version of p4c before that change was made, about 2 months ago.

jafingerhut avatar Dec 27 '17 03:12 jafingerhut