P4ELTE / P4Runtime_GRPCPP

P4Runtime API for T4P4S - based on GRPCPP
Apache License 2.0
1 stars 0 forks source link

Error Compiling P4Runtime with T4P4S #3

Open Ume0344 opened 1 year ago

Ume0344 commented 1 year ago

Hi, I am trying to compile P4Runtime with T4P4S by following the instructions in README.md file. But I am getting this error,

Error during the compilation of ? to ./build/last/srcgen/controlplane.c
Traceback (Most recent call first):
NameError: name 'hlir16' is not defined
96  build/last/gen/controlplane.c.py     <module>             --> for table in hlir16.tables: ## src/hardware_indep/controlplane.c.py:42                                  
42  src/hardware_indep/controlplane.c.py ...                  --> #[ extern void table_${table.name}_key(packet_descriptor_t* pd, uint8_t* key); // defined in dataplane.c
390 src/compiler.py                      generate_code        --> exec(compile(code, module_name, 'exec'), localvars, localvars)                                          
418 src/compiler.py                      output_desugared_c   --> code = generate_code(filepath, outpyfile, {'hlir': hlir})                                               
442 src/compiler.py                      generate_desugared_c --> is_multicompiled = output_desugared_c(filename, filepath, 0)                                            
549 src/compiler.py                      generate_files       --> generate_desugared_c(filename, os.path.join(base, filename))                                            
560 src/compiler.py                      main                 --> generate_files()                                                                                        

Error: P4 to C compilation failed (error code: 3)

Does anyone have any idea how to resolve it?

Thank you.

Regards, Habiba

VPetyaa commented 1 year ago

Hi!

I believe you don't have all of the dependencies. Did you run bootstrap-t4p4s.sh? That script should have initialized everything. If not, try running the bootstrap first. Some of those dependencies were added as submodules to the git, if the bootstrap doesn't work try running git submodule update --init --recursive, build the dependencies, and try again. If for any reason it does not work, try to clone the hlir16 repository manually from here: https://github.com/P4ELTE/hlir16

Regards, Peter

Ume0344 commented 1 year ago

Thank you for the response. I ran bootstrap-t4p4s.sh again and it ran perfectly fine. I also manually cloned hlir16 repo again but getting the same error. t4p4s compiles p4-14 programs perfectly, also in t4p4s source code, controlplane.c.py uses hlir variable instead of hlir16 but controlplane.c.py in P4Runtime_GRCPP uses hlir16 instead of hlir). I think there is a problem in setting some environment variables (i.e, hlir or hlir16). Could it be one of the reasons?