Custom compile and install for protobuf and grpc

675 views
Skip to first unread message

siddhesh...@gmail.com

unread,
Jul 7, 2018, 12:39:43 AM7/7/18
to grpc.io
Hi,

I am trying to get protobuf and grpc to get installed in non standard location.

Below is what I do for protobuf and grpc.

protobuf:
./autogen.sh
./configure·--disable-shared·--enable-static·--prefix=$DIR·&&·make·&&·make·install

grpc:
make·prefix=$DIR
make··prefix=$DIR·install

Protobuf is getting installed properly however grpc gives following error.

[GRPC]    Generating gRPC's protobuf service CC file from src/proto/grpc/channelz/channelz.proto
grpc/bins/opt/grpc_cpp_plugin: error while loading shared libraries: libprotoc.so.16: cannot open shared object file: No such file or directory
--grpc_out: protoc-gen-grpc: Plugin failed with status code 127.
make: *** [grpc/gens/src/proto/grpc/channelz/channelz.grpc.pb.cc] Error 1

Has anyone tried this before ?

Carl Mastrangelo

unread,
Jul 9, 2018, 4:22:32 PM7/9/18
to grpc.io
Don't you need to run ldconfig after building and installing protobuf?   

siddhesh...@gmail.com

unread,
Jul 11, 2018, 1:00:52 PM7/11/18
to grpc.io
Hi Carl,

Thanks for replying.

I don't want to use "sudo" which is required to run ldconfig.

Initially i was compiling protobuf separately and when grpc was getting compiled
it was also trying to build protobuf from its third-party directory which was messing things up.

Now I just build protobuf from grpc's third-party directory and set LD_LIBRARY_PATH if needed.
Its been working so far.
Reply all
Reply to author
Forward
0 new messages