menoh
menoh copied to clipboard
Unhelpful error message is shown when protobuf-compiler is not installed
The build process shows unhelpful error message when protobuf-compiler is not installed. Users will check the clone/download step since it says that external/onnx/onnx/onnx.pb.h is missing. The existence of external/onnx/onnx/onnx_pb.h is also confusing. Perhaps, users will think this is a typo.
...
[ 63%] Building CXX object menoh/CMakeFiles/menoh.dir/node.cpp.o
[ 66%] Building CXX object menoh/CMakeFiles/menoh.dir/onnx.cpp.o
/menoh/menoh/onnx.cpp:15:40: fatal error: external/onnx/onnx/onnx.pb.h: No such file or directory
compilation terminated.
menoh/CMakeFiles/menoh.dir/build.make:614: recipe for target 'menoh/CMakeFiles/menoh.dir/onnx.cpp.o' failed
CMakeFiles/Makefile2:328: recipe for target 'menoh/CMakeFiles/menoh.dir/all' failed
make[2]: *** [menoh/CMakeFiles/menoh.dir/onnx.cpp.o] Error 1
make[1]: *** [menoh/CMakeFiles/menoh.dir/all] Error 2
make: *** [all] Error 2
Makefile:127: recipe for target 'all' failed
FYI: I encountered another issue that causes the error (#79).
One way to solve the issue is checking the exit code of protoc and aborting cmake when failure.
But it is likely to move the invocation from cmake phase to make phase to solve #79 .
@Hakuyume and @okapies, #80 solved the problem?
I have not checked yet but I believe the following line produces an appropriate message if protoc doesn't exist.
https://github.com/pfnet-research/menoh/blob/ea58902ea1086bfab1884e51a390f259a9207106/cmake/GenerateOnnxSrc.cmake#L20
It shows the following message now. Is it enough? @Hakuyume
-- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
CMake Error at /usr/local/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) (Required is at
least version "2.6.1")
Call Stack (most recent call first):
/usr/local/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.12/Modules/FindProtobuf.cmake:543 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/SetupProtobuf.cmake:53 (find_package)
CMakeLists.txt:56 (include)
@okapies I agree cmake should early check the version of protobuf (and perhaps any thirdparties).
A similar issue :
https://github.com/pfnet-research/menoh/issues/203