osinstom / P4-OvS

Bringing the power of P4 to OvS!
Apache License 2.0
73 stars 15 forks source link

Compile demo p4 #1

Closed Dscano closed 4 years ago

Dscano commented 4 years ago

Hi,

I download and install P4-OvS succesfully, then I try to run the demo https://github.com/osinstom/P4-OvS/blob/p4/Documentation/topics/p4/getting-started.md and when I try to compile the demo-2.p4 and demo.p4 I get this error.

p4c-ubpf --arch ubpf -o demo.c --p4runtime-files demo.p4info.txt demo-2.p4
demo-2.p4(41):syntax error, unexpected IDENTIFIER "standard_metadata"
parser prs(packet_in packet, out Headers_t hdr, inout metadata meta, inout standard_metadata
                                                                           ^^^^^^^^^^^^^^^^^
error: 1 errors encountered, aborting compilation
osinstom commented 4 years ago

Hi!

Please, make sure you have the latest version of p4c installed on your environment. The error above indicates that the architecture model used for compilation is an old one. I suggest you to re-install p4c.

Note that the current architecture model is located under /usr/local/share/p4c/p4include/ubpf_model.p4. Make sure there is the newest version there.

Dscano commented 4 years ago

Hi osinstom,

My "p4 tools" are installed on ubunthu 16.04. I have reinstall p4c last friday, I checked the various folders, e.g, p4include,backend,include etc and the ubpf files are present. I'll try to reinstall all the environment Thank you.