Search code examples
c++makefileprotocol-buffersgrpcopensuse

“make: protoc: Command not found” while installing grpc from source


I have cloned this repository https://github.com/grpc/grpc.git for installing the grpc. I want to use the framework with C++ programming so I followed the instructions given in folder src/cpp.

To build grpc for C++ from the source (in OpenSUSE) there are some pre-requisites given in this link

 $ [sudo] apt-get install build-essential autoconf libtool pkg-config

As mentioned, to build from source and run tests, one needs

$ [sudo] apt-get install libgflags-dev libgtest-dev
$ [sudo] apt-get install clang libc++-dev

I could not find any build-essential, libgflags-dev and libgtest-dev. I don't know whether this is the reason for not getting grpc installed.

Later, I have manually installed protocol buffer compiler protoc before running the make.

When I run make in the grpc root directory. I get this error

[PROTOC]  Generating protobuf CC file from src/proto/grpc/channelz/channelz.proto
make: protoc: Command not found
make: *** [Makefile:2601: /home/rohan/Downloads/grpc/gens/src/proto/grpc/channelz/channelz.pb.cc] Error 127

Unable to figure out why this error is showing as I already have installed protoc. Is some linking problem, then please share how to solve it. I am new to Linux so I really am a little bit hesitant to change and env file or some make file by my own.

Please suggest some help. Thanks for your time.


Solution

  • I have resolved this problem by installing protocol buffer compiler properly.

    The important step which I forgot to do earlier is to update the submodules with git submodule update --init --recursive when you are building protoc with git repository.

    The steps for C++ version are mentioned at this link.

    Thanks,