menoh icon indicating copy to clipboard operation
menoh copied to clipboard

Unhelpful error message is shown when protobuf-compiler is not installed

Open Hakuyume opened this issue 7 years ago • 5 comments
trafficstars

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

Hakuyume avatar Aug 07 '18 01:08 Hakuyume

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 .

msakai avatar Aug 31 '18 04:08 msakai

@Hakuyume and @okapies, #80 solved the problem?

msakai avatar Sep 06 '18 02:09 msakai

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

okapies avatar Sep 06 '18 05:09 okapies

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 avatar Sep 06 '18 06:09 okapies

@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

WilliamTambellini avatar Jan 28 '19 23:01 WilliamTambellini