Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Hakuyume opened this issue Aug 7, 2018 · 5 comments

Comments

@Hakuyume
Copy link
Contributor

Hakuyume commented Aug 7, 2018

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
@msakai
Copy link
Member

msakai commented Aug 31, 2018

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
Copy link
Member

msakai commented Sep 6, 2018

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

@okapies
Copy link
Member

okapies commented Sep 6, 2018

I have not checked yet but I believe the following line produces an appropriate message if protoc doesn't exist.

DEPENDS ${PROTOBUF_PROTOC_EXECUTABLE} ${ONNX_SRC_DIR}/onnx/onnx.proto

@okapies
Copy link
Member

okapies commented Sep 6, 2018

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)

@WilliamTambellini
Copy link

@okapies I agree cmake should early check the version of protobuf (and perhaps any thirdparties).
A similar issue :
#203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants