You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that if one has python2.7 and also python 3.6m installed on their build machine, the flexsai cmake loses its brain. I had to force specific python3 path in flexsai/p4/backend/CMakeLists.txt and then compiling and linking passed. I also made one change to sai.cpp to fix compiling. Diffs are included as attached file.
It also makes sense to remove all Python code from sai.cpp and just use C/C++ code. p4c code has long back changed to parsing options using p4c/frontend/common/options.cpp. Time permitting, I can make the code change. If anyone has cycles, please make the code change.
I used the steps to build from https://github.com/opencomputeproject/SAI/tree/master/flexsai/p4/README.md.
The p4c used is from today. I see the following error on invoking 'make -j3' in p4c/build/
/home/hemant/bak/p4c/extensions/sai/json_stage/sai.cpp: In function ‘int main_wrapper(int, char* const*)’:
/home/hemant/bak/p4c/extensions/sai/json_stage/sai.cpp:128:18: error: ‘Py_DecodeLocale’ was not declared in this scope
py_argv[0] = Py_DecodeLocale("P4_compiler.py", NULL);
^~~~~~~~~~~~~~~
/home/hemant/bak/p4c/extensions/sai/json_stage/sai.cpp:128:18: note: suggested alternative: ‘PyEval_GetLocals’
py_argv[0] = Py_DecodeLocale("P4_compiler.py", NULL);
^~~~~~~~~~~~~~~
PyEval_GetLocals
/home/hemant/bak/p4c/extensions/sai/json_stage/sai.cpp:141:35: error: cannot convert ‘wchar_t**’ to ‘char**’ for argument ‘2’ to ‘void PySys_SetArgv(int, char**)’
PySys_SetArgv(py_argc, py_argv);
^
extensions/sai/CMakeFiles/p4c-sai.dir/build.make:62: recipe for target 'extensions/sai/CMakeFiles/p4c-sai.dir/json_stage/sai.cpp.o' failed
make[2]: *** [extensions/sai/CMakeFiles/p4c-sai.dir/json_stage/sai.cpp.o] Error 1
CMakeFiles/Makefile2:734: recipe for target 'extensions/sai/CMakeFiles/p4c-sai.dir/all' failed
make[1]: *** [extensions/sai/CMakeFiles/p4c-sai.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 98%] Linking CXX executable gtestp4c
[ 98%] Built target gtestp4c
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
hemant@ubuntu:~/bak/p4c/build$
The text was updated successfully, but these errors were encountered: