Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upWith p4c from today (11/29/2018) flexsai fails to build #896
Comments
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
Maybe, more cleanup is needed. git checkout 6d265b2d15b927db522c08f36a60fe23784e8357 The commit is related to this PR: p4lang/p4c#1219 |
hesingh commentedNov 30, 2018
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$